Plan 9 from Bell Labs’s /usr/web/sources/contrib/akumar/α/httpd/libhttpd.diff

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


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);

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].