diff options
Diffstat (limited to 'hittpd.c')
-rw-r--r-- | hittpd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hittpd.c b/hittpd.c index 2d47f29..5ac3a8d 100644 --- a/hittpd.c +++ b/hittpd.c @@ -726,10 +726,12 @@ finish_response(int i) client[i].events = POLLRDNORM; - // HTTP 1.0 needs to close connection by server - // XXX unless explicit keep-alive is set - if (parsers[i].http_major == 1 && parsers[i].http_minor == 0) + if (parsers[i].flags & F_CONNECTION_CLOSE) close_connection(i); + else if (parsers[i].flags & F_CONNECTION_KEEP_ALIVE) + ; + else if (parsers[i].http_major == 1 && parsers[i].http_minor == 0) + close_connection(i); // HTTP 1.0 default } void |