From: <ale...@us...> - 2015-11-12 13:43:40
|
Revision: 62552 http://sourceforge.net/p/firebird/code/62552 Author: alexpeshkoff Date: 2015-11-12 13:43:38 +0000 (Thu, 12 Nov 2015) Log Message: ----------- Fixed CORE-5014: Interrupt of aux connection during TCP setup phase causes unclear error messages in firebird.log Modified Paths: -------------- firebird/trunk/src/remote/inet.cpp firebird/trunk/src/remote/server/server.cpp Modified: firebird/trunk/src/remote/inet.cpp =================================================================== --- firebird/trunk/src/remote/inet.cpp 2015-11-12 07:23:08 UTC (rev 62551) +++ firebird/trunk/src/remote/inet.cpp 2015-11-12 13:43:38 UTC (rev 62552) @@ -147,14 +147,15 @@ static void SOCLOSE(SOCKET& socket) { - if (socket != INVALID_SOCKET) + SOCKET s = socket; + if (s != INVALID_SOCKET) { + socket = INVALID_SOCKET; #ifdef WIN_NT - closesocket(socket); + closesocket(s); #else - close(socket); + close(s); #endif - socket = INVALID_SOCKET; } } @@ -1366,6 +1367,9 @@ } } + if (port->port_channel == INVALID_SOCKET) + return NULL; + const SOCKET n = os_utils::accept(port->port_channel, NULL, NULL); inetErrNo = INET_ERRNO; Modified: firebird/trunk/src/remote/server/server.cpp =================================================================== --- firebird/trunk/src/remote/server/server.cpp 2015-11-12 07:23:08 UTC (rev 62551) +++ firebird/trunk/src/remote/server/server.cpp 2015-11-12 13:43:38 UTC (rev 62552) @@ -2288,20 +2288,25 @@ if (aux_port) { aux_port->port_flags |= PORT_connecting; + bool connected = false; try { - if (aux_port->connect(send)) + connected = aux_port->connect(send) != NULL; + if (connected) aux_port->port_context = rdb; } catch (const Exception& ex) { - aux_port->port_flags &= ~PORT_connecting; iscLogException("", ex); + } + + aux_port->port_flags &= ~PORT_connecting; + if (!connected) + { fb_assert(port->port_async == aux_port); port->port_async = NULL; aux_port->disconnect(); } - aux_port->port_flags &= ~PORT_connecting; } } catch (const Exception& ex) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |