123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- #ifndef HEADER_CURL_COOKIE_H
- #define HEADER_CURL_COOKIE_H
- #include "curl_setup.h"
- #include <curl/curl.h>
- #include "llist.h"
- struct Cookie {
- struct Curl_llist_node node;
- struct Curl_llist_node getnode;
- char *name;
- char *value;
- char *path;
- char *spath;
- char *domain;
- curl_off_t expires;
- int creationtime;
- BIT(tailmatch);
- BIT(secure);
- BIT(livecookie);
- BIT(httponly);
- BIT(prefix_secure);
- BIT(prefix_host);
- };
- #define COOKIE_PREFIX__SECURE (1<<0)
- #define COOKIE_PREFIX__HOST (1<<1)
- #define COOKIE_HASH_SIZE 63
- struct CookieInfo {
-
- struct Curl_llist cookielist[COOKIE_HASH_SIZE];
- curl_off_t next_expiration;
- int numcookies;
- int lastct;
- bool running;
- bool newsession;
- };
- #define MAX_COOKIE_LINE 5000
- #define MAX_NAME 4096
- #define MAX_SET_COOKIE_AMOUNT 50
- #define MAX_COOKIE_HEADER_LEN 8190
- #define MAX_COOKIE_SEND_AMOUNT 150
- struct Curl_easy;
- struct Cookie *Curl_cookie_add(struct Curl_easy *data,
- struct CookieInfo *c, bool header,
- bool noexpiry, const char *lineptr,
- const char *domain, const char *path,
- bool secure);
- int Curl_cookie_getlist(struct Curl_easy *data,
- struct CookieInfo *c, const char *host,
- const char *path, bool secure,
- struct Curl_llist *list);
- void Curl_cookie_clearall(struct CookieInfo *cookies);
- void Curl_cookie_clearsess(struct CookieInfo *cookies);
- #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
- #define Curl_cookie_list(x) NULL
- #define Curl_cookie_loadfiles(x) Curl_nop_stmt
- #define Curl_cookie_init(x,y,z,w) NULL
- #define Curl_cookie_cleanup(x) Curl_nop_stmt
- #define Curl_flush_cookies(x,y) Curl_nop_stmt
- #else
- void Curl_flush_cookies(struct Curl_easy *data, bool cleanup);
- void Curl_cookie_cleanup(struct CookieInfo *c);
- struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
- const char *file, struct CookieInfo *inc,
- bool newsession);
- struct curl_slist *Curl_cookie_list(struct Curl_easy *data);
- void Curl_cookie_loadfiles(struct Curl_easy *data);
- #endif
- #endif
|