summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-03 13:37:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:29 -0500
commit4be9b65d770c891e821ba35fa6a2d146a4d50e5a (patch)
treeed9c57d23682c43b6e981949cbe86f2fa0abec6b
parent665480ffed385abb74bc44b6f376547a6d465db9 (diff)
downloadsamba-4be9b65d770c891e821ba35fa6a2d146a4d50e5a.tar.gz
samba-4be9b65d770c891e821ba35fa6a2d146a4d50e5a.tar.bz2
samba-4be9b65d770c891e821ba35fa6a2d146a4d50e5a.zip
r7230: use socket_pending() to get rid of the max packet size limits in the
cldap code (This used to be commit 9da5379048784524eee213d8609f1d96f0058e39)
-rw-r--r--source4/libcli/cldap/cldap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index b52b2f53f0..a96906cf4c 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -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 @@ static void cldap_socket_recv(struct cldap_socket *cldap)
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;