From 2b50326e97675f0fb2977b018b1ce9142dc6e58f Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 26 May 2020 09:53:36 +0800 Subject: [PATCH] HTTP: Close connection for HTTP static file server --- trunk/src/protocol/srs_http_stack.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trunk/src/protocol/srs_http_stack.cpp b/trunk/src/protocol/srs_http_stack.cpp index ad4f94168..93cda0fca 100644 --- a/trunk/src/protocol/srs_http_stack.cpp +++ b/trunk/src/protocol/srs_http_stack.cpp @@ -360,6 +360,10 @@ srs_error_t SrsHttpFileServer::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMes { srs_assert(entry); + // For each HTTP session, we use short-term HTTP connection. + SrsHttpHeader* hdr = w->header(); + hdr->set("Connection", "Close"); + string upath = r->path(); string fullpath = srs_http_fs_fullpath(dir, entry->pattern, upath);