s4:librpc/dcerpc_smb2: fix smb2_write_callback()
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Oct 2011 20:55:17 +0000 (22:55 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 28 Oct 2011 07:55:48 +0000 (09:55 +0200)
The should use smb2_write_recv() to get the result.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Oct 28 09:55:48 CEST 2011 on sn-devel-104

source4/librpc/rpc/dcerpc_smb2.c

index 75fb423df4e6a0c96683e5755abd90c891285c9a..0de89357978cd2e6ee5eb75b6a996a7f6edddeb4 100644 (file)
@@ -284,13 +284,17 @@ static NTSTATUS smb2_send_trans_request(struct dcecli_connection *c, DATA_BLOB *
 static void smb2_write_callback(struct smb2_request *req)
 {
        struct dcecli_connection *c = (struct dcecli_connection *)req->async.private_data;
+       struct smb2_write io;
+       NTSTATUS status;
 
-       if (!NT_STATUS_IS_OK(req->status)) {
-               DEBUG(0,("dcerpc_smb2: write callback error\n"));
-               pipe_dead(c, req->status);
-       }
+       ZERO_STRUCT(io);
 
-       smb2_request_destroy(req);
+       status = smb2_write_recv(req, &io);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(0,("dcerpc_smb2: write callback error: %s\n",
+                        nt_errstr(status)));
+               pipe_dead(c, status);
+       }
 }
 
 /*