From bc78460f636206cfffd7ec73b397a01a68aa3e80 Mon Sep 17 00:00:00 2001 From: "Francisco Blas (klondike) Izquierdo Riera" Date: Tue, 6 Jan 2015 20:27:55 +0100 Subject: [PATCH] Enter state BEFORE reading data to avoid race conditions --- SOCKS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOCKS.h b/SOCKS.h index 599f18ad..f0d5ceec 100644 --- a/SOCKS.h +++ b/SOCKS.h @@ -133,7 +133,7 @@ namespace proxy SOCKSHandler(SOCKSServer * parent, boost::asio::ip::tcp::socket * sock) : m_parent(parent), m_sock(sock), m_stream(nullptr), m_authchosen(AUTH_UNACCEPTABLE), m_addrtype(ADDR_IPV4), dead(false) - { m_address.ip = 0; AsyncSockRead(); EnterState(GET_SOCKSV); } + { m_address.ip = 0; EnterState(GET_SOCKSV); AsyncSockRead(); } ~SOCKSHandler() { Terminate(); } };