diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-17 00:09:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:18 -0500 |
commit | 5c332f6e9d27c6cdaa885a52312d90ac3835c90b (patch) | |
tree | 7fb1f71ecb478963b19b045d471e7894111930e3 /source4/librpc | |
parent | 3422499a857d51976e0c1d4875c8406ef36e654f (diff) | |
download | samba-5c332f6e9d27c6cdaa885a52312d90ac3835c90b.tar.gz samba-5c332f6e9d27c6cdaa885a52312d90ac3835c90b.tar.bz2 samba-5c332f6e9d27c6cdaa885a52312d90ac3835c90b.zip |
r7659: fixup the ordering of socket destruction for ncacn_ip_tcp so we don't try and
remove an epoll descriptor for a closed fd
(This used to be commit bec5e9f80a934e6472e8d227214a9baba4f15054)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc_sock.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c index e309c2720c..d7f87e9706 100644 --- a/source4/librpc/rpc/dcerpc_sock.c +++ b/source4/librpc/rpc/dcerpc_sock.c @@ -58,6 +58,7 @@ static void sock_dead(struct dcerpc_connection *p, NTSTATUS status) struct sock_private *sock = p->transport.private; if (sock && sock->sock != NULL) { + talloc_free(sock->fde); talloc_free(sock->sock); sock->sock = NULL; } @@ -72,8 +73,6 @@ static void sock_dead(struct dcerpc_connection *p, NTSTATUS status) if (!NT_STATUS_IS_OK(status)) { p->transport.recv_data(p, NULL, status); } - - talloc_free(sock->fde); } /* @@ -107,7 +106,7 @@ static void sock_process_send(struct dcerpc_connection *p) talloc_free(blob); } - if (sock->pending_send == NULL) { + if (sock->pending_send == NULL && sock->sock) { EVENT_FD_NOT_WRITEABLE(sock->fde); } } @@ -332,7 +331,7 @@ static NTSTATUS dcerpc_pipe_open_socket(struct dcerpc_connection *c, sock->recv.data = data_blob(NULL, 0); sock->recv.pending_count = 0; - sock->fde = event_add_fd(c->event_ctx, sock, socket_get_fd(sock->sock), + sock->fde = event_add_fd(c->event_ctx, sock->sock, socket_get_fd(sock->sock), 0, sock_io_handler, c); c->transport.private = sock; |