diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-08-03 06:52:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:57:45 -0500 |
commit | 53781e9d37b9adb1cf2d5be2a6ae6c1f5ace26c9 (patch) | |
tree | 5e5f8946adf47c56ad3bddf74a118926f78765b7 /source4/libcli/raw/clitransport.c | |
parent | 44194cc66378682a39f3694977101bf8f2a7a6f6 (diff) | |
download | samba-53781e9d37b9adb1cf2d5be2a6ae6c1f5ace26c9.tar.gz samba-53781e9d37b9adb1cf2d5be2a6ae6c1f5ace26c9.tar.bz2 samba-53781e9d37b9adb1cf2d5be2a6ae6c1f5ace26c9.zip |
r1633: fixed a couple of async oplock handling errors
(This used to be commit d7e2f39b90122088e94d4a8e8c7ffa7c91d7d664)
Diffstat (limited to 'source4/libcli/raw/clitransport.c')
-rw-r--r-- | source4/libcli/raw/clitransport.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index abdcc0d392..d2d78d0789 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -250,9 +250,14 @@ static void cli_transport_process_send(struct cli_transport *transport) req->out.buffer += ret; req->out.size -= ret; if (req->out.size == 0) { - req->state = CLI_REQUEST_RECV; DLIST_REMOVE(transport->pending_send, req); - DLIST_ADD(transport->pending_recv, req); + if (req->one_way_request) { + req->state = CLI_REQUEST_DONE; + cli_request_destroy(req); + } else { + req->state = CLI_REQUEST_RECV; + DLIST_ADD(transport->pending_recv, req); + } } } @@ -275,13 +280,14 @@ static void cli_transport_finish_recv(struct cli_transport *transport) buffer = transport->recv_buffer.buffer; len = transport->recv_buffer.req_size; + ZERO_STRUCT(transport->recv_buffer); + hdr = buffer+NBT_HDR_SIZE; vwv = hdr + HDR_VWV; /* see if it could be an oplock break request */ if (handle_oplock_break(transport, len, hdr, vwv)) { talloc_free(transport->mem_ctx, buffer); - ZERO_STRUCT(transport->recv_buffer); return; } @@ -377,7 +383,6 @@ async: /* if this request has an async handler then call that to notify that the reply has been received. This might destroy the request so it must happen last */ - ZERO_STRUCT(transport->recv_buffer); DLIST_REMOVE(transport->pending_recv, req); req->state = CLI_REQUEST_DONE; if (req->async.fn) { @@ -390,7 +395,6 @@ error: DLIST_REMOVE(transport->pending_recv, req); req->state = CLI_REQUEST_ERROR; } - ZERO_STRUCT(transport->recv_buffer); } /* |