curl-library
RE: Unsetting options
Date: Sun, 17 Aug 2003 14:51:25 +0200 (CEST)
On Fri, 15 Aug 2003, Jeff Pohlmeyer wrote:
> It seems like I ran into trouble once before with this one:
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);
Ah, right. This patch fixes this problem:
===================================================================
RCS file: /repository/curl/lib/url.c,v
retrieving revision 1.298
diff -u -r1.298 url.c
--- url.c 14 Aug 2003 14:20:03 -0000 1.298
+++ url.c 17 Aug 2003 12:49:54 -0000
@@ -1016,12 +1016,18 @@
* Set data write callback
*/
data->set.fwrite = va_arg(param, curl_write_callback);
+ if(!data->set.fwrite)
+ /* When set to NULL, reset to our internal default function */
+ data->set.fwrite = (curl_write_callback)fwrite;
break;
case CURLOPT_READFUNCTION:
/*
* Read data callback
*/
data->set.fread = va_arg(param, curl_read_callback);
+ if(!data->set.fread)
+ /* When set to NULL, reset to our internal default function */
+ data->set.fread = (curl_read_callback)fread;
break;
case CURLOPT_SSLCERT:
/*
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01Received on 2003-08-17