From: <ale...@us...> - 2015-11-15 11:57:42
|
Revision: 62558 http://sourceforge.net/p/firebird/code/62558 Author: alexpeshkoff Date: 2015-11-15 11:57:39 +0000 (Sun, 15 Nov 2015) Log Message: ----------- Fixed CORE-5017: Interrupt of aux connection during TCP setup phase causes server exit due to unhandled exception Modified Paths: -------------- firebird/trunk/src/remote/inet.cpp firebird/trunk/src/remote/os/win32/wnet.cpp firebird/trunk/src/remote/os/win32/xnet.cpp firebird/trunk/src/remote/server/server.cpp Modified: firebird/trunk/src/remote/inet.cpp =================================================================== --- firebird/trunk/src/remote/inet.cpp 2015-11-14 00:10:02 UTC (rev 62557) +++ firebird/trunk/src/remote/inet.cpp 2015-11-15 11:57:39 UTC (rev 62558) @@ -1504,7 +1504,7 @@ } rem_port* const new_port = alloc_port(port->port_parent, - (port->port_flags & PORT_no_oob) | PORT_async); + (port->port_flags & PORT_no_oob) | PORT_async | PORT_connecting); port->port_async = new_port; new_port->port_dummy_packet_interval = port->port_dummy_packet_interval; new_port->port_dummy_timeout = new_port->port_dummy_packet_interval; @@ -1590,6 +1590,7 @@ MutexLockGuard guard(port_mutex, FB_FUNCTION); port->port_state = rem_port::DISCONNECTED; + port->port_flags &= ~PORT_connecting; if (port->port_async) { @@ -1935,7 +1936,8 @@ if (!REMOTE_inflate(port, packet_receive, buffer, bufsize, length)) { - if (port->port_flags & PORT_disconnect) { + if (port->port_flags & (PORT_disconnect | PORT_connecting)) + { continue; } *length = 0; Modified: firebird/trunk/src/remote/os/win32/wnet.cpp =================================================================== --- firebird/trunk/src/remote/os/win32/wnet.cpp 2015-11-14 00:10:02 UTC (rev 62557) +++ firebird/trunk/src/remote/os/win32/wnet.cpp 2015-11-15 11:57:39 UTC (rev 62558) @@ -631,9 +631,9 @@ const DWORD server_pid = (vport->port_server_flags & SRVR_multi_client) ? ++event_counter : GetCurrentProcessId(); rem_port* const new_port = alloc_port(vport->port_parent); + new_port->port_server_flags = vport->port_server_flags; + new_port->port_flags = (vport->port_flags & PORT_no_oob) | PORT_connecting; vport->port_async = new_port; - new_port->port_server_flags = vport->port_server_flags; - new_port->port_flags = vport->port_flags & PORT_no_oob; TEXT str_pid[32]; wnet_make_file_name(str_pid, server_pid); @@ -731,6 +731,7 @@ // If this is a sub-port, unlink it from its parent port->unlinkParent(); + port->port_flags &= ~PORT_connecting; if (port->port_server_flags & SRVR_server) { Modified: firebird/trunk/src/remote/os/win32/xnet.cpp =================================================================== --- firebird/trunk/src/remote/os/win32/xnet.cpp 2015-11-14 00:10:02 UTC (rev 62557) +++ firebird/trunk/src/remote/os/win32/xnet.cpp 2015-11-15 11:57:39 UTC (rev 62558) @@ -888,10 +888,10 @@ channel_s2c_client_ptr, xcc->xcc_send_channel->xch_size, channel_c2s_client_ptr, xcc->xcc_recv_channel->xch_size); - port->port_async = new_port; new_port->port_xcc = xcc; - new_port->port_flags = port->port_flags & PORT_no_oob; + new_port->port_flags = (port->port_flags & PORT_no_oob) | PORT_connecting; new_port->port_server_flags = port->port_server_flags; + port->port_async = new_port; P_RESP* response = &packet->p_resp; response->p_resp_data.cstr_length = 0; @@ -1441,6 +1441,7 @@ // If this is a sub-port, unlink it from it's parent port->unlinkParent(); + port->port_flags &= ~PORT_connecting; xnet_ports->unRegisterPort(port); cleanup_port(port); } Modified: firebird/trunk/src/remote/server/server.cpp =================================================================== --- firebird/trunk/src/remote/server/server.cpp 2015-11-14 00:10:02 UTC (rev 62557) +++ firebird/trunk/src/remote/server/server.cpp 2015-11-15 11:57:39 UTC (rev 62558) @@ -2289,20 +2289,22 @@ if (aux_port) { - aux_port->port_flags |= PORT_connecting; + fb_assert(aux_port->port_flags & PORT_connecting); bool connected = false; try { connected = aux_port->connect(send) != NULL; if (connected) + { aux_port->port_context = rdb; + aux_port->port_flags &= ~PORT_connecting; + } } catch (const Exception& ex) { iscLogException("", ex); } - aux_port->port_flags &= ~PORT_connecting; if (!connected) { fb_assert(port->port_async == aux_port); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |