• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/curl-7.23.1/source/lib/

Lines Matching refs:co

101 static void freecookie(struct Cookie *co)
103 if(co->expirestr)
104 free(co->expirestr);
105 if(co->domain)
106 free(co->domain);
107 if(co->path)
108 free(co->path);
109 if(co->name)
110 free(co->name);
111 if(co->value)
112 free(co->value);
113 if(co->maxage)
114 free(co->maxage);
115 if(co->version)
116 free(co->version);
118 free(co);
191 struct Cookie *co;
202 co = calloc(1, sizeof(struct Cookie));
203 if(!co)
214 free(co);
262 co->secure = TRUE;
264 co->httponly = TRUE;
272 strstore(&co->path, whatptr);
273 if(!co->path) {
326 strstore(&co->domain, tailptr); /* don't prefix w/dots
328 if(!co->domain) {
332 co->tailmatch=TRUE; /* we always do that if the domain name was
346 strstore(&co->version, whatptr);
347 if(!co->version) {
362 strstore(&co->maxage, whatptr);
363 if(!co->maxage) {
367 co->expires =
368 strtol((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0],NULL,10)
372 strstore(&co->expirestr, whatptr);
373 if(!co->expirestr) {
379 co->expires = curl_getdate(what, &now);
384 if(co->expires == 0)
385 co->expires = 1;
386 else if(co->expires < 0)
387 co->expires = 0;
389 else if(!co->name) {
390 co->name = strdup(name);
391 co->value = strdup(whatptr);
392 if(!co->name || !co->value) {
422 if(!badcookie && !co->domain) {
425 co->domain=strdup(domain);
426 if(!co->domain)
431 if(!badcookie && !co->path && path) {
446 co->path=malloc(pathlen+1); /* one extra for the zero byte */
447 if(co->path) {
448 memcpy(co->path, path, pathlen);
449 co->path[pathlen]=0; /* zero terminate */
458 if(badcookie || !co->name) {
461 freecookie(co);
483 co->httponly = TRUE;
488 free(co);
503 free(co);
515 co->domain = strdup(ptr);
516 if(!co->domain)
530 co->tailmatch = Curl_raw_equal(ptr, "TRUE")?TRUE:FALSE;
538 co->path = strdup(ptr);
539 if(!co->path)
544 co->path = strdup("/");
545 if(!co->path)
550 co->secure = Curl_raw_equal(ptr, "TRUE")?TRUE:FALSE;
553 co->expires = curlx_strtoofft(ptr, NULL, 10);
556 co->name = strdup(ptr);
557 if(!co->name)
561 co->value = strdup(ptr);
562 if(!co->value)
569 co->value = strdup("");
570 if(!co->value)
581 freecookie(co);
589 !co->expires) { /* this is a session cookie since it doesn't expire! */
590 freecookie(co);
594 co->livecookie = c->running;
603 if(Curl_raw_equal(clist->name, co->name)) {
606 if(clist->domain && co->domain) {
607 if(Curl_raw_equal(clist->domain, co->domain))
611 else if(!clist->domain && !co->domain)
617 if(clist->path && co->path) {
618 if(Curl_raw_equal(clist->path, co->path)) {
624 else if(!clist->path && !co->path)
631 if(replace_old && !co->livecookie && clist->livecookie) {
638 freecookie(co);
643 co->next = clist->next; /* get the next-pointer first */
661 *clist = *co; /* then store all the new data */
663 free(co); /* free the newly alloced memory */
664 co = clist; /* point to the previous struct instead */
683 replace_old?"Replaced":"Added", co->name, co->value,
684 co->domain, co->path, co->expires);
689 lastc->next = co;
691 c->cookies = co;
695 return co;
804 struct Cookie *co;
812 co = c->cookies;
814 while(co) {
818 if((!co->expires || (co->expires > now)) &&
819 (co->secure?secure:TRUE)) {
822 if(!co->domain ||
823 (co->tailmatch && tailmatch(co->domain, host)) ||
824 (!co->tailmatch && Curl_raw_equal(host, co->domain)) ) {
830 if(!co->path ||
833 !strncmp(co->path, path, strlen(co->path)) ) {
841 memcpy(newco, co, sizeof(struct Cookie));
855 co = mainco->next;
857 mainco = co;
865 co = co->next;
880 co = mainco;
882 for(i=0; co; co = co->next)
883 array[i++] = co;
928 void Curl_cookie_freelist(struct Cookie *co, bool cookiestoo)
931 if(co) {
932 while(co) {
933 next = co->next;
935 freecookie(co);
937 free(co); /* we only free the struct since the "members" are all just
939 co = next;
992 struct Cookie *co;
997 co = c->cookies;
999 while(co) {
1000 next = co->next;
1001 freecookie(co);
1002 co = next;
1014 static char *get_netscape_format(const struct Cookie *co)
1025 co->httponly?"#HttpOnly_":"",
1028 (co->tailmatch && co->domain && co->domain[0] != '.')? ".":"",
1029 co->domain?co->domain:"unknown",
1030 co->tailmatch?"TRUE":"FALSE",
1031 co->path?co->path:"/",
1032 co->secure?"TRUE":"FALSE",
1033 co->expires,
1034 co->name,
1035 co->value?co->value:"");
1048 struct Cookie *co;
1075 co = c->cookies;
1077 while(co) {
1078 format_ptr = get_netscape_format(co);
1087 co=co->next;