aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-08-17 13:32:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-08-17 13:32:37 +0000
commit394faaeb9779d4639c845793eeec6d30e12baa3a (patch)
tree747da4adcc2343fb80be65e5840c44c880c5ac56 /lib
parent5c2df3e1a4da7b17ae053ee8c4ecef5eb2d30464 (diff)
setting WRITEFUNCTION or READFUNCTION to NULL will now reset the callback
pointers to the internal default functions
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 588391524..3c5240b78 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1016,12 +1016,18 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
* 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:
/*