svn commit: samba r11671 - in branches/SAMBA_4_0/source/libcli/smb2: .

metze at samba.org metze at samba.org
Fri Nov 11 08:00:51 GMT 2005


Author: metze
Date: 2005-11-11 08:00:51 +0000 (Fri, 11 Nov 2005)
New Revision: 11671

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11671

Log:
- make sure req is initialized
- only free the buffer when there's no request
- call async callback on error

metze
Modified:
   branches/SAMBA_4_0/source/libcli/smb2/transport.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/smb2/transport.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/smb2/transport.c	2005-11-11 08:00:05 UTC (rev 11670)
+++ branches/SAMBA_4_0/source/libcli/smb2/transport.c	2005-11-11 08:00:51 UTC (rev 11671)
@@ -145,7 +145,7 @@
 							     struct smb2_transport);
 	uint8_t *buffer, *hdr;
 	int len;
-	struct smb2_request *req;
+	struct smb2_request *req = NULL;
 	uint64_t seqnum;
 
 	buffer = blob.data;
@@ -197,12 +197,16 @@
 	return NT_STATUS_OK;
 
 error:
+	dump_data(2, buffer, len);
 	if (req) {
 		DLIST_REMOVE(transport->pending_recv, req);
 		req->state = SMB2_REQUEST_ERROR;
+		if (req->async.fn) {
+			req->async.fn(req);
+		}
+	} else {
+		talloc_free(buffer);
 	}
-	dump_data(2, blob.data, blob.length);
-	data_blob_free(&blob);
 	return NT_STATUS_UNSUCCESSFUL;
 }
 
@@ -210,7 +214,7 @@
   handle timeouts of individual smb requests
 */
 static void smb2_timeout_handler(struct event_context *ev, struct timed_event *te, 
-				   struct timeval t, void *private)
+				 struct timeval t, void *private)
 {
 	struct smb2_request *req = talloc_get_type(private, struct smb2_request);
 



More information about the samba-cvs mailing list