From 4676de010f1b1680ce70e2e4ae1eb4af4de26695 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 29 Oct 2004 03:48:49 +0000 Subject: r3350: fixed a bug with sending multiple replies for the one request, as happens with trans2, trans and echo. Now that smbd is async we queue the multiples replies all at once, and now need a way to ensure each reply gets it own smbsrv_request buffer. I have added req_setup_secondary() to cope with this. (This used to be commit 2dbd2abc5f197ee21d7dceeda2922c7449c46d99) --- source4/smb_server/reply.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/smb_server/reply.c') diff --git a/source4/smb_server/reply.c b/source4/smb_server/reply.c index dd1df29573..818d953abb 100644 --- a/source4/smb_server/reply.c +++ b/source4/smb_server/reply.c @@ -1369,12 +1369,16 @@ void reply_echo(struct smbsrv_request *req) memcpy(req->out.data, req->in.data, req->in.data_size); for (i=1; i <= count;i++) { + struct smbsrv_request *this_req; + if (i != count) { - talloc_increase_ref_count(req); + this_req = req_setup_secondary(req); + } else { + this_req = req; } - SSVAL(req->out.vwv, VWV(0), i); - req_send_reply(req); + SSVAL(this_req->out.vwv, VWV(0), i); + req_send_reply(this_req); } } -- cgit