From baa6ebddcb45fd817a7ff9b7986afbe3fc4c4b6c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 12 Jun 2009 14:52:35 +0200 Subject: [PATCH] Add basic tracing of tldap messages --- source3/lib/tldap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index c823f88d044..c70b8ca95d1 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