From 763f9d4f5ded814afd6dc89ed3c4ad4ae52a7b53 Mon Sep 17 00:00:00 2001 From: danielr Date: Tue, 22 Apr 2008 09:03:16 +0000 Subject: [PATCH] serverCore: setting timeout for new connection before SSLDetect git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4723 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/server/serverCore.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java index 13b95926b..2f1891050 100644 --- a/source/de/anomic/server/serverCore.java +++ b/source/de/anomic/server/serverCore.java @@ -409,16 +409,6 @@ public final class serverCore extends serverAbstractBusyThread implements server // wait for new connection Socket controlSocket = this.socket.accept(); - // wrap this socket - if (this.sslSocketFactory != null) { - controlSocket = new serverCoreSocket(controlSocket); - - // if the current connection is SSL we need to do a handshake - if (((serverCoreSocket)controlSocket).isSSL()) { - controlSocket = negotiateSSL(controlSocket); - } - } - announceThreadBlockRelease(); String cIP = clientAddress(controlSocket); @@ -441,6 +431,16 @@ public final class serverCore extends serverAbstractBusyThread implements server // setting the timeout properly assert this.timeout >= 1000; controlSocket.setSoTimeout(this.timeout); + + // wrap this socket + if (this.sslSocketFactory != null) { + controlSocket = new serverCoreSocket(controlSocket); + + // if the current connection is SSL we need to do a handshake + if (((serverCoreSocket)controlSocket).isSSL()) { + controlSocket = negotiateSSL(controlSocket); + } + } // keep-alive: if set to true, the server frequently sends keep-alive packets to the client which the client must respond to // we set this to false to prevent that a missing ack from the client forces the server to close the connection // controlSocket.setKeepAlive(false);