29 int wsp, pos, i, j, colon = 0;
32 if (!
h->inprogress.len)
return 1;
34 for (pos = 0; pos <
h->inprogress.len; ++pos) {
35 ch =
h->inprogress.s[pos];
36 if (ch ==
':') {colon = pos;
break; }
41 for (
a =
h->action;
a->name; ++
a) {
43 if (!case_diffb(
h->inprogress.s,j,
a->name)) {
44 if (!stralloc_copyb(&
verbose,
h->inprogress.s,colon + 2))
return 0;
49 for (; pos <
h->inprogress.len; ++pos) {
50 ch =
h->inprogress.s[pos];
51 if ((ch !=
' ') && (ch !=
'\t'))
break;
54 if (pos < h->inprogress.len) {
55 if (
h->inprogress.s[pos] ==
':') ++pos;
56 if (
h->inprogress.s[pos] ==
' ') ++pos;
65 if (!stralloc_cat(
a->copy,&
h->inprogress))
return 0;
69 for (i = pos; i <
h->inprogress.len; ++i) {
70 ch =
h->inprogress.s[i];
71 if (ch ==
'\r')
continue;
72 if (wsp && (ch ==
' ' || ch ==
'\t'))
continue;
73 wsp = (ch ==
' ' || ch ==
'\t') ? 1 : 0;
76 h->inprogress.s[j++] = ch;
80 h->inprogress.len = j;
81 if (!stralloc_0(&
h->inprogress))
return 0;
85 if (!stralloc_catb(
a->value,
verbose.s,colon + 2))
return 0;
86 for (i = 0; ch =
h->inprogress.s[i]; ++i) {
87 if (ch ==
'\n') ch = 0;
88 if (!stralloc_append(
a->value,&ch))
return 0;
90 if (!stralloc_append(
a->value,
"\n"))
return 0;
97 if (!stralloc_cat(
a->addr,&
addrlist))
return 0;
103 h->inprogress.len = 0;