aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-04-12 07:21:11 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-04-12 07:21:11 +0000
commit3f6133be2735936631c4bfe5aedd28ae9b084f3f (patch)
treec77945364d0d160199188bd96d6a23725d394a62 /lib/url.c
parentc3bfb355c56178d23a5fc2d8706a1da472800da4 (diff)
Jean-Philippe Barrette-LaPierre provided his patch that introduces
CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/url.c b/lib/url.c
index ed8d67b8b..365250e2d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -804,12 +804,29 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
*/
data->set.set_resume_from = va_arg(param, long);
break;
+ case CURLOPT_DEBUGFUNCTION:
+ /*
+ * stderr write callback.
+ */
+ data->set.fdebug = va_arg(param, curl_debug_callback);
+ /*
+ * if the callback provided is NULL, it'll use the default callback
+ */
+ break;
+ case CURLOPT_DEBUGDATA:
+ /*
+ * Set to a void * that should receive all error writes. This
+ * defaults to CURLOPT_STDERR for normal operations.
+ */
+ data->set.debugdata = va_arg(param, void *);
case CURLOPT_STDERR:
/*
* Set to a FILE * that should receive all error writes. This
* defaults to stderr for normal operations.
*/
data->set.err = va_arg(param, FILE *);
+ if(!data->set.err)
+ data->set.err = stderr;
break;
case CURLOPT_HEADERFUNCTION:
/*
@@ -2265,13 +2282,13 @@ static CURLcode CreateConnection(struct SessionHandle *data,
{
struct in_addr in;
(void) memcpy(&in.s_addr, &conn->serv_addr.sin_addr, sizeof (in.s_addr));
- infof(data, "Connected to %s (%s)\n", conn->hostaddr->h_name,
+ infof(data, "Connected to %s (%s) port %d\n", conn->hostaddr->h_name,
#if defined(HAVE_INET_NTOA_R)
- inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf))
+ inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf)),
#else
- inet_ntoa(in)
+ inet_ntoa(in),
#endif
- );
+ conn->port);
}
#endif