{
/* write status */
ensure(uh_http_sendf(cl, NULL,
- "HTTP/%.1f %03d %s\r\n",
+ "HTTP/%.1f %03d %s\r\n"
+ "Connection: close\r\n",
req->version, res->statuscode,
res->statusmsg));
static void uh_file_response_ok_hdrs(struct client *cl, struct http_request *req, struct stat *s)
{
+ uh_http_sendf(cl, NULL, "Connection: close\r\n");
+
if( s )
{
uh_http_sendf(cl, NULL, "ETag: %s\r\n", uh_file_mktag(s));
static void uh_file_response_412(struct client *cl, struct http_request *req)
{
- uh_http_sendf(cl, NULL, "HTTP/%.1f 412 Precondition Failed\r\n",
- req->version);
+ uh_http_sendf(cl, NULL,
+ "HTTP/%.1f 412 Precondition Failed\r\n"
+ "Connection: close\r\n", req->version);
}
static int uh_file_if_match(struct client *cl, struct http_request *req, struct stat *s)
len = snprintf(buffer, sizeof(buffer),
"HTTP/1.1 %03i %s\r\n"
+ "Connection: close\r\n"
"Content-Type: text/plain\r\n"
"Transfer-Encoding: chunked\r\n\r\n",
code, summary