updated to use the modified share-types
This commit is contained in:
parent
abcc5c5a82
commit
9a239edb52
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#define CURL_SHARE_GET(__handle) (((struct SessionHandle *) (__handle))->share)
|
#define CURL_SHARE_GET(__handle) (((struct SessionHandle *) (__handle))->share)
|
||||||
|
|
||||||
curl_share *
|
CURLSH *
|
||||||
curl_share_init (void)
|
curl_share_init (void)
|
||||||
{
|
{
|
||||||
curl_share *share = (curl_share *) malloc (sizeof (curl_share));
|
curl_share *share = (curl_share *) malloc (sizeof (curl_share));
|
||||||
|
15
lib/share.h
15
lib/share.h
@ -34,8 +34,19 @@ typedef enum {
|
|||||||
SHARE_ERROR_LAST
|
SHARE_ERROR_LAST
|
||||||
} Curl_share_error;
|
} Curl_share_error;
|
||||||
|
|
||||||
Curl_share_error Curl_share_aquire_lock (CURL *, curl_lock_type);
|
/* this struct is libcurl-private, don't export details */
|
||||||
Curl_share_error Curl_share_release_lock (CURL *, curl_lock_type);
|
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 */
|
#endif /* __CURL_SHARE_H */
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@
|
|||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
#include "escape.h"
|
#include "escape.h"
|
||||||
#include "strtok.h"
|
#include "strtok.h"
|
||||||
|
#include "share.h"
|
||||||
|
|
||||||
/* And now for the protocols */
|
/* And now for the protocols */
|
||||||
#include "ftp.h"
|
#include "ftp.h"
|
||||||
@ -1071,8 +1072,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
|
|||||||
|
|
||||||
case CURLOPT_SHARE:
|
case CURLOPT_SHARE:
|
||||||
{
|
{
|
||||||
curl_share *set;
|
struct Curl_share *set;
|
||||||
set = va_arg(param, curl_share *);
|
set = va_arg(param, struct Curl_share *);
|
||||||
if(data->share)
|
if(data->share)
|
||||||
data->share->dirty--;
|
data->share->dirty--;
|
||||||
|
|
||||||
|
@ -765,7 +765,7 @@ struct UserDefined {
|
|||||||
|
|
||||||
struct SessionHandle {
|
struct SessionHandle {
|
||||||
curl_hash *hostcache;
|
curl_hash *hostcache;
|
||||||
curl_share *share; /* Share, handles global variable mutexing */
|
struct Curl_share *share; /* Share, handles global variable mutexing */
|
||||||
struct UserDefined set; /* values set by the libcurl user */
|
struct UserDefined set; /* values set by the libcurl user */
|
||||||
struct DynamicStatic change; /* possibly modified userdefined data */
|
struct DynamicStatic change; /* possibly modified userdefined data */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user