plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

okheaders.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 }