亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cookies.c

?? 基于minigui的瀏覽器. 這是最新版本.
?? C
字號:
/* * File: cookies.c * * Copyright 2001 Lars Clausen   <lrclause@cs.uiuc.edu> *                J鰎gen Viksell <jorgen.viksell@telia.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *//* Handling of cookies takes place here. * This implementation aims to follow RFC 2965: * http://www.cis.ohio-state.edu/cs/Services/rfc/rfc-text/rfc2965.txt */#define DEBUG_LEVEL 10#include "debug.h"#ifdef DISABLE_COOKIES/* * Initialize the cookies module */void a_Cookies_init(void){   DEBUG_MSG(10, "Cookies: absolutely disabled at compilation time.\n");}#else#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 <time.h>       /* for time() and time_t */#include <ctype.h>#include "msg.h"#include "IO/Url.h"#include "misc.h"#include "list.h"#include "cookies.h"#include "capi.h"#include "dpiapi.h"#include "../dpip/dpip.h"/* The maximum length of a line in the cookie file */#define LINE_MAXLEN 4096typedef enum {   COOKIE_ACCEPT,   COOKIE_ACCEPT_SESSION,   COOKIE_DENY} CookieControlAction;typedef struct {   CookieControlAction action;   char *domain;} CookieControl;/* Variables for access control */static CookieControl *ccontrol = NULL;static int num_ccontrol = 0;static int num_ccontrol_max = 1;static CookieControlAction default_action = COOKIE_DENY;static gboolean disabled;static FILE *Cookies_fopen(const char *file, gchar *init_str);static CookieControlAction Cookies_control_check(const DilloUrl *url);static CookieControlAction Cookies_control_check_domain(const char *domain);static int Cookie_control_init(void);/* * Return a file pointer. If the file doesn't exist, try to create it, * with the optional 'init_str' as its content. */static FILE *Cookies_fopen(const char *filename, gchar *init_str){   FILE *F_in;   int fd;   if ((F_in = fopen(filename, "r")) == NULL) {      /* Create the file */      fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);      if (fd != -1) {         if (init_str)            write(fd, init_str, strlen(init_str));         close(fd);         DEBUG_MSG(10, "Cookies: Created file: %s\n", filename);         F_in = Cookies_fopen(filename, NULL);      } else {         DEBUG_MSG(10, "Cookies: Could not create file: %s!\n", filename);      }   }   /* set close on exec */   fcntl(fileno(F_in), F_SETFD, FD_CLOEXEC | fcntl(fileno(F_in), F_GETFD));   return F_in;}/* * Initialize the cookies module * (The 'disabled' variable is writable only within a_Cookies_init) */void a_Cookies_init(void){   /* Default setting */   disabled = TRUE;   /* Read and parse the cookie control file (cookiesrc) */   if (Cookie_control_init() != 0) {      DEBUG_MSG(10, "Disabling cookies.\n");      return;   }   DEBUG_MSG(10, "Enabling cookies as from cookiesrc...\n");   disabled = FALSE;}/* * Flush cookies to disk and free all the memory allocated. */void a_Cookies_freeall(){}/* * Set the value corresponding to the cookie string */void a_Cookies_set(GList *cookie_strings, const DilloUrl *set_url){   CookieControlAction action;   char *cmd, *path, numstr[16];   if (disabled)      return;   action = Cookies_control_check(set_url);   if (action == COOKIE_DENY) {      DEBUG_MSG(5, "Cookies: denied SET for %s\n", URL_HOST_(set_url));      return;   }   while (cookie_strings != NULL ) {      char *cookie_string = cookie_strings->data;      path = (char *) URL_PATH_(set_url);      g_snprintf(numstr, 16, "%d", URL_PORT(set_url));      cmd = a_Dpip_build_cmd("cmd=%s cookie=%s host=%s path=%s port=%s",                             "set_cookie", cookie_string, URL_HOST_(set_url),                            path ? path : "/", numstr);      DEBUG_MSG(5, "Cookies.c: a_Cookies_set \n\t \"%s\" \n",cmd );      a_Capi_dpi_send_cmd(NULL, NULL, cmd, "cookies", 1);      g_free(cmd);      cookie_strings = g_list_next(cookie_strings);   }}/* * Return a string that contains all relevant cookies as headers. */char *a_Cookies_get(const DilloUrl *request_url){   char *cmd, *path, *dpip_tag, *cookie, numstr[16];   CookieControlAction action;   cookie = g_strdup("");   if (disabled)      return cookie;   action = Cookies_control_check(request_url);   if (action == COOKIE_DENY) {      DEBUG_MSG(5, "Cookies: denied GET for %s\n", URL_HOST_(request_url));      return cookie;   }   path = (char *) URL_PATH_(request_url);   g_snprintf(numstr, 16, "%d", URL_PORT(request_url));   cmd = a_Dpip_build_cmd("cmd=%s scheme=%s host=%s path=%s port=%s",                          "get_cookie", URL_SCHEME(request_url),                         URL_HOST(request_url), path ? path : "/", numstr);   /* Get the answer from cookies.dpi */   dpip_tag = a_Dpi_send_blocking_cmd("cookies", cmd);   g_free(cmd);   if (dpip_tag != NULL) {      cookie = a_Dpip_get_attr(dpip_tag, strlen(dpip_tag), "cookie");      g_free(dpip_tag);   }   return cookie;}/* ------------------------------------------------------------- *                    Access control routines * ------------------------------------------------------------- *//* * Get the cookie control rules (from cookiesrc). * Return value: *   0 = Parsed OK, with cookies enabled *   1 = Parsed OK, with cookies disabled *   2 = Can't open the control file */static int Cookie_control_init(void){   CookieControl cc;   FILE *stream;   char *filename;   char line[LINE_MAXLEN];   char domain[LINE_MAXLEN];   char rule[LINE_MAXLEN];   int i, j;   gboolean enabled = FALSE;   /* Get a file pointer */   filename = a_Misc_prepend_user_home(".dillo/cookiesrc");   stream = Cookies_fopen(filename, "DEFAULT DENY\n");   g_free(filename);   if (!stream)      return 2;   /* Get all lines in the file */   while (!feof(stream)) {      line[0] = '\0';      fgets(line, LINE_MAXLEN, stream);      /* Remove leading and trailing whitespaces */      g_strstrip(line);      if (line[0] != '\0' && line[0] != '#') {         i = 0;         j = 0;         /* Get the domain */         while (!isspace(line[i]))            domain[j++] = line[i++];         domain[j] = '\0';         /* Skip past whitespaces */         i++;         while (isspace(line[i]))            i++;         /* Get the rule */         j = 0;         while (line[i] != '\0' && !isspace(line[i]))            rule[j++] = line[i++];         rule[j] = '\0';         if (g_strcasecmp(rule, "ACCEPT") == 0)            cc.action = COOKIE_ACCEPT;         else if (g_strcasecmp(rule, "ACCEPT_SESSION") == 0)            cc.action = COOKIE_ACCEPT_SESSION;         else if (g_strcasecmp(rule, "DENY") == 0)            cc.action = COOKIE_DENY;         else {            MSG("Cookies: rule '%s' for domain '%s' is not recognised.\n",                rule, domain);            continue;         }         cc.domain = g_strdup(domain);         if (g_strcasecmp(cc.domain, "DEFAULT") == 0) {            /* Set the default action */            default_action = cc.action;            g_free(cc.domain);         } else {            a_List_add(ccontrol, num_ccontrol, num_ccontrol_max);            ccontrol[num_ccontrol++] = cc;         }         if (cc.action != COOKIE_DENY)            enabled = TRUE;      }   }   fclose(stream);   return (enabled ? 0 : 1);}/* * Check the rules for an appropriate action for this domain */static CookieControlAction Cookies_control_check_domain(const char *domain){   int i, diff;   for (i = 0; i < num_ccontrol; i++) {      if (ccontrol[i].domain[0] == '.') {         diff = strlen(domain) - strlen(ccontrol[i].domain);         if (diff >= 0) {            if (g_strcasecmp(domain + diff, ccontrol[i].domain) != 0)               continue;         } else {            continue;         }      } else {         if (g_strcasecmp(domain, ccontrol[i].domain) != 0)            continue;      }      /* If we got here we have a match */      return( ccontrol[i].action );   }   return default_action;}/* * Same as the above except it takes an URL */static CookieControlAction Cookies_control_check(const DilloUrl *url){   return Cookies_control_check_domain(URL_HOST(url));}#endif /* !DISABLE_COOKIES */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线影院| 精品伦理精品一区| 日韩视频免费观看高清在线视频| 国产亚洲成aⅴ人片在线观看| 91丝袜美女网| 欧美一区二区三区小说| 亚洲欧美综合色| 日韩成人午夜电影| 色丁香久综合在线久综合在线观看| 成人一级视频在线观看| 欧美中文字幕久久| 欧美极品美女视频| 国产一区二区三区最好精华液| 亚洲高清久久久| 91在线国产福利| www国产亚洲精品久久麻豆| 亚洲午夜视频在线| 色综合天天做天天爱| 中国av一区二区三区| 日本亚洲欧美天堂免费| 欧美性色黄大片手机版| 中文字幕日本乱码精品影院| 美洲天堂一区二卡三卡四卡视频| 日本不卡不码高清免费观看| 欧美在线免费观看视频| 亚洲美女视频在线| 色综合中文字幕国产| 久久免费的精品国产v∧| 看片网站欧美日韩| 日韩欧美你懂的| 久久国产免费看| 欧美va亚洲va香蕉在线| 奇米色777欧美一区二区| 欧美精品在线一区二区| 亚洲成a人片在线不卡一二三区| 亚洲v日本v欧美v久久精品| 91视频一区二区| 亚洲美女在线一区| 91福利视频久久久久| 国产精品久久久99| 91免费在线视频观看| 亚洲欧美偷拍卡通变态| 欧美在线观看视频一区二区三区 | 7777精品久久久大香线蕉| 国产精品狼人久久影院观看方式| 亚洲妇熟xx妇色黄| 欧美精品v日韩精品v韩国精品v| 久久综合九色综合欧美亚洲| 国产精品一区一区三区| 久久久不卡影院| 国产一区不卡视频| 欧美激情一区二区三区全黄| www.视频一区| 亚洲国产综合视频在线观看| 欧美日高清视频| 国产一区日韩二区欧美三区| 国产精品久久久久久久久晋中| 日韩成人一区二区三区在线观看| 成人av在线播放网址| 亚洲人吸女人奶水| 欧美日韩一区 二区 三区 久久精品| 久久一日本道色综合| 成人一区二区三区视频| 亚洲国产中文字幕| 国产情人综合久久777777| 91蝌蚪国产九色| 麻豆久久久久久| 中文字幕一区免费在线观看| 在线观看一区日韩| 视频一区中文字幕国产| 国产偷国产偷亚洲高清人白洁| 日韩电影在线免费观看| 国产人妖乱国产精品人妖| 色呦呦日韩精品| 国产一区二区三区| 亚洲永久精品大片| 久久亚洲综合av| 欧美日韩国产中文| 成人av片在线观看| 大桥未久av一区二区三区中文| 欧美色窝79yyyycom| 国产乱码精品一区二区三区av | 国产精品资源在线| 亚洲图片欧美一区| 国产亚洲一二三区| 欧美天堂亚洲电影院在线播放| 亚洲丝袜精品丝袜在线| 6080亚洲精品一区二区| 99久久er热在这里只有精品15| 久久综合久久鬼色| 欧美四级电影在线观看| 懂色av一区二区在线播放| 舔着乳尖日韩一区| 亚洲视频小说图片| 中文字幕va一区二区三区| 欧美片网站yy| 91网站在线播放| 国产成人av一区二区| 日本va欧美va瓶| 亚洲午夜av在线| 亚洲精品第一国产综合野| 国产亚洲成av人在线观看导航| 成人免费观看视频| 精品一区二区三区免费观看 | 欧美在线制服丝袜| av福利精品导航| 成人精品鲁一区一区二区| 日本麻豆一区二区三区视频| 午夜精品久久久久久久99樱桃| 欧美高清精品3d| 欧美在线不卡视频| 99精品久久99久久久久| 岛国av在线一区| 成人国产免费视频| 成人激情免费电影网址| 国产成人啪午夜精品网站男同| 国产精品午夜春色av| www激情久久| 欧美激情一区在线| 国产欧美一区二区精品久导航| 91麻豆swag| 5858s免费视频成人| 欧美精品丝袜中出| 欧美狂野另类xxxxoooo| 日韩女优av电影| 精品1区2区在线观看| xnxx国产精品| 欧美国产欧美亚州国产日韩mv天天看完整| eeuss鲁片一区二区三区在线看| 一区二区高清在线| 亚洲成在线观看| 免费黄网站欧美| 国产激情视频一区二区三区欧美| 一区在线观看免费| 1024精品合集| 午夜精品福利在线| 日韩不卡一区二区三区| 精东粉嫩av免费一区二区三区| 亚洲另类一区二区| 五月婷婷激情综合| 伦理电影国产精品| 成人三级伦理片| 欧美吞精做爰啪啪高潮| 日韩视频在线一区二区| 中文一区一区三区高中清不卡| 欧美一区二区免费视频| 久久综合成人精品亚洲另类欧美| 欧美日韩中文字幕一区二区| 日韩视频一区二区三区在线播放 | 亚洲精品国久久99热| 亚洲精品你懂的| 人妖欧美一区二区| 国产91富婆露脸刺激对白| 91日韩在线专区| 日韩精品一区二区三区在线| 欧美激情一区二区三区四区| 亚洲电影一区二区| 国产精品 欧美精品| 欧美日韩三级视频| 国产女同互慰高潮91漫画| 亚洲亚洲精品在线观看| 国产精品综合一区二区| 欧美亚洲动漫精品| 欧美激情一区不卡| 日韩高清在线不卡| 色999日韩国产欧美一区二区| 成人av免费在线播放| 欧美人伦禁忌dvd放荡欲情| 国产日韩精品一区二区浪潮av| 欧美大肚乱孕交hd孕妇| 国产精品久久毛片av大全日韩| 国产精品丝袜黑色高跟| 日韩国产欧美三级| 91论坛在线播放| 久久久激情视频| 日韩精品久久久久久| 色综合久久久久综合99| 久久综合九色综合欧美亚洲| 亚洲第一在线综合网站| 欧美日韩三级视频| 成人欧美一区二区三区黑人麻豆 | 亚洲高清一区二区三区| 国产.欧美.日韩| 精品久久久三级丝袜| 亚洲免费观看高清完整版在线观看熊 | 91免费版在线看| 久久亚洲欧美国产精品乐播| 亚洲成人福利片| 97久久精品人人爽人人爽蜜臀 | 91麻豆精品国产91久久久使用方法| 欧美夫妻性生活| 亚洲综合一区二区| 不卡在线观看av| 久久五月婷婷丁香社区| 捆绑调教美女网站视频一区| 欧美一级欧美三级| 日韩高清不卡在线| 欧美日韩国产在线观看| 亚洲成在线观看| 在线成人免费视频|