[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 35/125: openldap: add commented out debug possibili
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 35/125: openldap: add commented out debug possibilities |
Date: |
Sun, 21 Jan 2018 23:41:30 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit ff07f07cc8668b6922e0e90606cc63fbd1abb684
Author: Stepan Broz <address@hidden>
AuthorDate: Wed Dec 6 08:54:35 2017 +0100
openldap: add commented out debug possibilities
... to aid debugging openldap library using its built-in debug messages.
Closes #2159
---
lib/openldap.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/lib/openldap.c b/lib/openldap.c
index ac356d098..5e9cdb3ea 100644
--- a/lib/openldap.c
+++ b/lib/openldap.c
@@ -51,6 +51,25 @@
#include "curl_memory.h"
#include "memdebug.h"
+/*
+ * Uncommenting this will enable the built-in debug logging of the openldap
+ * library. The debug log level can be set using the CURL_OPENLDAP_TRACE
+ * environment variable. The debug output is written to stderr.
+ *
+ * The library supports the following debug flags:
+ * LDAP_DEBUG_NONE 0x0000
+ * LDAP_DEBUG_TRACE 0x0001
+ * LDAP_DEBUG_CONSTRUCT 0x0002
+ * LDAP_DEBUG_DESTROY 0x0004
+ * LDAP_DEBUG_PARAMETER 0x0008
+ * LDAP_DEBUG_ANY 0xffff
+ *
+ * For example, use CURL_OPENLDAP_TRACE=0 for no debug,
+ * CURL_OPENLDAP_TRACE=2 for LDAP_DEBUG_CONSTRUCT messages only,
+ * CURL_OPENLDAP_TRACE=65535 for all debug message levels.
+ */
+/* #define CURL_OPENLDAP_DEBUG */
+
#ifndef _LDAP_PVT_H
extern int ldap_pvt_url_scheme2proto(const char *);
extern int ldap_init_fd(ber_socket_t fd, int proto, const char *url,
@@ -204,6 +223,15 @@ static CURLcode ldap_connect(struct connectdata *conn,
bool *done)
snprintf(ptr, sizeof(hosturl)-(ptr-hosturl), "://%s:%d",
conn->host.name, conn->remote_port);
+#ifdef CURL_OPENLDAP_DEBUG
+ static int do_trace = 0;
+ const char *env = getenv("CURL_OPENLDAP_TRACE");
+ do_trace = (env && strtol(env, NULL, 10) > 0);
+ if (do_trace) {
+ ldap_set_option(li->ld, LDAP_OPT_DEBUG_LEVEL, &do_trace);
+ }
+#endif
+
rc = ldap_init_fd(conn->sock[FIRSTSOCKET], li->proto, hosturl, &li->ld);
if(rc) {
failf(data, "LDAP local: Cannot connect to %s, %s",
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 23/125: sasl_getmesssage: make sure we have a long enough string to pass, (continued)
- [GNUnet-SVN] [gnurl] 23/125: sasl_getmesssage: make sure we have a long enough string to pass, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 24/125: libssh: remove dead code in sftp_qoute, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 34/125: examples: move threaded-shared-conn.c to the "complicated" ones, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 33/125: RELEASE-NOTES: synced with b261c44e8, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 20/125: libssh: fixed dereference in statvfs access, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 27/125: threaded-shared-conn.c: fixed typo in commenta, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 26/125: threaded-shared-conn.c: new example, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 54/125: tests: mark data files as non-executable in git, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 50/125: openssl: Disable file buffering for Win32 SSLKEYLOGFILE, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 51/125: mailmap: fixup two old git Author "aliases", gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 35/125: openldap: add commented out debug possibilities,
gnunet <=
- [GNUnet-SVN] [gnurl] 53/125: tests: update .gitignore for libtests, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 69/125: krb5: fix a potential access of uninitialized memory, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 61/125: vtls: replaced getenv() with curl_getenv(), gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 58/125: curl.1: mention http:// and https:// as valid proxy prefixes, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 56/125: CURLOPT_DNS_LOCAL_IP4.3: fixed the seel also to not self-reference, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 30/125: configure: check for netinet/in6.h, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 37/125: include: get netinet/in.h before linux/tcp.h, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 45/125: curl: remove __EMX__ #ifdefs, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 57/125: curl.1: documented two missing valid exit codes, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 60/125: RELEASE-NOTES: synced with 3b9ea70ee, gnunet, 2018/01/21