mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
smbd:smb2_server: let smbd_server_connection_terminate() only call exit_server() for the last connection
TODO: We need to cancel pending requests on the connection and defer the talloc_free. Currently we only ever have one connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
a446966e71
commit
cfbf450900
@ -1059,8 +1059,21 @@ void smbd_server_connection_terminate_ex(struct smbXsrv_connection *xconn,
|
||||
const char *reason,
|
||||
const char *location)
|
||||
{
|
||||
DEBUG(10,("smbd_server_connection_terminate_ex: reason[%s] at %s\n",
|
||||
reason, location));
|
||||
struct smbXsrv_client *client = xconn->client;
|
||||
|
||||
DEBUG(10,("smbd_server_connection_terminate_ex: conn[%s] reason[%s] at %s\n",
|
||||
smbXsrv_connection_dbg(xconn), reason, location));
|
||||
|
||||
if (client->connections->next != NULL) {
|
||||
/* TODO: cancel pending requests */
|
||||
DLIST_REMOVE(client->connections, xconn);
|
||||
TALLOC_FREE(xconn);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The last connection was disconnected
|
||||
*/
|
||||
exit_server_cleanly(reason);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user