diff options
-rw-r--r-- | source4/librpc/rpc/dcerpc_sock.c | 6 | ||||
-rw-r--r-- | source4/torture/rpc/countcalls.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c index 361d0d4a5f..8de43d8454 100644 --- a/source4/librpc/rpc/dcerpc_sock.c +++ b/source4/librpc/rpc/dcerpc_sock.c @@ -73,6 +73,8 @@ static void sock_dead(struct dcerpc_pipe *p, NTSTATUS status) if (!NT_STATUS_IS_OK(status)) { p->transport.recv_data(p, NULL, status); } + + sock->fde->flags &= ~(EVENT_FD_WRITE | EVENT_FD_READ); } /* @@ -230,6 +232,10 @@ static NTSTATUS sock_send_request(struct dcerpc_pipe *p, DATA_BLOB *data, BOOL t struct sock_private *sock = p->transport.private; struct sock_blob *blob; + if (sock->sock == NULL) { + return NT_STATUS_CONNECTION_DISCONNECTED; + } + blob = talloc_p(sock, struct sock_blob); if (blob == NULL) { return NT_STATUS_NO_MEMORY; diff --git a/source4/torture/rpc/countcalls.c b/source4/torture/rpc/countcalls.c index 4d3e729980..d42729769a 100644 --- a/source4/torture/rpc/countcalls.c +++ b/source4/torture/rpc/countcalls.c @@ -59,6 +59,9 @@ BOOL torture_rpc_countcalls(void) status = dcerpc_request(p, NULL, i, p, &stub_in, &stub_out); if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT) && p->last_fault_code == DCERPC_FAULT_OP_RNG_ERROR) break; + if (NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_DISCONNECTED)) { + break; + } } if (i==5000) { |