1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

libcli/smb: close the socket fd at the end of smbXcli_conn_disconnect()

We need to cancel all pending requests before closing the socket fds,
otherwise we cause problem with the interaction with the epoll event backend.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Stefan Metzmacher 2015-05-28 13:09:11 +02:00
parent 26c4b3fc9d
commit 46e1aa22b1

View File

@ -997,15 +997,11 @@ static bool smbXcli_conn_receive_next(struct smbXcli_conn *conn)
void smbXcli_conn_disconnect(struct smbXcli_conn *conn, NTSTATUS status)
{
struct smbXcli_session *session;
int read_fd = conn->read_fd;
int write_fd = conn->write_fd;
tevent_queue_stop(conn->outgoing);
if (conn->read_fd != -1) {
close(conn->read_fd);
}
if (conn->write_fd != -1) {
close(conn->write_fd);
}
conn->read_fd = -1;
conn->write_fd = -1;
@ -1088,6 +1084,13 @@ void smbXcli_conn_disconnect(struct smbXcli_conn *conn, NTSTATUS status)
}
TALLOC_FREE(chain);
}
if (read_fd != -1) {
close(read_fd);
}
if (write_fd != -1) {
close(write_fd);
}
}
/*