303 // output buffer |
303 // output buffer |
304 sbuf_t *out = sbuf_new(512); |
304 sbuf_t *out = sbuf_new(512); |
305 |
305 |
306 // add the http status line to the output buffer |
306 // add the http status line to the output buffer |
307 add_http_status_line(out, sn->pool, rq); |
307 add_http_status_line(out, sn->pool, rq); |
308 |
|
309 // add server header |
|
310 sbuf_write(out, "Server: webserver\r\n", 19); |
|
311 |
308 |
312 // add date header |
309 // add date header |
313 struct tm mtms; |
310 struct tm mtms; |
314 struct tm *mtm = system_gmtime(&rq->req_start, &mtms); |
311 struct tm *mtm = system_gmtime(&rq->req_start, &mtms); |
315 char date[HTTP_DATE_LEN + 1]; |
312 char date[HTTP_DATE_LEN + 1]; |
316 strftime(date, HTTP_DATE_LEN, HTTP_DATE_FMT, mtm); |
313 strftime(date, HTTP_DATE_LEN, HTTP_DATE_FMT, mtm); |
317 sbuf_write(out, "Date: ", 6); |
314 sbuf_write(out, "Date: ", 6); |
318 sbuf_write(out, date, strlen(date)); |
315 sbuf_write(out, date, strlen(date)); |
319 sbuf_write(out, "\r\n", 2); |
316 sbuf_write(out, "\r\n", 2); |
|
317 |
|
318 // add server header |
|
319 sbuf_write(out, "Server: webserver\r\n", 19); |
320 |
320 |
321 // check content length ans transfer encoding |
321 // check content length ans transfer encoding |
322 char *ctlen = pblock_findkeyval(pb_key_content_length, rq->srvhdrs); |
322 char *ctlen = pblock_findkeyval(pb_key_content_length, rq->srvhdrs); |
323 char *enc = pblock_findkeyval(pb_key_transfer_encoding, rq->srvhdrs); |
323 char *enc = pblock_findkeyval(pb_key_transfer_encoding, rq->srvhdrs); |
324 if(ctlen && enc) { |
324 if(ctlen && enc) { |