diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-08-01 21:20:01 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-08-01 21:20:01 +0000 |
commit | 50c10aa5bf545eedfdbe561116656b6ec12654cd (patch) | |
tree | ae3de37fd3877d42ffd4c0cdcd03c4530e68a326 /lib/easy.c | |
parent | 006878686cfd3faa9eca92fc8fe60cb8f8073a59 (diff) | |
download | curl-50c10aa5bf545eedfdbe561116656b6ec12654cd.tar.gz |
Patrick Monnerat and I modified libcurl so that now it *copies* all strings
passed to it with curl_easy_setopt()! Previously it has always just refered
to the data, forcing the user to keep the data around until libcurl is done
with it. That is now history and libcurl will instead clone the given
strings and keep private copies.
Diffstat (limited to 'lib/easy.c')
-rw-r--r-- | lib/easy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/easy.c b/lib/easy.c index b1080a22d..54915fb88 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -579,7 +579,8 @@ CURL *curl_easy_duphandle(CURL *incurl) outcurl->state.headersize=HEADERSIZE; /* copy all userdefined values */ - outcurl->set = data->set; + if (Curl_dupset(outcurl, data) != CURLE_OK) + break; if(data->state.used_interface == Curl_if_multi) outcurl->state.connc = data->state.connc; @@ -658,6 +659,7 @@ CURL *curl_easy_duphandle(CURL *incurl) free(outcurl->change.url); if(outcurl->change.referer) free(outcurl->change.referer); + Curl_freeset(outcurl); free(outcurl); /* free the memory again */ outcurl = NULL; } @@ -681,6 +683,7 @@ void curl_easy_reset(CURL *curl) data->reqdata.proto.generic=NULL; /* zero out UserDefined data: */ + Curl_freeset(data); memset(&data->set, 0, sizeof(struct UserDefined)); /* zero out Progress data: */ @@ -732,7 +735,7 @@ void curl_easy_reset(CURL *curl) data->set.ssl.verifyhost = 2; #ifdef CURL_CA_BUNDLE /* This is our prefered CA cert bundle since install time */ - data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE; + (void) curl_easy_setopt(curl, CURLOPT_CAINFO, (char *) CURL_CA_BUNDLE); #endif data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth |