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

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

?? cookies.c

?? 著名的手機瀏覽器開源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
   /* The string may contain several cookies separated by comma.    * We'll iterate until we've catched them all */   while (*str) {      cookie = Cookies_parse_one(set_url, &str);      if (cookie) {         ret = g_slist_append(ret, cookie);      } else {         DEBUG_MSG(8, "Malformed cookie field, ignoring cookie: %s\n",                   cookie_string);         return NULL;      }   }   return ret;}/* * Compare cookies by name and path (return 0 if equal) */static gint Cookies_equals(gconstpointer a, gconstpointer b){   const CookieData_t *ca = a, *cb = b;   return (strcmp(ca->name, cb->name) || strcmp(ca->path, cb->path));}/* * Validate cookies domain against some security checks. */static gboolean Cookies_validate_domain(CookieData_t *cookie,                                        const DilloUrl *set_url){   const char *host;   int dots, diff, i;   gboolean is_ip;   /* Make sure that the path is set to something */   if (!cookie->path || cookie->path[0] != '/') {      g_free(cookie->path);      cookie->path = Cookies_strip_path(URL_PATH_(set_url));   }   /* If the server never set a domain, or set one without a leading    * dot (which isn't allowed), we use the calling URL's hostname. */   if (cookie->domain == NULL || cookie->domain[0] != '.') {      g_free(cookie->domain);      cookie->domain = g_strdup(URL_HOST(set_url));      return TRUE;   }   /* Count the number of dots and also find out if it is an IP-address */   is_ip = TRUE;   for (i = 0, dots = 0; cookie->domain[i] != '\0'; i++) {      if (cookie->domain[i] == '.')         dots++;      else if (!isdigit(cookie->domain[i]))         is_ip = FALSE;   }   /* A valid domain must have at least two dots in it */   /* NOTE: this breaks cookies on localhost... */   if (dots < 2) {      return FALSE;   }   /* Now see if the url matches the domain */   host = URL_HOST(set_url);   diff = strlen(host) - i;   if (diff > 0) {      if (g_strcasecmp(host + diff, cookie->domain))         return FALSE;      if (!is_ip) {         /* "x.y.test.com" is not allowed to set cookies for ".test.com";          *  only an url of the form "y.test.com" would be. */         while ( diff-- )            if (host[diff] == '.')               return FALSE;      }   }   return TRUE;}/* * Strip of the filename from a full path */static char *Cookies_strip_path(const char *path){   char *ret;   int len;   if (path) {      len = strlen(path);      while (len && path[len] != '/')         len--;      ret = g_strndup(path, len + 1);   } else {      ret = g_strdup("/");   }   return ret;}/* * Set the value corresponding to the cookie string */void a_Cookies_set(GList *cookie_strings, const DilloUrl *set_url){   CookieControlAction action;   GSList *list;   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;      list = Cookies_parse_string(set_url, cookie_string);      while (list) {         CookieData_t *cookie = list->data;         if (Cookies_validate_domain(cookie, set_url)) {            if (action == COOKIE_ACCEPT_SESSION)               cookie->session_only = TRUE;            Cookies_add_cookie(cookie);         } else {            DEBUG_MSG(5, "Rejecting cookie for %s from %s:\n",                      cookie->domain, URL_STR_(set_url));            Cookies_free_cookie(cookie);         }         list = g_slist_remove(list, list->data);      }      cookie_strings = g_list_next(cookie_strings);   }}/* * Compare the cookie with the supplied data to see if it matches */static gboolean Cookies_match(CookieData_t *cookie, const DilloUrl *url,                              const char *path, gboolean is_ssl){   /* Insecure cookies matches both secure and insecure urls, secure      cookies matches only secure urls */   if (cookie->secure && !is_ssl)      return FALSE;   /* Check that the cookie path is a subpath of the current path */   if (strncmp(cookie->path, path, strlen(cookie->path)) != 0)      return FALSE;   /* Check if the port of the request URL matches any    * of those set in the cookie */   if (cookie->ports) {      GList *list;      int port = URL_PORT(url);      for (list = cookie->ports; list; list = g_list_next(list)) {         if (GPOINTER_TO_INT(list->data) == port)            return TRUE;      }      return FALSE;   }   /* It's a match */   return TRUE;}/* * Return a string that contains all relevant cookies as headers. */char *a_Cookies_get(const DilloUrl *request_url){   char *domain_string, *q, *str, *path;   CookieControlAction action;   CookieData_t *cookie;   GList *matching_cookies = NULL;   GList *domain_cookie;   gboolean is_ssl;   GString *cookie_gstring;   if (disabled)      return g_strdup("");   action = Cookies_control_check(request_url);   if (action == COOKIE_DENY) {      DEBUG_MSG(5, "Cookies: denied GET for %s\n", URL_HOST_(request_url));      return g_strdup("");   }   path = Cookies_strip_path(URL_PATH_(request_url));   /* Check if the protocol is secure or not */   is_ssl = (!g_strcasecmp(URL_SCHEME(request_url), "https"));   for (domain_string = (char *) URL_HOST(request_url);        domain_string != NULL && *domain_string;        domain_string = strchr(domain_string+1, '.')) {      domain_cookie = g_hash_table_lookup(cookies, domain_string);      while (domain_cookie) {         cookie = domain_cookie->data;         domain_cookie = g_list_next(domain_cookie);         /* Remove expired cookie. */         if (!cookie->session_only && cookie->expires_at < time(NULL)) {            Cookies_remove_cookie(cookie);            continue;         }         /* Check if the cookie matches the requesting URL */         if (Cookies_match(cookie, request_url, path, is_ssl))            matching_cookies = g_list_append(matching_cookies, cookie);      }   }   /* Found the cookies, now make the string */   cookie_gstring = g_string_new("");   if (matching_cookies != NULL) {      CookieData_t *first_cookie = matching_cookies->data;      g_string_sprintfa(cookie_gstring, "Cookie: ");      if (first_cookie->version != 0)         g_string_sprintfa(cookie_gstring, "$Version=\"%d\"; ",                           first_cookie->version);      while (matching_cookies) {         cookie = matching_cookies->data;         q = (cookie->version == 0 ? "" : "\"");         g_string_sprintfa(cookie_gstring,                           "%s=%s; $Path=%s%s%s; $Domain=%s%s%s",                           cookie->name, cookie->value,                           q, cookie->path, q, q, cookie->domain, q);         if (cookie->ports) {            char *ports_str = Cookies_build_ports_str(cookie);            g_string_sprintfa(cookie_gstring, "; $Port=%s", ports_str);            g_free(ports_str);         }         matching_cookies = g_list_next(matching_cookies);         g_string_append(cookie_gstring, matching_cookies ? "; " : "\r\n");      }      DEBUG_MSG(4, "Final cookie string: %s", cookie_gstring->str);   }   g_free(path);   str = cookie_gstring->str;   g_string_free(cookie_gstring, FALSE);   return str;}/* ------------------------------------------------------------- *                    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一区二区三区免费野_久草精品视频
中文久久乱码一区二区| 天天操天天综合网| 男男成人高潮片免费网站| 国产精品123| 在线播放欧美女士性生活| 国产日本欧洲亚洲| 六月丁香婷婷色狠狠久久| 色猫猫国产区一区二在线视频| 欧美一个色资源| 亚洲国产精品天堂| 91免费视频观看| 国产精品你懂的在线| 久久精品国产亚洲a| 欧美日韩视频一区二区| 亚洲免费三区一区二区| proumb性欧美在线观看| 久久婷婷国产综合国色天香| 日韩激情一区二区| 欧美人妇做爰xxxⅹ性高电影| 亚洲女女做受ⅹxx高潮| 99re66热这里只有精品3直播| 久久精品欧美一区二区三区不卡| 日本成人超碰在线观看| 欧美久久久影院| 亚洲综合色噜噜狠狠| 色94色欧美sute亚洲13| 中文字幕一区二区三区四区| 国产成人在线观看| 欧美国产精品一区二区| 国产成人自拍网| 国产欧美日韩亚州综合| 国产成人免费视频网站| 国产视频一区二区三区在线观看 | 久久久影院官网| 国产最新精品免费| 国产视频亚洲色图| 成人爱爱电影网址| 亚洲天堂免费看| 91麻豆精品秘密| 亚洲精品福利视频网站| 日本二三区不卡| 亚洲第一久久影院| 欧美一区二区三区四区五区| 日本欧美肥老太交大片| 久久亚洲免费视频| av在线播放一区二区三区| 国产精品国产精品国产专区不片| 9i看片成人免费高清| 最新国产の精品合集bt伙计| 欧美在线视频全部完| 亚洲国产成人porn| 精品蜜桃在线看| eeuss鲁片一区二区三区| 一级精品视频在线观看宜春院| 欧美日韩一卡二卡三卡| 欧美欧美午夜aⅴ在线观看| 欧美日韩卡一卡二| 日日摸夜夜添夜夜添亚洲女人| 欧美日韩aaa| 激情六月婷婷久久| 亚洲国产电影在线观看| 日本韩国视频一区二区| 日韩成人免费电影| 国产视频一区在线播放| 欧美视频中文字幕| 国产乱码精品一区二区三区av| 亚洲欧美偷拍卡通变态| 日韩一区二区在线免费观看| 国产精品一品二品| 一区二区在线看| 精品国产乱码久久| 色综合天天在线| 久久99久久99精品免视看婷婷| 亚洲欧洲制服丝袜| 久久综合久久鬼色| 欧美日韩亚洲不卡| 丰满少妇久久久久久久| 午夜精品一区在线观看| 国产精品视频一二三| 日韩精品一区二区三区在线| 99久久99久久精品免费看蜜桃| 老司机一区二区| 亚洲一区在线观看网站| 中文字幕第一页久久| 日韩三级视频在线观看| 欧美亚洲尤物久久| 成人免费精品视频| 国产永久精品大片wwwapp| 日韩经典中文字幕一区| 有坂深雪av一区二区精品| 欧美一级精品大片| 欧美性高清videossexo| 99视频有精品| 国产超碰在线一区| 国产一区二区精品久久99| 日韩国产欧美三级| 亚洲高清三级视频| 一色屋精品亚洲香蕉网站| 国产亚洲精品aa午夜观看| 欧美成人官网二区| 日韩女优视频免费观看| 欧美精品视频www在线观看| 色老汉一区二区三区| a级高清视频欧美日韩| 国产福利视频一区二区三区| 另类人妖一区二区av| 麻豆精品在线播放| 理论片日本一区| 国内精品国产成人| 精品亚洲成av人在线观看| 日本中文字幕一区| 美女久久久精品| 国产一区三区三区| 国产成人在线电影| a级高清视频欧美日韩| 97成人超碰视| 欧美影院精品一区| 91精品视频网| 精品国产亚洲在线| 国产欧美一区二区三区沐欲| 国产精品视频一区二区三区不卡| 国产精品久久久久久久第一福利 | 国产精品久久久久影院色老大| 国产精品视频看| 亚洲免费资源在线播放| 亚洲午夜免费电影| 日韩电影免费在线| 国内精品免费**视频| 成人一区二区视频| 91在线精品一区二区三区| 欧美唯美清纯偷拍| 91精品国产入口| 亚洲精品一区二区三区香蕉| 久久久久综合网| 亚洲男人的天堂网| 免费在线观看不卡| 国v精品久久久网| 欧美三级三级三级爽爽爽| 欧美久久久久久久久中文字幕| 欧美成人a视频| 综合久久一区二区三区| 日本伊人午夜精品| 成人福利视频在线看| 在线视频一区二区三区| 91精品国产一区二区三区香蕉| 久久久欧美精品sm网站| 一区二区在线观看av| 免费高清视频精品| av一本久道久久综合久久鬼色| 欧美美女bb生活片| 国产欧美综合在线观看第十页| 亚洲综合视频在线| 国产精品夜夜嗨| 欧美另类久久久品| 国产精品久久久久精k8| 免费xxxx性欧美18vr| 99r精品视频| 精品成人一区二区三区| 亚洲美女屁股眼交3| 久久精品国内一区二区三区| 91在线免费看| 久久精品人人做人人爽97| 午夜精品久久久久久| www..com久久爱| 久久免费的精品国产v∧| 日韩精品一二三区| 色婷婷精品大视频在线蜜桃视频| 精品国产3级a| 午夜精品在线视频一区| 一本色道久久综合亚洲91| 久久亚洲二区三区| 麻豆免费精品视频| 91精品久久久久久久91蜜桃| 亚洲人成亚洲人成在线观看图片| 国产精品影视在线观看| 91精品国产高清一区二区三区 | 国产剧情av麻豆香蕉精品| 91在线免费看| 国产精品久久久久影院色老大| 国模冰冰炮一区二区| 欧美日韩国产综合一区二区三区| 中文字幕在线一区二区三区| 狠狠色2019综合网| 日韩女优电影在线观看| 日日夜夜精品视频天天综合网| 色婷婷av一区二区三区之一色屋| 国产女人18水真多18精品一级做| 韩国精品一区二区| 久久色.com| 国产麻豆91精品| 国产午夜精品一区二区| 国产精品中文字幕一区二区三区| 精品成人在线观看| 狠狠色丁香久久婷婷综合_中| 欧美本精品男人aⅴ天堂| 久88久久88久久久| 国产三级三级三级精品8ⅰ区| 国产一区二区精品久久99| 精品福利一区二区三区| 激情综合色综合久久综合|