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>
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;
}
TALLOC_FREE(chain);
}
+
+ if (read_fd != -1) {
+ close(read_fd);
+ }
+ if (write_fd != -1) {
+ close(write_fd);
+ }
}
/*