|
Dillo v3.2.0-93-g6a586845
|
Handling of cookies takes place here. More...
#include "msg.h"#include <sys/types.h>#include <sys/stat.h>#include <sys/file.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <ctype.h>#include <errno.h>#include "IO/Url.h"#include "list.h"#include "cookies.h"#include "capi.h"#include "../dpip/dpip.h"
Go to the source code of this file.
Macros | |
| #define | LINE_MAXLEN 4096 |
| The maximum length of a line in the cookie file. | |
Enumerations | |
| enum | CookieControlAction { COOKIE_ACCEPT , COOKIE_ACCEPT_SESSION , COOKIE_DENY } |
Functions | |
| static FILE * | Cookies_fopen (const char *filename, char *init_str) |
| Return a file pointer. | |
| static CookieControlAction | Cookies_control_check (const DilloUrl *url) |
| Same as Cookies_control_check_domain except it takes an URL. | |
| static CookieControlAction | Cookies_control_check_domain (const char *domain) |
| Check the rules for an appropriate action for this domain. | |
| static int | Cookie_control_init (void) |
| Get the cookie control rules (from cookiesrc). | |
| void | a_Cookies_init (void) |
| Initialize the cookies module (The 'disabled' variable is writable only within a_Cookies_init) | |
| void | a_Cookies_freeall (void) |
| Flush cookies to disk and free all the memory allocated. | |
| void | a_Cookies_set (Dlist *cookie_strings, const DilloUrl *set_url, const char *date) |
| Set the value corresponding to the cookie string. | |
| char * | a_Cookies_get_query (const DilloUrl *query_url, const DilloUrl *requester, int is_root_url) |
| Return a string containing cookie data for an HTTP query. | |
Variables | |
| static CookieControl * | ccontrol = NULL |
| static int | num_ccontrol = 0 |
| static int | num_ccontrol_max = 1 |
| static CookieControlAction | default_action = COOKIE_DENY |
| static bool_t | disabled |
Handling of cookies takes place here.
Definition in file cookies.c.
| #define LINE_MAXLEN 4096 |
| enum CookieControlAction |
| void a_Cookies_freeall | ( | void | ) |
| char * a_Cookies_get_query | ( | const DilloUrl * | query_url, |
| const DilloUrl * | requester, | ||
| int | is_root_url | ||
| ) |
Return a string containing cookie data for an HTTP query.
Definition at line 186 of file cookies.c.
References _MSG, a_Dpi_send_blocking_cmd(), a_Dpip_build_cmd(), a_Dpip_get_attr(), a_Url_same_organization(), COOKIE_DENY, Cookies_control_check(), dFree(), disabled, dStrdup(), MSG, path(), URL_HOST, URL_HOST_, URL_PATH_, and URL_SCHEME.
Referenced by expect(), Http_make_query_str(), and main().
| void a_Cookies_init | ( | void | ) |
Set the value corresponding to the cookie string.
Definition at line 143 of file cookies.c.
References _MSG, a_Dpi_send_blocking_cmd(), a_Dpip_build_cmd(), COOKIE_DENY, Cookies_control_check(), dFree(), disabled, dList_nth_data(), path(), URL_HOST_, and URL_PATH_.
Referenced by Cache_parse_header(), expires_date_formats(), expires_extremes(), expires_server_ahead(), expires_server_behind(), main(), maxage(), path(), and toomany().
|
static |
Get the cookie control rules (from cookiesrc).
Definition at line 243 of file cookies.c.
References a_List_add, ccontrol, COOKIE_ACCEPT, COOKIE_ACCEPT_SESSION, COOKIE_DENY, Cookies_fopen(), default_action, dFree(), dGethomedir(), dIsspace, dStrAsciiCasecmp(), dStrconcat(), dStrdup(), dStrerror, dStrstrip(), FALSE, LINE_MAXLEN, MSG, num_ccontrol, num_ccontrol_max, and TRUE.
|
static |
Same as Cookies_control_check_domain except it takes an URL.
Definition at line 367 of file cookies.c.
References Cookies_control_check_domain(), and URL_HOST.
Referenced by a_Cookies_get_query(), and a_Cookies_set().
|
static |
Check the rules for an appropriate action for this domain.
The rules are ordered by domain length, with longest first, so the first match is the most specific.
Definition at line 339 of file cookies.c.
References ccontrol, default_action, dStrAsciiCasecmp(), and num_ccontrol.
|
static |
|
static |