blob: 4b13406d9fa030b1f9667378045216e6a894468b [file] [log] [blame]
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -07001#ifndef HEADER_CURL_SHARE_H
2#define HEADER_CURL_SHARE_H
Kristian Monsen5ab50182010-05-14 18:53:44 +01003/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
Alex Deymo486467e2017-12-19 19:04:07 +010010 * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
Kristian Monsen5ab50182010-05-14 18:53:44 +010011 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
Alex Deymod15eaac2016-06-28 14:49:26 -070014 * are also available at https://curl.haxx.se/docs/copyright.html.
Kristian Monsen5ab50182010-05-14 18:53:44 +010015 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ***************************************************************************/
24
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070025#include "curl_setup.h"
Kristian Monsen5ab50182010-05-14 18:53:44 +010026#include <curl/curl.h>
27#include "cookie.h"
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070028#include "urldata.h"
Alex Deymo486467e2017-12-19 19:04:07 +010029#include "conncache.h"
Kristian Monsen5ab50182010-05-14 18:53:44 +010030
31/* SalfordC says "A structure member may not be volatile". Hence:
32 */
33#ifdef __SALFORDC__
34#define CURL_VOLATILE
35#else
36#define CURL_VOLATILE volatile
37#endif
38
39/* this struct is libcurl-private, don't export details */
40struct Curl_share {
41 unsigned int specifier;
42 CURL_VOLATILE unsigned int dirty;
43
44 curl_lock_function lockfunc;
45 curl_unlock_function unlockfunc;
46 void *clientdata;
Alex Deymo486467e2017-12-19 19:04:07 +010047 struct conncache conn_cache;
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070048 struct curl_hash hostcache;
49#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
Kristian Monsen5ab50182010-05-14 18:53:44 +010050 struct CookieInfo *cookies;
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070051#endif
52
53 struct curl_ssl_session *sslsession;
54 size_t max_ssl_sessions;
55 long sessionage;
Kristian Monsen5ab50182010-05-14 18:53:44 +010056};
57
Elliott Hughes82be86d2017-09-20 17:00:17 -070058CURLSHcode Curl_share_lock(struct Curl_easy *, curl_lock_data,
59 curl_lock_access);
60CURLSHcode Curl_share_unlock(struct Curl_easy *, curl_lock_data);
Kristian Monsen5ab50182010-05-14 18:53:44 +010061
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070062#endif /* HEADER_CURL_SHARE_H */