s3:rpc_transport_tstream: only use tstream_cli_np_use_trans() for sync requests
authorStefan Metzmacher <metze@samba.org>
Thu, 28 Jul 2011 12:15:15 +0000 (14:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 5 Aug 2011 20:31:12 +0000 (22:31 +0200)
Currently the caller doesn't cope with multiple async requests anyway,
so this is just protection for the future.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug  5 22:31:12 CEST 2011 on sn-devel-104

source3/rpc_client/rpc_transport_tstream.c

index 8a860f9400113758edf90313807b2a6f09973e3b..e223614ced58cb34c1a88cd026966f9925c229dd 100644 (file)
@@ -380,6 +380,12 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx,
        if (tstream_is_cli_np(transp->stream)) {
                use_trans = true;
        }
+       if (tevent_queue_length(transp->write_queue) > 0) {
+               use_trans = false;
+       }
+       if (tevent_queue_length(transp->read_queue) > 0) {
+               use_trans = false;
+       }
 
        if (use_trans) {
                tstream_cli_np_use_trans(transp->stream);