From 72d54e049010f0f07272be131d724ebc6134fbc8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 9 Aug 2017 18:12:54 +0200 Subject: Debug output --- Makefile | 8 ++++---- server.c | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2f005ee..4af6135 100644 --- a/Makefile +++ b/Makefile @@ -41,13 +41,13 @@ LIBS+=-g -lowfat -lssl -lcrypto %: %.c $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) ${LIBS} -ldadp: tmpbuffer.o ini.o client.o server.o helper.o proxy.o epoll.o openssl.o \ -ldap.a asn1.a \ -types.h epoll.h client.h server.h helper.h +ldadp: tmpbuffer.o ini.o client.o server.o helper.o proxy.o epoll.o openssl.o ldap.a asn1.a + +qndtest: ldap.a asn1.a .PHONY: clean tar clean: - rm -f *.[ao] ldadp + rm -f *.[ao] ldadp qndtest tar: clean cd ..; tar cvvf ldadp.tar.bz2 ldadp --use=bzip2 --exclude capture --exclude .git diff --git a/server.c b/server.c index d5fba2a..1f5fba3 100644 --- a/server.c +++ b/server.c @@ -287,6 +287,14 @@ uint32_t server_searchRequestOnConnection(epoll_server_t *server, struct SearchR char buffer[bodyLen + 50]; char *bufoff = buffer + 50; fmt_ldapsearchrequest(bufoff, req); + if (_debugLevel >= DEBUG_TRACE) { + struct SearchRequest tmp; + if (0 != scan_ldapsearchrequest(bufoff, bufoff + bodyLen, &tmp)) { + printf("[Client] Search request: (deserialized): "); + helper_printfilter(tmp.filter); + free_ldapsearchrequest(&tmp); + } + } fmt_ldapmessage(bufoff - headerLen, msgid, SearchRequest, bodyLen); if (!server_send(server, bufoff - headerLen, headerLen + bodyLen, FALSE)) return 0; return msgid; -- cgit v1.2.3-55-g7522