cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: binding to --interface

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 23 Mar 2004 17:22:08 +0100

"Daniel Stenberg" <daniel-curl_at_haxx.se> said:

> I thought about that too. The switch you patch here looks a bit stupid to have
> just for this purpose. We should either use strerror() or provide a working
> internal strerror()-replacement.

Okay. I suggest we add
  const char *Curl_strerror (struct connectdata *conn, int err);
to curl_strerror.c and add a connectdata::syserr_buf[].
Hopefully that makes it thread-safe.

I've made one that handles errors from sys_errlist[] and
Winsock errors. Uses strerror_r() where available.

Attached diff and new file curl_strerror.h.

PS. Made a separate get_winsock_error() function since
the system default messages are so long and incomprehensible.

--gv

Received on 2004-03-23