svn commit: samba r7230 - in branches/SAMBA_4_0/source/libcli/cldap: .

tridge at samba.org tridge at samba.org
Fri Jun 3 13:37:24 GMT 2005


Author: tridge
Date: 2005-06-03 13:37:23 +0000 (Fri, 03 Jun 2005)
New Revision: 7230

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

Log:
use socket_pending() to get rid of the max packet size limits in the
cldap code

Modified:
   branches/SAMBA_4_0/source/libcli/cldap/cldap.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/cldap/cldap.c	2005-06-03 13:31:27 UTC (rev 7229)
+++ branches/SAMBA_4_0/source/libcli/cldap/cldap.c	2005-06-03 13:37:23 UTC (rev 7230)
@@ -40,8 +40,6 @@
 #include "lib/socket/socket.h"
 #include "include/asn_1.h"
 
-#define CLDAP_MAX_PACKET_SIZE 2048
-
 /*
   destroy a pending request
 */
@@ -68,12 +66,18 @@
 	const char *src_addr;
 	int src_port;
 	DATA_BLOB blob;
-	size_t nread;
+	size_t nread, dsize;
 	struct asn1_data asn1;
 	struct ldap_message ldap_msg;
 	struct cldap_request *req;
 
-	blob = data_blob_talloc(tmp_ctx, NULL, CLDAP_MAX_PACKET_SIZE);
+	status = socket_pending(cldap->sock, &dsize);
+	if (!NT_STATUS_IS_OK(status)) {
+		talloc_free(tmp_ctx);
+		return;
+	}
+
+	blob = data_blob_talloc(tmp_ctx, NULL, dsize);
 	if (blob.data == NULL) {
 		talloc_free(tmp_ctx);
 		return;



More information about the samba-cvs mailing list