8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 12:43:03 +01:00

Fixed unexpected server exits. Slightly better diagnostics for them added.

This commit is contained in:
alexpeshkoff 2008-03-13 12:05:49 +00:00
parent 73759d2d02
commit 627e7f2846
2 changed files with 11 additions and 3 deletions

View File

@ -1730,12 +1730,12 @@ static void cleanup_port( rem_port* port)
delete port->port_queue; delete port->port_queue;
port->port_que_sync->release(); port->port_que_sync->release();
#endif #endif
port->port_sync->release();
#ifdef TRUSTED_AUTH #ifdef TRUSTED_AUTH
delete port->port_trusted_auth; delete port->port_trusted_auth;
#endif #endif
port->port_sync->release();
ALLR_free(port); ALLR_free(port);
return; return;
} }
@ -3483,6 +3483,7 @@ static void unhook_disconnected_ports(rem_port* main_port)
if (port->port_state == state_disconnected) { if (port->port_state == state_disconnected) {
more = true; more = true;
unhook_port(port, port->port_parent); unhook_port(port, port->port_parent);
port->port_sync->leave();
cleanup_port(port); cleanup_port(port);
break; break;
} }

View File

@ -567,7 +567,10 @@ void SRVR_multi_thread( rem_port* main_port, USHORT flags)
// gds__log("op=%d ds=%d", request->req_receive.p_operation, dataSize); // gds__log("op=%d ds=%d", request->req_receive.p_operation, dataSize);
request->req_port = port; request->req_port = port;
port->port_sync->leave(); if (portLocked)
{
port->port_sync->leave();
}
if (!link_request(port, request)) if (!link_request(port, request))
{ {
@ -596,6 +599,10 @@ void SRVR_multi_thread( rem_port* main_port, USHORT flags)
} }
catch (const Firebird::Exception& e) catch (const Firebird::Exception& e)
{ {
gds__log("SRVR_multi_thread: shutting down due to unhandled exception");
Firebird::stuff_exception(status_vector, e);
gds__log_status(0, status_vector);
/* If we got as far as having a port allocated before the error, disconnect it /* If we got as far as having a port allocated before the error, disconnect it
* gracefully. * gracefully.
*/ */
@ -610,7 +617,7 @@ void SRVR_multi_thread( rem_port* main_port, USHORT flags)
/* To handle recursion within the error handler */ /* To handle recursion within the error handler */
try { try {
Firebird::stuff_exception(status_vector, e);
/* If we have a port, request really should be non-null, but just in case ... */ /* If we have a port, request really should be non-null, but just in case ... */
if (request != NULL) { if (request != NULL) {
/* Send client a real status indication of why we disconnected them */ /* Send client a real status indication of why we disconnected them */