Kjetil Jacobsen's patch that introduces CURLOPT_PRIVATE and CURLINFO_PRIVATE

for storage and retrieval of private data in the curl handle.
This commit is contained in:
Daniel Stenberg 2002-11-20 19:11:22 +00:00
parent f68505ee23
commit 8bca5e05b8
6 changed files with 29 additions and 2 deletions

View file

@ -158,6 +158,9 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
case CURLINFO_CONTENT_TYPE:
*param_charp = data->info.contenttype;
break;
case CURLINFO_PRIVATE:
*param_charp = data->set.private?data->set.private:(char *)"";
break;
default:
return CURLE_BAD_FUNCTION_ARGUMENT;
}

View file

@ -1088,6 +1088,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
data->set.proxytype = va_arg(param, long);
break;
case CURLOPT_PRIVATE:
/*
* Set private data pointer.
*/
data->set.private = va_arg(param, char *);
break;
default:
/* unknown tag and its companion, just ignore: */
return CURLE_FAILED_INIT; /* correct this */

View file

@ -686,6 +686,8 @@ struct UserDefined {
int dns_cache_timeout; /* DNS cache timeout */
long buffer_size; /* size of receive buffer to use */
char *private; /* Private data */
/* Here follows boolean settings that define how to behave during
this session. They are STATIC, set by libcurl users or at least initially