summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-12 14:52:35 +0200
committerVolker Lendecke <vl@samba.org>2009-06-12 15:04:21 +0200
commitbaa6ebddcb45fd817a7ff9b7986afbe3fc4c4b6c (patch)
treef8f847b65e05cb92af7a37e63159edc42224b18a /source3/lib
parenta36a3e4c838275d33b2ed087b037ed3708b04749 (diff)
downloadsamba-baa6ebddcb45fd817a7ff9b7986afbe3fc4c4b6c.tar.gz
samba-baa6ebddcb45fd817a7ff9b7986afbe3fc4c4b6c.tar.bz2
samba-baa6ebddcb45fd817a7ff9b7986afbe3fc4c4b6c.zip
Add basic tracing of tldap messages
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/tldap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index c823f88d04..c70b8ca95d 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -281,6 +281,9 @@ static struct tevent_req *tldap_msg_send(TALLOC_CTX *mem_ctx,
struct tldap_msg_state *state;
DATA_BLOB blob;
+ tldap_debug(ld, TLDAP_DEBUG_TRACE, "tldap_msg_send: sending msg %d\n",
+ id);
+
req = tevent_req_create(mem_ctx, &state, struct tldap_msg_state);
if (req == NULL) {
return NULL;
@@ -436,6 +439,7 @@ static void tldap_msg_received(struct tevent_req *subreq)
size_t num_pending;
int i, err, status;
int id;
+ uint8_t type;
bool ok;
received = read_ldap_recv(subreq, talloc_tos(), &inbuf, &err);
@@ -455,12 +459,16 @@ static void tldap_msg_received(struct tevent_req *subreq)
ok = true;
ok &= asn1_start_tag(data, ASN1_SEQUENCE(0));
ok &= asn1_read_Integer(data, &id);
+ ok &= asn1_peek_uint8(data, &type);
if (!ok) {
status = TLDAP_PROTOCOL_ERROR;
goto fail;
}
+ tldap_debug(ld, TLDAP_DEBUG_TRACE, "tldap_msg_received: got msg %d "
+ "type %d\n", id, (int)type);
+
num_pending = talloc_array_length(ld->pending);
for (i=0; i<num_pending; i++) {
@@ -470,6 +478,8 @@ static void tldap_msg_received(struct tevent_req *subreq)
}
if (i == num_pending) {
/* Dump unexpected reply */
+ tldap_debug(ld, TLDAP_DEBUG_WARNING, "tldap_msg_received: "
+ "No request pending for msg %d\n", id);
TALLOC_FREE(inbuf);
goto done;
}