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;
// Start response
socketHookManager.preHook(context);
try {
respond(handshake.type, input, output, handshake.session, context.ip);
socketHookManager.postHook(context);
} 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);
output.writeString(e.getMessage(), 0);
if(socketHookManager.preHook(context))
{
try {
respond(handshake.type, input, output, handshake.session, context.ip);
socketHookManager.postHook(context);
} 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);
output.writeString(e.getMessage(), 0);
}
}
}
} catch (Exception e) {
savedError = e;