25 #include <sys/types.h>
42 const char *
name = line;
43 char * value = memchr(line,
':', lend - line);
44 size_t nname = (value++) - name;
45 HttpMessage current = this->current;
51 for (; *value ==
' ' && value < lend; value++);
57 if (0 == strncasecmp(
"content-length", name, nname-1)) {
58 current->nbody = strtoul(value, NULL, 10);
59 if (0 < this->current->nbody) {
60 current->body =
memMalloc(current->nbody);
65 if (0 == strncasecmp(
"cookie", name, nname-1)) {
66 HttpRequest request = (HttpRequest)this->current;
68 ssize_t togo = lend - value;
70 while(NULL != pair && 0 < togo) {
76 for (; *key ==
' ' && key < lend; key++, togo--);
77 eqsign = memchr(key,
'=', togo);
83 togo -= (eqsign - key);
84 pair = memchr(eqsign,
';', togo);
91 val = (0 != nval)? eqsign+1 : NULL;
94 new(HashValue, key, eqsign-key, val, nval));
97 togo -= (pair - eqsign);
102 new(HttpHeader, name, nname, value, lend - value));
void * hashAdd(Hash, void *)