tokheaders.c - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
tokheaders.c (433B)
---
1 #include <u.h>
2 #include <libc.h>
3 #include <bin.h>
4 #include <httpd.h>
5
6 /*
7 * write initial part of successful header
8 */
9 void
10 hokheaders(HConnect *c)
11 {
12 Hio *hout;
13
14 hout = &c->hout;
15 hprint(hout, "%s 200 OK\r\n", hversion);
16 hprint(hout, "Server: Plan9\r\n");
17 hprint(hout, "Date: %D\r\n", time(nil));
18 if(c->head.closeit)
19 hprint(hout, "Connection: close\r\n");
20 else if(!http11(c))
21 hprint(hout, "Connection: Keep-Alive\r\n");
22 }