SocketHookManager fix

This commit is contained in:
Gravit 2018-12-29 17:20:51 +07:00
parent 4d7234512c
commit cf5867c131
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -117,18 +117,19 @@ public void run() {
context.type = handshake.type; context.type = handshake.type;
// Start response // Start response
socketHookManager.preHook(context); if(socketHookManager.preHook(context))
try { {
respond(handshake.type, input, output, handshake.session, context.ip); try {
socketHookManager.postHook(context); respond(handshake.type, input, output, handshake.session, context.ip);
} catch (RequestException e) { socketHookManager.postHook(context);
if(server.socketHookManager.errorHook(context,e)) } catch (RequestException e) {
{ if(server.socketHookManager.errorHook(context,e))
LogHelper.subDebug(String.format("#%d Request error: %s", handshake.session, e.getMessage())); {
if(e.getMessage() == null) LogHelper.error(e); LogHelper.subDebug(String.format("#%d Request error: %s", handshake.session, e.getMessage()));
output.writeString(e.getMessage(), 0); if(e.getMessage() == null) LogHelper.error(e);
output.writeString(e.getMessage(), 0);
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
savedError = e; savedError = e;