#include "libcli/ldap/ldap.h"
#include "libcli/cldap/cldap.h"
#include "lib/socket/socket.h"
-#include "include/asn_1.h"
/*
destroy a pending request
blob.length = nread;
DEBUG(2,("Received cldap packet of length %d from %s:%d\n",
- blob.length, src_addr, src_port));
+ (int)blob.length, src_addr, src_port));
if (!asn1_load(&asn1, blob)) {
DEBUG(2,("Failed to setup for asn.1 decode\n"));
req->dest_addr, req->dest_port);
if (NT_STATUS_IS_ERR(status)) {
DEBUG(3,("Failed to send cldap request of length %u to %s:%d\n",
- req->encoded.length, req->dest_addr, req->dest_port));
+ (unsigned)req->encoded.length, req->dest_addr, req->dest_port));
DLIST_REMOVE(cldap->send_queue, req);
talloc_free(req);
continue;
goto failed;
}
- if (!ldap_encode(msg, &req->encoded)) {
+ if (!ldap_encode(msg, &req->encoded, req)) {
DEBUG(0,("Failed to encode cldap message to %s:%d\n",
req->dest_addr, req->dest_port));
goto failed;
}
- talloc_steal(req, req->encoded.data);
DLIST_ADD_END(cldap->send_queue, req, struct cldap_request *);
msg->type = LDAP_TAG_SearchResultEntry;
msg->r.SearchResultEntry = *io->response;
- if (!ldap_encode(msg, &blob1)) {
+ if (!ldap_encode(msg, &blob1, req)) {
DEBUG(0,("Failed to encode cldap message to %s:%d\n",
req->dest_addr, req->dest_port));
status = NT_STATUS_INVALID_PARAMETER;
goto failed;
}
- talloc_steal(req, blob1.data);
} else {
blob1 = data_blob(NULL, 0);
}
msg->type = LDAP_TAG_SearchResultDone;
msg->r.SearchResultDone = *io->result;
- if (!ldap_encode(msg, &blob2)) {
+ if (!ldap_encode(msg, &blob2, req)) {
DEBUG(0,("Failed to encode cldap message to %s:%d\n",
req->dest_addr, req->dest_port));
status = NT_STATUS_INVALID_PARAMETER;
goto failed;
}
- talloc_steal(req, blob2.data);
req->encoded = data_blob_talloc(req, NULL, blob1.length + blob2.length);
if (req->encoded.data == NULL) goto failed;