setting WRITEFUNCTION or READFUNCTION to NULL will now reset the callback
pointers to the internal default functions
This commit is contained in:
parent
5c2df3e1a4
commit
394faaeb97
@ -1016,12 +1016,18 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
|
|||||||
* Set data write callback
|
* Set data write callback
|
||||||
*/
|
*/
|
||||||
data->set.fwrite = va_arg(param, curl_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;
|
break;
|
||||||
case CURLOPT_READFUNCTION:
|
case CURLOPT_READFUNCTION:
|
||||||
/*
|
/*
|
||||||
* Read data callback
|
* Read data callback
|
||||||
*/
|
*/
|
||||||
data->set.fread = va_arg(param, curl_read_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;
|
break;
|
||||||
case CURLOPT_SSLCERT:
|
case CURLOPT_SSLCERT:
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user