cookie.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_COOKIE_H
00002 #define HEADER_CURL_COOKIE_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 #include "curl_setup.h"
00025 
00026 #include <curl/curl.h>
00027 
00028 struct Cookie {
00029   struct Cookie *next; /* next in the chain */
00030   char *name;        /* <this> = value */
00031   char *value;       /* name = <this> */
00032   char *path;         /* path = <this> which is in Set-Cookie: */
00033   char *spath;        /* sanitized cookie path */
00034   char *domain;      /* domain = <this> */
00035   curl_off_t expires;  /* expires = <this> */
00036   char *expirestr;   /* the plain text version */
00037   bool tailmatch;    /* weather we do tail-matchning of the domain name */
00038 
00039   /* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */
00040   char *version;     /* Version = <value> */
00041   char *maxage;      /* Max-Age = <value> */
00042 
00043   bool secure;       /* whether the 'secure' keyword was used */
00044   bool livecookie;   /* updated from a server, not a stored file */
00045   bool httponly;     /* true if the httponly directive is present */
00046 };
00047 
00048 struct CookieInfo {
00049   /* linked list of cookies we know of */
00050   struct Cookie *cookies;
00051 
00052   char *filename;  /* file we read from/write to */
00053   bool running;    /* state info, for cookie adding information */
00054   long numcookies; /* number of cookies in the "jar" */
00055   bool newsession; /* new session, discard session cookies on load */
00056 };
00057 
00058 /* This is the maximum line length we accept for a cookie line. RFC 2109
00059    section 6.3 says:
00060 
00061    "at least 4096 bytes per cookie (as measured by the size of the characters
00062    that comprise the cookie non-terminal in the syntax description of the
00063    Set-Cookie header)"
00064 
00065 */
00066 #define MAX_COOKIE_LINE 5000
00067 #define MAX_COOKIE_LINE_TXT "4999"
00068 
00069 /* This is the maximum length of a cookie name we deal with: */
00070 #define MAX_NAME 1024
00071 #define MAX_NAME_TXT "1023"
00072 
00073 struct Curl_easy;
00074 /*
00075  * Add a cookie to the internal list of cookies. The domain and path arguments
00076  * are only used if the header boolean is TRUE.
00077  */
00078 
00079 struct Cookie *Curl_cookie_add(struct Curl_easy *data,
00080                                struct CookieInfo *, bool header, char *lineptr,
00081                                const char *domain, const char *path);
00082 
00083 struct Cookie *Curl_cookie_getlist(struct CookieInfo *, const char *,
00084                                    const char *, bool);
00085 void Curl_cookie_freelist(struct Cookie *cookies);
00086 void Curl_cookie_clearall(struct CookieInfo *cookies);
00087 void Curl_cookie_clearsess(struct CookieInfo *cookies);
00088 
00089 #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
00090 #define Curl_cookie_list(x) NULL
00091 #define Curl_cookie_loadfiles(x) Curl_nop_stmt
00092 #define Curl_cookie_init(x,y,z,w) NULL
00093 #define Curl_cookie_cleanup(x) Curl_nop_stmt
00094 #define Curl_flush_cookies(x,y) Curl_nop_stmt
00095 #else
00096 void Curl_flush_cookies(struct Curl_easy *data, int cleanup);
00097 void Curl_cookie_cleanup(struct CookieInfo *);
00098 struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
00099                                     const char *, struct CookieInfo *, bool);
00100 struct curl_slist *Curl_cookie_list(struct Curl_easy *data);
00101 void Curl_cookie_loadfiles(struct Curl_easy *data);
00102 #endif
00103 
00104 #endif /* HEADER_CURL_COOKIE_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02