diff /n/sources/plan9/sys/src/libhttpd/parse.c /sys/src/libhttpd/parse.c
49a50
> static void mimeconttype(Hlex*, char*);
81a83
> {"content-type", mimeconttype},
259a262
> lex(h);
697a701,727
> }
>
> /*
> * if present, implise that a message body follows the headers
> * "content-type" ":" string
> * (used for distinguishing types of form POST content)
> */
> static void
> mimeconttype(Hlex *h, char *)
> {
> HFields *f;
>
> f = nil;
> for(;;){
> while(lex(h) != Word)
> if(h->tok != '/')
> goto conttype;
>
> f = hmkhfields(h->c, hstrdup(h->c, h->wordval), nil, f);
>
> if(lex(h) == ';')
> f->params = mimeparams(h);
> if(h->tok != '/')
> break;
> }
> conttype:;
> h->c->head.conttype = hrevhfields(f);
|