From cb5ba6b3c99919acd964bc86caaff0aa47e1ea9a Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 2 Aug 2011 01:55:18 +0200 Subject: Core/RA: Fix RA subnegotiation for clients that don't send any subnegotiation data (like telnet) by setting a 1 second time window in which the client can send their packet before the RASocket will begin actual authentication. Closes #2471 --- src/server/worldserver/RemoteAccess/RASocket.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/server/worldserver') diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index c813c2497f1..3268428d5de 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -276,8 +276,9 @@ int RASocket::subnegotiate() const size_t recv_size = message_block.space(); + // Wait a maximum of 1000ms for negotiation packet - not all telnet clients may send it const ssize_t n = peer().recv(message_block.wr_ptr(), - recv_size); + recv_size, &ACE_Time_Value(1)); if (n <= 0) return int(n); @@ -331,11 +332,8 @@ int RASocket::subnegotiate() int RASocket::svc(void) { - if (subnegotiate() == -1) - { - sLog->outRemote("Subnegotiation failed!"); - return -1; - } + //! Subnegotiation may differ per client - do not react on it + subnegotiate(); if (send("Authentication required\r\n") == -1) return -1; -- cgit v1.2.3