From 6dfe0ec31ed5ac5c9868b08bd8340a2101e8b667 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 13 Aug 2002 14:20:47 +0000 Subject: Sterling Hughes brings the share interface --- lib/share.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/share.h (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h new file mode 100644 index 000000000..5550c6442 --- /dev/null +++ b/lib/share.h @@ -0,0 +1,48 @@ +#ifndef __CURL_SHARE_H +#define __CURL_SHARE_H + +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * In order to be useful for every potential user, curl and libcurl are + * dual-licensed under the MPL and the MIT/X-derivate licenses. + * + * 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 MPL or the MIT/X-derivate + * licenses. You may pick one of these licenses. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + *****************************************************************************/ + +#include "setup.h" +#include + +typedef enum { + SHARE_ERROR_OK = 0, + SHARE_ERROR_INVALID, + SHARE_ERROR_NOT_REGISTERED, + SHARE_ERROR_LAST +} Curl_share_error; + +Curl_share_error Curl_share_aquire_lock (CURL *, curl_lock_type); +Curl_share_error Curl_share_release_lock (CURL *, curl_lock_type); + +#endif /* __CURL_SHARE_H */ + +/* + * local variables: + * eval: (load-file "../curl-mode.el") + * end: + * vim600: fdm=marker + * vim: et sw=2 ts=2 sts=2 tw=78 + */ -- cgit v1.2.1 From ba4e69bebc8f7f32f3bc7faa1e13e7580754075b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2002 11:52:59 +0000 Subject: updated source code boilerplate/header --- lib/share.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 5550c6442..c373c3ccf 100644 --- a/lib/share.h +++ b/lib/share.h @@ -1,7 +1,7 @@ #ifndef __CURL_SHARE_H #define __CURL_SHARE_H -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | @@ -10,19 +10,19 @@ * * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. - * + * 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 MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * 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$ - *****************************************************************************/ + ***************************************************************************/ #include "setup.h" #include -- cgit v1.2.1 From 9a239edb5254fb684ec8095624d763ddeb49d063 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 8 Jan 2003 15:50:52 +0000 Subject: updated to use the modified share-types --- lib/share.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index c373c3ccf..75a32961f 100644 --- a/lib/share.h +++ b/lib/share.h @@ -34,8 +34,19 @@ typedef enum { SHARE_ERROR_LAST } Curl_share_error; -Curl_share_error Curl_share_aquire_lock (CURL *, curl_lock_type); -Curl_share_error Curl_share_release_lock (CURL *, curl_lock_type); +/* this struct is libcurl-private, don't export details */ +struct Curl_share { + unsigned int specifier; + unsigned int locked; + unsigned int dirty; + + curl_lock_function lockfunc; + curl_unlock_function unlockfunc; + void *clientdata; +}; + +Curl_share_error Curl_share_aquire_lock (CURL *, curl_lock_data); +Curl_share_error Curl_share_release_lock (CURL *, curl_lock_data); #endif /* __CURL_SHARE_H */ -- cgit v1.2.1 From f152f23a680670e72e230d6247a2ed4552750480 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 9 Jan 2003 10:21:03 +0000 Subject: Updated more and now looks and and the API possibly works almost like the design document specifies. There is still no code inside that uses this. --- lib/share.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 75a32961f..fdd6ec555 100644 --- a/lib/share.h +++ b/lib/share.h @@ -27,13 +27,6 @@ #include "setup.h" #include -typedef enum { - SHARE_ERROR_OK = 0, - SHARE_ERROR_INVALID, - SHARE_ERROR_NOT_REGISTERED, - SHARE_ERROR_LAST -} Curl_share_error; - /* this struct is libcurl-private, don't export details */ struct Curl_share { unsigned int specifier; @@ -45,8 +38,8 @@ struct Curl_share { void *clientdata; }; -Curl_share_error Curl_share_aquire_lock (CURL *, curl_lock_data); -Curl_share_error Curl_share_release_lock (CURL *, curl_lock_data); +CURLSHcode Curl_share_aquire_lock (struct SessionHandle *, curl_lock_data); +CURLSHcode Curl_share_release_lock (struct SessionHandle *, curl_lock_data); #endif /* __CURL_SHARE_H */ -- cgit v1.2.1 From f26a338a54e04d0a6907f5d2479d8b0fa9daf297 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Jan 2003 21:08:12 +0000 Subject: copyright year update in the source header --- lib/share.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index fdd6ec555..ff364645b 100644 --- a/lib/share.h +++ b/lib/share.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From a7c72b7abf1213c471f3fd11e6b8e3a37d526f60 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 29 Jan 2003 10:14:20 +0000 Subject: removed the local variables for emacs and vim, use the new sample.emacs way for emacs, and vim users should provide a similar non-polluting style --- lib/share.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index ff364645b..ea6f2f1ce 100644 --- a/lib/share.h +++ b/lib/share.h @@ -42,11 +42,3 @@ CURLSHcode Curl_share_aquire_lock (struct SessionHandle *, curl_lock_data); CURLSHcode Curl_share_release_lock (struct SessionHandle *, curl_lock_data); #endif /* __CURL_SHARE_H */ - -/* - * local variables: - * eval: (load-file "../curl-mode.el") - * end: - * vim600: fdm=marker - * vim: et sw=2 ts=2 sts=2 tw=78 - */ -- cgit v1.2.1 From beb13a1d3e832ae97221ba1d9ad7f9bc262de798 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Barette-LaPierre Date: Tue, 4 Feb 2003 23:48:46 +0000 Subject: added the sharing of DNS cache --- lib/share.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index ea6f2f1ce..76e6244d7 100644 --- a/lib/share.h +++ b/lib/share.h @@ -30,15 +30,24 @@ /* this struct is libcurl-private, don't export details */ struct Curl_share { unsigned int specifier; - unsigned int locked; - unsigned int dirty; + volatile unsigned int dirty; curl_lock_function lockfunc; curl_unlock_function unlockfunc; void *clientdata; + + curl_hash *hostcache; }; -CURLSHcode Curl_share_aquire_lock (struct SessionHandle *, curl_lock_data); -CURLSHcode Curl_share_release_lock (struct SessionHandle *, curl_lock_data); +CURLSHcode Curl_share_lock ( + struct SessionHandle *, + curl_lock_data, + curl_lock_access + ); + +CURLSHcode Curl_share_unlock ( + struct SessionHandle *, + curl_lock_data + ); #endif /* __CURL_SHARE_H */ -- cgit v1.2.1 From 41ae97e710f728495a1d6adba6476c21b94c4881 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 4 Aug 2003 15:02:42 +0000 Subject: Dirk Manske's patch that introduces cookie support to the share interface. --- lib/share.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 76e6244d7..45844e495 100644 --- a/lib/share.h +++ b/lib/share.h @@ -26,6 +26,7 @@ #include "setup.h" #include +#include "cookie.h" /* this struct is libcurl-private, don't export details */ struct Curl_share { @@ -37,6 +38,7 @@ struct Curl_share { void *clientdata; curl_hash *hostcache; + struct CookieInfo *cookies; }; CURLSHcode Curl_share_lock ( -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- lib/share.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 45844e495..5c85c8091 100644 --- a/lib/share.h +++ b/lib/share.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 043d70fcdfa50c93dc826069aa5836206f8e3e2d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jan 2005 00:06:29 +0000 Subject: Use plain structs and not typedef'ed ones in the hash and linked-list code. --- lib/share.h | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 5c85c8091..5f02f1aed 100644 --- a/lib/share.h +++ b/lib/share.h @@ -2,18 +2,18 @@ #define __CURL_SHARE_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , 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. @@ -32,24 +32,17 @@ struct Curl_share { unsigned int specifier; volatile unsigned int dirty; - + curl_lock_function lockfunc; curl_unlock_function unlockfunc; void *clientdata; - curl_hash *hostcache; + struct curl_hash *hostcache; struct CookieInfo *cookies; }; -CURLSHcode Curl_share_lock ( - struct SessionHandle *, - curl_lock_data, - curl_lock_access - ); - -CURLSHcode Curl_share_unlock ( - struct SessionHandle *, - curl_lock_data - ); +CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, + curl_lock_access); +CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data); #endif /* __CURL_SHARE_H */ -- cgit v1.2.1 From 414c57d138b9fe21eeecde730d9369eaedbdbc89 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Wed, 26 Apr 2006 17:11:05 +0000 Subject: Added support for Salford-C under Win32 (scc). HAVE_MALLOC_H and HAVE_PROCESS_H added for all except scc. --- lib/share.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 5f02f1aed..5cfe8c792 100644 --- a/lib/share.h +++ b/lib/share.h @@ -28,10 +28,18 @@ #include #include "cookie.h" +/* SalfordC says "A structure member may not be volatile". Hence: + */ +#ifdef __SALFORDC__ +#define CURL_VOLATILE +#else +#define CURL_VOLATILE volatile +#endif + /* this struct is libcurl-private, don't export details */ struct Curl_share { unsigned int specifier; - volatile unsigned int dirty; + CURL_VOLATILE unsigned int dirty; curl_lock_function lockfunc; curl_unlock_function unlockfunc; -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/share.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 5cfe8c792..ea8e233d2 100644 --- a/lib/share.h +++ b/lib/share.h @@ -21,7 +21,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ #include "setup.h" -- cgit v1.2.1 From 5793bc370c794a10e6ed014cb535a47672842ae6 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Date: Tue, 20 Sep 2011 17:43:54 +0200 Subject: SSL session sharing support added With locking, plus test, plus documentation --- lib/share.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index ea8e233d2..cf200008f 100644 --- a/lib/share.h +++ b/lib/share.h @@ -26,6 +26,7 @@ #include "setup.h" #include #include "cookie.h" +#include "urldata.h" /* SalfordC says "A structure member may not be volatile". Hence: */ @@ -46,6 +47,9 @@ struct Curl_share { struct curl_hash *hostcache; struct CookieInfo *cookies; + + struct curl_ssl_session *sslsession; + unsigned int nsslsession; }; CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, -- cgit v1.2.1 From 15e3e451702396e870c00d186ff7710792a1f28e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Oct 2011 22:32:36 +0200 Subject: share: don't use SSL unless enabled Don't even declare the struct members for disabled features Introducing the CURLSHE_NOT_BUILT_IN return code for the share interface when trying to set a sharing option that has been disabled (or not enabled) in the library. --- lib/share.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index cf200008f..cb5c6c7f3 100644 --- a/lib/share.h +++ b/lib/share.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -46,9 +46,13 @@ struct Curl_share { void *clientdata; struct curl_hash *hostcache; +#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) struct CookieInfo *cookies; +#endif +#ifdef USE_SSL struct curl_ssl_session *sslsession; +#endif unsigned int nsslsession; }; -- cgit v1.2.1 From 5c809178c2753e08c7c02081ea4e0c424e87ba30 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Oct 2011 16:33:07 +0200 Subject: struct Curl_share: provide sslsession unconditionally It makes much nicer and less convuluted code everywhere if this struct member is always present even when libcurl is built without SSL support. This reverts parts of commit 15e3e451702396e --- lib/share.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index cb5c6c7f3..c9546567d 100644 --- a/lib/share.h +++ b/lib/share.h @@ -50,9 +50,7 @@ struct Curl_share { struct CookieInfo *cookies; #endif -#ifdef USE_SSL struct curl_ssl_session *sslsession; -#endif unsigned int nsslsession; }; -- cgit v1.2.1 From 35f61c404d434e00da0f502a073cd3a0201fa504 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Ayllon Date: Thu, 17 Nov 2011 23:34:38 +0100 Subject: SSL session share: move the age counter to the share object Previously the age counter would be counted individually in each easy handle that shared SSL sessions! --- lib/share.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index c9546567d..3148ed00b 100644 --- a/lib/share.h +++ b/lib/share.h @@ -52,6 +52,7 @@ struct Curl_share { struct curl_ssl_session *sslsession; unsigned int nsslsession; + long sessionage; }; CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, -- cgit v1.2.1 From d56b4c3f89ad3ee28dc62a22cffe2c85ced19830 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 18 Jan 2012 23:39:30 +0100 Subject: ssl session caching: fix compiler warnings --- lib/share.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/share.h') diff --git a/lib/share.h b/lib/share.h index 3148ed00b..b9e6c2538 100644 --- a/lib/share.h +++ b/lib/share.h @@ -1,6 +1,5 @@ -#ifndef __CURL_SHARE_H -#define __CURL_SHARE_H - +#ifndef HEADER_CURL_SHARE_H +#define HEADER_CURL_SHARE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -8,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -51,7 +50,7 @@ struct Curl_share { #endif struct curl_ssl_session *sslsession; - unsigned int nsslsession; + size_t max_ssl_sessions; long sessionage; }; @@ -59,4 +58,4 @@ CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data, curl_lock_access); CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data); -#endif /* __CURL_SHARE_H */ +#endif /* HEADER_CURL_SHARE_H */ -- cgit v1.2.1