Mercurial > urweb
comparison src/c/urweb.c @ 476:c9566d49ecfe
Handle EError returning a function; handle multiple cookies in one input header
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 08 Nov 2008 12:12:50 -0500 |
parents | 70ee90105fce |
children | 5521bb0b4014 |
comparison
equal
deleted
inserted
replaced
475:9babc5d2ec5a | 476:c9566d49ecfe |
---|---|
1191 } | 1191 } |
1192 } | 1192 } |
1193 } | 1193 } |
1194 | 1194 |
1195 while (p = strchr(s, ':')) { | 1195 while (p = strchr(s, ':')) { |
1196 if (!strncasecmp(s, "Cookie: ", 8) && !strncmp(p + 2, c, len) | 1196 if (!strncasecmp(s, "Cookie: ", 8)) { |
1197 && p + 2 + len < ctx->headers_end && p[2 + len] == '=') { | 1197 p += 2; |
1198 return p + 3 + len; | 1198 while (1) { |
1199 if (!strncmp(p, c, len) | |
1200 && p + len < ctx->headers_end && p[len] == '=') | |
1201 return p + 1 + len; | |
1202 else if (p = strchr(p, ';')) | |
1203 p += 2; | |
1204 else if ((s = strchr(s, 0)) && s < ctx->headers_end) { | |
1205 s += 2; | |
1206 break; | |
1207 } | |
1208 else | |
1209 return NULL; | |
1210 } | |
1199 } else { | 1211 } else { |
1200 if ((s = strchr(p, 0)) && s < ctx->headers_end) | 1212 if ((s = strchr(p, 0)) && s < ctx->headers_end) |
1201 s += 2; | 1213 s += 2; |
1202 else | 1214 else |
1203 return NULL; | 1215 return NULL; |