* Macro used to include code only in debug builds.
*/
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
#define DEBUGF(x) x
#else
#define DEBUGF(x) do { } while (0)
* 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)
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2006, 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
.\" * $Id$
.\" **************************************************************************
.\"
-.TH curl_version_info 3 "2 Nov 2006" "libcurl 7.16.1" "libcurl Manual"
+.TH curl_version_info 3 "10 June 2009" "libcurl 7.19.6" "libcurl Manual"
.SH NAME
curl_version_info - returns run-time libcurl version info
.SH SYNOPSIS
.IP CURL_VERSION_GSSNEGOTIATE
supports HTTP GSS-Negotiate (added in 7.10.6)
.IP CURL_VERSION_DEBUG
-libcurl was built with extra debug capabilities built-in. This is mainly of
-interest for libcurl hackers. (added in 7.10.6)
+libcurl was built with debug capabilities (added in 7.10.6)
+.IP CURL_VERSION_CURLDEBUG
+libcurl was built with memory tracking debug capabilities. This is mainly of
+interest for libcurl hackers. (added in 7.19.6)
.IP CURL_VERSION_ASYNCHDNS
libcurl was built with support for asynchronous name lookups, which allows
more exact timeouts (even on Windows) and less blocking when using the multi
CURL_TIMECOND_LASTMOD 7.9.7
CURL_VERSION_ASYNCHDNS 7.10.7
CURL_VERSION_CONV 7.15.4
+CURL_VERSION_CURLDEBUG 7.19.6
CURL_VERSION_DEBUG 7.10.6
CURL_VERSION_GSSNEGOTIATE 7.10.6
CURL_VERSION_IDN 7.12.0
#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
-#define CURL_VERSION_CONV (1<<12) /* character conversions are
- supported */
+#define CURL_VERSION_CONV (1<<12) /* character conversions supported */
+#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
/*
* NAME curl_version_info()
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",
};
#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]);
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))
static bool isHandleAtHead(struct SessionHandle *handle,
struct curl_llist *pipeline);
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
static const char * const statename[]={
"INIT",
"CONNECT",
/* 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;
easy->state = state;
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
if(easy->state > CURLM_STATE_CONNECT &&
easy->state < CURLM_STATE_COMPLETED)
connectindex = easy->easy_conn->connectindex;
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,
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,
}
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
void Curl_multi_dump(const struct Curl_multi *multi_handle)
{
struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * 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
/* 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
#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,
netrc_alloc = TRUE;
}
}
-#endif /* CURLDEBUG */
+#endif /* DEBUGBUILD */
if(!netrcfile) {
home = curl_getenv("HOME"); /* portable environment reader */
if(home) {
* Macro used to include code only in debug builds.
*/
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
#define DEBUGF(x) x
#else
#define DEBUGF(x) do { } while (0)
* 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)
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * 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
return 0;
}
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
void Curl_splayprint(struct Curl_tree * t, int d, char output)
{
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * 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
( ((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)
/* 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",
#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]);
conn->read_pos -= thismuch;
conn->bits.stream_was_rewound = TRUE;
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
{
char buf[512 + 1];
size_t show;
{
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 */
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);
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)
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");
continue;
}
-#ifdef CURLDEBUG
+#ifdef DEBUGBUILD
if(pipeLen > MAX_PIPELINE_LENGTH) {
infof(data, "BAD! Connection #%ld has too big pipeline!\n",
check->connectindex);
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);
#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
d c X'00000800'
d CURL_VERSION_CONV...
d c X'00001000'
+ d CURL_VERSION_CURLDEBUG...
+ d c X'00002000'
*
d HTTPPOST_FILENAME...
d c X'00000001'
static const struct feat feats[] = {
{"AsynchDNS", CURL_VERSION_ASYNCHDNS},
{"Debug", CURL_VERSION_DEBUG},
+ {"TrackMemory", CURL_VERSION_CURLDEBUG},
{"GSS-Negotiate", CURL_VERSION_GSSNEGOTIATE},
{"IDN", CURL_VERSION_IDN},
{"IPv6", CURL_VERSION_IPV6},
my $perl="perl -I$srcdir";
my $server_response_maxtime=13;
-# this gets set if curl is compiled with debugging:
-my $curl_debug=0;
+my $debug_build=0; # curl built with --enable-debug
+my $curl_debug=0; # curl built with --enable-curldebug (memory tracking)
my $libtool;
# name of the file that the memory debugging creates:
}
elsif($_ =~ /^Features: (.*)/i) {
$feat = $1;
- if($feat =~ /debug/i) {
- # debug is a listed "feature", use that knowledge
+ if($feat =~ /TrackMemory/i) {
+ # curl was built with --enable-curldebug (memory tracking)
$curl_debug = 1;
+ }
+ if($feat =~ /debug/i) {
+ # curl was built with --enable-debug
+ $debug_build = 1;
# set the NETRC debug env
$ENV{'CURL_DEBUG_NETRC'} = "$LOGDIR/netrc";
}
}
if(!$curl_debug && $torture) {
- die "can't run torture tests since curl was not build with debug";
+ die "can't run torture tests since curl was not built with curldebug";
}
# curl doesn't list cryptographic support separately, so assume it's
logmsg sprintf("* Server SSL: %s\n", $stunnel?"ON":"OFF");
logmsg sprintf("* libcurl SSL: %s\n", $ssl_version?"ON":"OFF");
- logmsg sprintf("* libcurl debug: %s\n", $curl_debug?"ON":"OFF");
+ logmsg sprintf("* debug build: %s\n", $debug_build?"ON":"OFF");
+ logmsg sprintf("* track memory: %s\n", $curl_debug?"ON":"OFF");
logmsg sprintf("* valgrind: %s\n", $valgrind?"ON":"OFF");
logmsg sprintf("* HTTP IPv6 %s\n", $http_ipv6?"ON":"OFF");
logmsg sprintf("* FTP IPv6 %s\n", $ftp_ipv6?"ON":"OFF");
}
}
elsif($f eq "netrc_debug") {
- if($curl_debug) {
+ if($debug_build) {
next;
}
}