mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
r2443: check return code of event_loop_once() to catch thet cases where the server
closes the connetion and we got EBADF from select() and event_loop_once() fails metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
3cd63030b1
commit
9c0e50a6f3
@ -285,7 +285,9 @@ BOOL smbcli_request_receive(struct smbcli_request *req)
|
|||||||
|
|
||||||
/* keep receiving packets until this one is replied to */
|
/* keep receiving packets until this one is replied to */
|
||||||
while (req->state <= SMBCLI_REQUEST_RECV) {
|
while (req->state <= SMBCLI_REQUEST_RECV) {
|
||||||
event_loop_once(req->transport->event.ctx);
|
if (event_loop_once(req->transport->event.ctx) != 0) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return req->state == SMBCLI_REQUEST_DONE;
|
return req->state == SMBCLI_REQUEST_DONE;
|
||||||
|
@ -436,7 +436,9 @@ static NTSTATUS full_request(struct dcerpc_pipe *p,
|
|||||||
|
|
||||||
while (NT_STATUS_IS_OK(state->status) && state->reply_blob) {
|
while (NT_STATUS_IS_OK(state->status) && state->reply_blob) {
|
||||||
struct event_context *ctx = p->transport.event_context(p);
|
struct event_context *ctx = p->transport.event_context(p);
|
||||||
event_loop_once(ctx);
|
if (event_loop_once(ctx) != 0) {
|
||||||
|
return NT_STATUS_CONNECTION_DISCONNECTED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return state->status;
|
return state->status;
|
||||||
@ -882,7 +884,9 @@ NTSTATUS dcerpc_request_recv(struct rpc_request *req,
|
|||||||
|
|
||||||
while (req->state == RPC_REQUEST_PENDING) {
|
while (req->state == RPC_REQUEST_PENDING) {
|
||||||
struct event_context *ctx = dcerpc_event_context(req->p);
|
struct event_context *ctx = dcerpc_event_context(req->p);
|
||||||
event_loop_once(ctx);
|
if (event_loop_once(ctx) != 0) {
|
||||||
|
return NT_STATUS_CONNECTION_DISCONNECTED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*stub_data = req->payload;
|
*stub_data = req->payload;
|
||||||
status = req->status;
|
status = req->status;
|
||||||
|
@ -237,7 +237,9 @@ static BOOL test_sleep(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
|
|||||||
|
|
||||||
ctx = dcerpc_event_context(p);
|
ctx = dcerpc_event_context(p);
|
||||||
while (total_done < ASYNC_COUNT) {
|
while (total_done < ASYNC_COUNT) {
|
||||||
event_loop_once(ctx);
|
if (event_loop_once(ctx) != 0) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
for (i=0;i<ASYNC_COUNT;i++) {
|
for (i=0;i<ASYNC_COUNT;i++) {
|
||||||
if (done[i] == 0 && req[i]->state == RPC_REQUEST_DONE) {
|
if (done[i] == 0 && req[i]->state == RPC_REQUEST_DONE) {
|
||||||
total_done++;
|
total_done++;
|
||||||
|
@ -1706,7 +1706,9 @@ static BOOL test_GetDomainInfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
|
|||||||
|
|
||||||
/* even with this flush per request a w2k3 server seems to
|
/* even with this flush per request a w2k3 server seems to
|
||||||
clag with multiple outstanding requests. bleergh. */
|
clag with multiple outstanding requests. bleergh. */
|
||||||
event_loop_once(dcerpc_event_context(p));
|
if (event_loop_once(dcerpc_event_context(p)) != 0) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0;i<ASYNC_COUNT;i++) {
|
for (i=0;i<ASYNC_COUNT;i++) {
|
||||||
|
Reference in New Issue
Block a user