aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-09-05 07:24:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-09-05 07:24:01 +0000
commit610ec27d933843a0d5f954383f599aa33002e0e5 (patch)
tree2e57f321c45b6146f392a4262678b661a64118d9 /lib
parent70f2717c11bfc68ffd78c8b01cf95b6ce98cc21b (diff)
first shaky and stumbling attempts at a *_duphandle() function
Diffstat (limited to 'lib')
-rw-r--r--lib/easy.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 38ae32082..f9cb6d860 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -250,3 +250,30 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
return Curl_getinfo(data, info, paramp);
}
+
+CURL *curl_easy_duphandle(CURL *incurl)
+{
+ struct SessionHandle *data=(struct SessionHandle *)incurl;
+
+ struct SessionHandle *outcurl = malloc(sizeof(struct SessionHandle));
+
+ if(NULL == outcurl)
+ return NULL; /* failure */
+
+ /* start with clearing the entire new struct */
+ memset(outcurl, 0, sizeof(struct SessionHandle));
+
+ /* copy all userdefined values */
+ outcurl->set = data->set;
+
+ /* duplicate all values in 'change' */
+ outcurl->change.url = strdup(data->change.url);
+ outcurl->change.proxy = strdup(data->change.proxy);
+ outcurl->change.referer = strdup(data->change.referer);
+ /* set all the alloc-bits */
+ outcurl->change.url_alloc =
+ outcurl->change.proxy_alloc =
+ outcurl->change.referer_alloc = TRUE;
+
+ return outcurl;
+}