diff options
author | Yang Tse <yangsita@gmail.com> | 2009-06-10 02:49:42 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-06-10 02:49:42 +0000 |
commit | 2c166812253c28cdfbffdd4de069f5c11db3c7a8 (patch) | |
tree | c798b653673cea7174a904af6760a4e9ae86a9b9 /lib | |
parent | 065047dc62cba3efde597fa5420d112fc2f4c500 (diff) |
Adjusted to take in account that...
With the curl memory tracking feature decoupled from the debug build feature,
CURLDEBUG and DEBUGBUILD preprocessor symbol definitions are used as follows:
CURLDEBUG used for curl debug memory tracking specific code (--enable-curldebug)
DEBUGBUILD used for debug enabled specific code (--enable-debug)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 4 | ||||
-rw-r--r-- | lib/hash.c | 2 | ||||
-rw-r--r-- | lib/multi.c | 12 | ||||
-rw-r--r-- | lib/multiif.h | 6 | ||||
-rw-r--r-- | lib/netrc.c | 4 | ||||
-rw-r--r-- | lib/setup_once.h | 4 | ||||
-rw-r--r-- | lib/splay.c | 4 | ||||
-rw-r--r-- | lib/splay.h | 4 | ||||
-rw-r--r-- | lib/ssh.c | 4 | ||||
-rw-r--r-- | lib/transfer.c | 2 | ||||
-rw-r--r-- | lib/url.c | 12 | ||||
-rw-r--r-- | lib/version.c | 5 |
12 files changed, 33 insertions, 30 deletions
@@ -727,7 +727,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */ static void state(struct connectdata *conn, ftpstate newstate) { -#if defined(CURLDEBUG) && !defined(CURL_DISABLE_VERBOSE_STRINGS) +#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[]={ "STOP", @@ -765,7 +765,7 @@ static void state(struct connectdata *conn, }; #endif struct ftp_conn *ftpc = &conn->proto.ftpc; -#if defined(CURLDEBUG) && !defined(CURL_DISABLE_VERBOSE_STRINGS) +#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) if(ftpc->state != newstate) infof(conn->data, "FTP %p state change from %s to %s\n", ftpc, names[ftpc->state], names[newstate]); diff --git a/lib/hash.c b/lib/hash.c index fed7b9841..6ca7431ce 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -210,7 +210,7 @@ Curl_hash_pick(struct curl_hash *h, void *key, size_t key_len) return NULL; } -#if defined(CURLDEBUG) && defined(AGGRESIVE_TEST) +#if defined(DEBUGBUILD) && defined(AGGRESIVE_TEST) void Curl_hash_apply(curl_hash *h, void *user, void (*cb)(void *user, void *ptr)) diff --git a/lib/multi.c b/lib/multi.c index 75dd0277d..25c8b9a9c 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -197,7 +197,7 @@ static void moveHandleFromSendToRecvPipeline(struct SessionHandle *habdle, static bool isHandleAtHead(struct SessionHandle *handle, struct curl_llist *pipeline); -#ifdef CURLDEBUG +#ifdef DEBUGBUILD static const char * const statename[]={ "INIT", "CONNECT", @@ -221,7 +221,7 @@ static const char * const statename[]={ /* always use this function to change state, to make debugging easier */ static void multistate(struct Curl_one_easy *easy, CURLMstate state) { -#ifdef CURLDEBUG +#ifdef DEBUGBUILD long connectindex = -5000; #endif CURLMstate oldstate = easy->state; @@ -232,7 +232,7 @@ static void multistate(struct Curl_one_easy *easy, CURLMstate state) easy->state = state; -#ifdef CURLDEBUG +#ifdef DEBUGBUILD if(easy->state > CURLM_STATE_CONNECT && easy->state < CURLM_STATE_COMPLETED) connectindex = easy->easy_conn->connectindex; @@ -1117,7 +1117,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, case CURLM_STATE_WAITDO: /* Wait for our turn to DO when we're pipelining requests */ -#ifdef CURLDEBUG +#ifdef DEBUGBUILD infof(easy->easy_handle, "Conn %d send pipe %d inuse %d athead %d\n", easy->easy_conn->connectindex, easy->easy_conn->send_pipe->size, @@ -1253,7 +1253,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, multistate(easy, CURLM_STATE_PERFORM); result = CURLM_CALL_MULTI_PERFORM; } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD else { infof(easy->easy_handle, "Conn %d recv pipe %d inuse %d athead %d\n", easy->easy_conn->connectindex, @@ -2353,7 +2353,7 @@ static void add_closure(struct Curl_multi *multi, } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD void Curl_multi_dump(const struct Curl_multi *multi_handle) { struct Curl_multi *multi=(struct Curl_multi *)multi_handle; diff --git a/lib/multiif.h b/lib/multiif.h index b467d2954..1f7ee662f 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -44,11 +44,11 @@ void Curl_multi_handlePipeBreak(struct SessionHandle *data); /* set the bit for the given sock number to make the bitmap for readable */ #define GETSOCK_READSOCK(x) (1 << (x)) -#ifdef CURLDEBUG +#ifdef DEBUGBUILD /* * Curl_multi_dump is not a stable public function, this is only meant to * allow easier tracking of the internal handle's state and what sockets - * they use. Only for research and development CURLDEBUG enabled builds. + * they use. Only for research and development DEBUGBUILD enabled builds. */ void Curl_multi_dump(const struct Curl_multi *multi_handle); #endif diff --git a/lib/netrc.c b/lib/netrc.c index c82b639c9..a543c34e2 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -92,7 +92,7 @@ int Curl_parsenetrc(const char *host, #define NETRC DOT_CHAR "netrc" -#ifdef CURLDEBUG +#ifdef DEBUGBUILD { /* This is a hack to allow testing. * If compiled with --enable-debug and CURL_DEBUG_NETRC is defined, @@ -106,7 +106,7 @@ int Curl_parsenetrc(const char *host, netrc_alloc = TRUE; } } -#endif /* CURLDEBUG */ +#endif /* DEBUGBUILD */ if(!netrcfile) { home = curl_getenv("HOME"); /* portable environment reader */ if(home) { diff --git a/lib/setup_once.h b/lib/setup_once.h index 933d95abb..4c4d3f599 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -304,7 +304,7 @@ typedef int sig_atomic_t; * Macro used to include code only in debug builds. */ -#ifdef CURLDEBUG +#ifdef DEBUGBUILD #define DEBUGF(x) x #else #define DEBUGF(x) do { } while (0) @@ -315,7 +315,7 @@ typedef int sig_atomic_t; * Macro used to include assertion code only in debug builds. */ -#if defined(CURLDEBUG) && defined(HAVE_ASSERT_H) +#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H) #define DEBUGASSERT(x) assert(x) #else #define DEBUGASSERT(x) do { } while (0) diff --git a/lib/splay.c b/lib/splay.c index c855c4c05..8c6d5ad49 100644 --- a/lib/splay.c +++ b/lib/splay.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1997 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1997 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -332,7 +332,7 @@ int Curl_splayremovebyaddr(struct Curl_tree *t, return 0; } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD void Curl_splayprint(struct Curl_tree * t, int d, char output) { diff --git a/lib/splay.h b/lib/splay.h index 4e6a8c16d..442661d76 100644 --- a/lib/splay.h +++ b/lib/splay.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1997 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1997 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -57,7 +57,7 @@ int Curl_splayremovebyaddr(struct Curl_tree *t, ( ((i.tv_usec) < (j.tv_usec)) ? -1 : \ ( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0 )))) -#ifdef CURLDEBUG +#ifdef DEBUGBUILD void Curl_splayprint(struct Curl_tree * t, int d, char output); #else #define Curl_splayprint(x,y,z) @@ -301,7 +301,7 @@ static LIBSSH2_FREE_FUNC(libssh2_free) /* This is the ONLY way to change SSH state! */ static void state(struct connectdata *conn, sshstate nowstate) { -#if defined(CURLDEBUG) && !defined(CURL_DISABLE_VERBOSE_STRINGS) +#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* for debug purposes */ static const char * const names[] = { "SSH_STOP", @@ -358,7 +358,7 @@ static void state(struct connectdata *conn, sshstate nowstate) #endif struct ssh_conn *sshc = &conn->proto.sshc; -#if defined(CURLDEBUG) && !defined(CURL_DISABLE_VERBOSE_STRINGS) +#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) if(sshc->state != nowstate) { infof(conn->data, "SFTP %p state change from %s to %s\n", sshc, names[sshc->state], names[nowstate]); diff --git a/lib/transfer.c b/lib/transfer.c index fd5b3889f..1905c69b9 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -386,7 +386,7 @@ static void read_rewind(struct connectdata *conn, conn->read_pos -= thismuch; conn->bits.stream_was_rewound = TRUE; -#ifdef CURLDEBUG +#ifdef DEBUGBUILD { char buf[512 + 1]; size_t show; @@ -380,7 +380,7 @@ CURLcode Curl_close(struct SessionHandle *data) { struct Curl_multi *m = data->multi; -#ifdef CURLDEBUG +#ifdef DEBUGBUILD /* only for debugging, scan through all connections and see if there's a pipe reference still identifying this handle */ @@ -2310,7 +2310,7 @@ CURLcode Curl_disconnect(struct connectdata *conn) return CURLE_OK; } -#if defined(CURLDEBUG) && defined(AGGRESIVE_TEST) +#if defined(DEBUGBUILD) && defined(AGGRESIVE_TEST) /* scan for DNS cache entries still marked as in use */ Curl_hash_apply(data->hostcache, NULL, Curl_scan_cache_used); @@ -2431,7 +2431,7 @@ bool Curl_isPipeliningEnabled(const struct SessionHandle *handle) CURLcode Curl_addHandleToPipeline(struct SessionHandle *data, struct curl_llist *pipeline) { -#ifdef CURLDEBUG +#ifdef DEBUGBUILD if(!IsPipeliningPossible(data)) { /* when not pipelined, there MUST be no handle in the list already */ if(pipeline->head) @@ -2514,7 +2514,7 @@ static void signalPipeClose(struct curl_llist *pipeline) struct curl_llist_element *next = curr->next; struct SessionHandle *data = (struct SessionHandle *) curr->ptr; -#ifdef CURLDEBUG /* debug-only code */ +#ifdef DEBUGBUILD /* debug-only code */ if(data->magic != CURLEASY_MAGIC_NUMBER) { /* MAJOR BADNESS */ infof(data, "signalPipeClose() found BAAD easy handle\n"); @@ -2596,7 +2596,7 @@ ConnectionExists(struct SessionHandle *data, continue; } -#ifdef CURLDEBUG +#ifdef DEBUGBUILD if(pipeLen > MAX_PIPELINE_LENGTH) { infof(data, "BAD! Connection #%ld has too big pipeline!\n", check->connectindex); @@ -2626,7 +2626,7 @@ ConnectionExists(struct SessionHandle *data, get closed. */ infof(data, "Connection #%ld isn't open enough, can't reuse\n", check->connectindex); -#ifdef CURLDEBUG +#ifdef DEBUGBUILD if(check->recv_pipe->size > 0) { infof(data, "BAD! Unconnected #%ld has a non-empty recv pipeline!\n", check->connectindex); diff --git a/lib/version.c b/lib/version.c index 61a3b3287..2bcec0092 100644 --- a/lib/version.c +++ b/lib/version.c @@ -188,9 +188,12 @@ static curl_version_info_data version_info = { #ifdef HAVE_GSSAPI | CURL_VERSION_GSSNEGOTIATE #endif -#ifdef CURLDEBUG +#ifdef DEBUGBUILD | CURL_VERSION_DEBUG #endif +#ifdef CURLDEBUG + | CURL_VERSION_CURLDEBUG +#endif #ifdef USE_ARES | CURL_VERSION_ASYNCHDNS #endif |