summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-04-17 11:40:40 +0200
committerStefan Metzmacher <metze@samba.org>2009-04-20 18:14:59 +0200
commitf3c9d124bb302ded239a835a6173fbfe262a0bab (patch)
tree95a85779225063ab1aa51487343eadfe58a59c33 /source4/librpc
parente6b796b936993e485356eaabd4370858c4f802fd (diff)
downloadsamba-f3c9d124bb302ded239a835a6173fbfe262a0bab.tar.gz
samba-f3c9d124bb302ded239a835a6173fbfe262a0bab.tar.bz2
samba-f3c9d124bb302ded239a835a6173fbfe262a0bab.zip
s4:librpc/rpc: only use smb_trans for sync rpc calls
Over named pipes we can only do one smb_trans at a time, otherwise we're getting NT_STATUS_PIPE_BUSY. Async rpc calls need to use smb_read/write only. metze
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 7a568d3c9e..15c34f5dca 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -1058,6 +1058,7 @@ static void dcerpc_ship_next_request(struct dcerpc_connection *c)
while (remaining > 0 || first_packet) {
uint32_t chunk = MIN(chunk_size, remaining);
bool last_frag = false;
+ bool do_trans = false;
first_packet = false;
pkt.pfc_flags &= ~(DCERPC_PFC_FLAG_FIRST |DCERPC_PFC_FLAG_LAST);
@@ -1080,14 +1081,27 @@ static void dcerpc_ship_next_request(struct dcerpc_connection *c)
DLIST_REMOVE(p->conn->pending, req);
return;
}
-
- req->status = p->conn->transport.send_request(p->conn, &blob, last_frag);
+
+ if (last_frag && !req->async_call) {
+ do_trans = true;
+ }
+
+ req->status = p->conn->transport.send_request(p->conn, &blob, do_trans);
if (!NT_STATUS_IS_OK(req->status)) {
req->state = RPC_REQUEST_DONE;
DLIST_REMOVE(p->conn->pending, req);
return;
}
+ if (last_frag && !do_trans) {
+ req->status = p->conn->transport.send_read(p->conn);
+ if (!NT_STATUS_IS_OK(req->status)) {
+ req->state = RPC_REQUEST_DONE;
+ DLIST_REMOVE(p->conn->pending, req);
+ return;
+ }
+ }
+
remaining -= chunk;
}
}