diff options
Diffstat (limited to 'test_http_server.cc')
-rw-r--r-- | test_http_server.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test_http_server.cc b/test_http_server.cc index 4536f372..a2f1e052 100644 --- a/test_http_server.cc +++ b/test_http_server.cc @@ -189,7 +189,8 @@ ssize_t WriteHeaders(int fd, ret = WriteString(fd, string("HTTP/1.1 ") + Itoa(return_code) + " " + GetHttpResponseDescription(return_code) + - EOL "Content-Type: application/octet-stream" EOL); + EOL "Content-Type: application/octet-stream" EOL + "Connection: close" EOL); if (ret < 0) return -1; written += ret; @@ -406,6 +407,7 @@ void HandleRedirect(int fd, const HttpRequest& request) { if ((ret = WriteString(fd, "HTTP/1.1 " + Itoa(code) + " " + status + EOL)) < 0) return; + WriteString(fd, "Connection: close" EOL); WriteString(fd, "Location: " + url + EOL); } @@ -658,5 +660,4 @@ int main(int argc, char** argv) { LOG(FATAL) << "ERROR on accept"; HandleConnection(client_fd); } - return 0; } |