cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to remove trace

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 8 Mar 2001 14:42:49 +0100 (MET)

On Thu, 8 Mar 2001, Bescon, Guenole wrote:

> When doing a HTTP post and when the server is not running, I receive the
> following message in the standard output: "Can't connect to server: 0"
>
> How can I disable the log of this message ?
>
> I set the MUTE and NO_PROGRESS options in the curl_easy_setopt method.

Ugha. I'm embarassed to admit this, but it seems as if the mute option isn't
respected there! I'll fix this immediately for the next release.

Until then you have three options:

* Set an error buffer with CURLOPT_ERRORBUFFER to receive the text. You don't
  have to do anything with it, but it'll prevent the text from showing up.

* Redirect stderr for libcurl with CURLOPT_STDERR

* Fix the bug in libcurl as shown below:

 void Curl_failf(struct UrlData *data, char *fmt, ...)
@@ -142,7 +142,7 @@
   va_start(ap, fmt);
   if(data->errorbuffer)
     vsnprintf(data->errorbuffer, CURL_ERROR_SIZE, fmt, ap);
- else {
+ else if(!data->bits.mute) {
     /* no errorbuffer receives this, write to data->err instead */
     vfprintf(data->err, fmt, ap);
     fprintf(data->err, "\n");

Thanks for reporting this!

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-03-08