summaryrefslogtreecommitdiff
path: root/lib/slist.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-03-09 12:21:46 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-03-09 12:21:46 +0000
commitbdec6f2b20440b53859e472d185a21f1951341d5 (patch)
treee4b28569a8cd1bbc59686932e3e8c9810bb98d29 /lib/slist.h
parentc86c294f554b901754e8ec97ae5399b7f217b9ba (diff)
downloadcurl-bdec6f2b20440b53859e472d185a21f1951341d5.tar.gz
- Frank Hempel found out a bug and provided the fix:
curl_easy_duphandle did not necessarily duplicate the CURLOPT_COOKIEFILE option. It only enabled the cookie engine in the destination handle if data->cookies is not NULL (where data is the source handle). In case of a newly initialized handle which just had the cookie support enabled by a curl_easy_setopt(handle, CURL_COOKIEFILE, "")-call, handle->cookies was still NULL because the setopt-call only appends the value to data->change.cookielist, hence duplicating this handle would not have the cookie engine switched on. We also concluded that the slist-functionality would be suitable for being put in its own module rather than simply hanging out in lib/sendf.c so I created lib/slist.[ch] for them.
Diffstat (limited to 'lib/slist.h')
-rw-r--r--lib/slist.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/slist.h b/lib/slist.h
new file mode 100644
index 000000000..1847f81f3
--- /dev/null
+++ b/lib/slist.h
@@ -0,0 +1,33 @@
+#ifndef __SLIST_H
+#define __SLIST_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * $Id$
+ ***************************************************************************/
+
+/*
+ * Curl_slist_duplicate() duplicates a linked list. It always returns the
+ * address of the first record of the cloned list or NULL in case of an
+ * error (or if the input list was NULL).
+ */
+struct curl_slist *Curl_slist_duplicate(struct curl_slist *inlist);
+
+#endif /* __SLIST_H */