summaryrefslogtreecommitdiffstats
path: root/lib/share.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2016-08-03 06:37:16 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-03 18:26:29 (GMT)
commit202adcfe056681109fe61569ecdb3bd69f0b4f97 (patch)
treebabb186f9f5f5e1345c61a2b2a4b955a9bae7849 /lib/share.c
parent7ec709d3d7cc988d4cf6dc2c49713d4c55f09542 (diff)
downloadCMake-202adcfe056681109fe61569ecdb3bd69f0b4f97.zip
CMake-202adcfe056681109fe61569ecdb3bd69f0b4f97.tar.gz
CMake-202adcfe056681109fe61569ecdb3bd69f0b4f97.tar.bz2
curl 2016-08-03 (f2cb3a01)
Code extracted from: https://github.com/bagder/curl.git at commit f2cb3a01192d36395d16acec6cdb93446ca6fd45 (curl-7_50_1).
Diffstat (limited to 'lib/share.c')
-rw-r--r--lib/share.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/share.c b/lib/share.c
index 1720248..5b3957f 100644
--- a/lib/share.c
+++ b/lib/share.c
@@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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.
+ * are also available at https://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
@@ -31,7 +31,7 @@
/* The last #include file should be: */
#include "memdebug.h"
-CURLSH *
+struct Curl_share *
curl_share_init(void)
{
struct Curl_share *share = calloc(1, sizeof(struct Curl_share));
@@ -49,9 +49,8 @@ curl_share_init(void)
#undef curl_share_setopt
CURLSHcode
-curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
+curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
{
- struct Curl_share *share = (struct Curl_share *)sh;
va_list param;
int type;
curl_lock_function lockfunc;
@@ -71,14 +70,14 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
/* this is a type this share will share */
type = va_arg(param, int);
share->specifier |= (1<<type);
- switch( type ) {
+ switch(type) {
case CURL_LOCK_DATA_DNS:
break;
case CURL_LOCK_DATA_COOKIE:
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
if(!share->cookies) {
- share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE );
+ share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE);
if(!share->cookies)
res = CURLSHE_NOMEM;
}
@@ -114,7 +113,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
/* this is a type this share will no longer share */
type = va_arg(param, int);
share->specifier &= ~(1<<type);
- switch( type ) {
+ switch(type) {
case CURL_LOCK_DATA_DNS:
break;
@@ -172,10 +171,8 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
}
CURLSHcode
-curl_share_cleanup(CURLSH *sh)
+curl_share_cleanup(struct Curl_share *share)
{
- struct Curl_share *share = (struct Curl_share *)sh;
-
if(share == NULL)
return CURLSHE_INVALID;
@@ -213,7 +210,7 @@ curl_share_cleanup(CURLSH *sh)
CURLSHcode
-Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
+Curl_share_lock(struct Curl_easy *data, curl_lock_data type,
curl_lock_access accesstype)
{
struct Curl_share *share = data->share;
@@ -231,7 +228,7 @@ Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
}
CURLSHcode
-Curl_share_unlock(struct SessionHandle *data, curl_lock_data type)
+Curl_share_unlock(struct Curl_easy *data, curl_lock_data type)
{
struct Curl_share *share = data->share;