summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-28 12:54:31 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-01 14:55:00 +0200
commita833aaf52c4c846f623441a2a0cff054e2de11af (patch)
treeb59f3fdbdc5a44cad447b2a3995aed6f5fd7d9cd
parent98cc4c8419121246b46f5a5492dd9e4e45cf5aad (diff)
downloadsamba-a833aaf52c4c846f623441a2a0cff054e2de11af.tar.gz
samba-a833aaf52c4c846f623441a2a0cff054e2de11af.tar.bz2
samba-a833aaf52c4c846f623441a2a0cff054e2de11af.zip
s3:rpc_transport_tstream: call tstream_cli_np_use_trans() before tstream_writev_queue_send()
This will be needed when tstream_writev_queue_send() changes it's behavior and avoids using an immediate event when the queue is empty. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon Aug 1 14:55:00 CEST 2011 on sn-devel-104
-rw-r--r--source3/rpc_client/rpc_transport_tstream.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c
index 488c093d3b..8a860f9400 100644
--- a/source3/rpc_client/rpc_transport_tstream.c
+++ b/source3/rpc_client/rpc_transport_tstream.c
@@ -357,6 +357,7 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req, *subreq;
struct rpc_tstream_trans_state *state;
struct timeval endtime;
+ bool use_trans = false;
req = tevent_req_create(mem_ctx, &state,
struct rpc_tstream_trans_state);
@@ -376,6 +377,14 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx,
endtime = timeval_current_ofs_msec(transp->timeout);
+ if (tstream_is_cli_np(transp->stream)) {
+ use_trans = true;
+ }
+
+ if (use_trans) {
+ tstream_cli_np_use_trans(transp->stream);
+ }
+
subreq = tstream_writev_queue_send(state, ev,
transp->stream,
transp->write_queue,
@@ -388,10 +397,6 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx,
}
tevent_req_set_callback(subreq, rpc_tstream_trans_writev, req);
- if (tstream_is_cli_np(transp->stream)) {
- tstream_cli_np_use_trans(transp->stream);
- }
-
subreq = tstream_readv_pdu_queue_send(state, ev,
transp->stream,
transp->read_queue,