cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Values of CURLOPT_NETRC - patch

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 4 Apr 2002 11:49:31 +0200 (MET DST)

On Thu, 4 Apr 2002, J. Cone wrote:

> *Saran needs a three-value configuration item (for HTTP POST). How would
> you feel about having a generic DEFAULT / NEVER / SOMETIMES / ALWAYS enum?
> where DEFAULT must have the same behaviour as one of the other options.

Why would we need a generic enum for that? What else than HTTP POST (if even
that) would need it?

> Could you please point me to some more information about:
> - how --enable-debug is turned on and off

By invoking using --enable-debug or --disable-debug to configure. It is
disabled by default. When enabled, it sets stricted (gcc) compiler flags and
defines to enable the memory debug system.

> - an example of how this alters what the program compiles

-DMALLOCDEBUG gets set. lib/memdebug.[ch] are entirely dependent on that
variable. With it set, we can get all resource-using functions logged to a
specific file (and supervised somewhat in run-time too).

> - an example of how the tests know whether it's enabled, to know what to
> test

The command line tool's src/main.c source has source code, that if
MALLOCDEBUG is set, it checks for an environment variable named
CURL_MEMDEBUG. If that variable is set, it calls curl_memdebug() with a file
name to make the memory debugging system log everything to that file.

The 'tests/runtests.pl' script sets the variable and runs curl once to see if
there's a logfile created. If it is, it knows that memory debugging is
enabled and working.

The same principle could be applied to other kinds of checks, when the final
(real) build isn't enough to test everything we want to test.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-04