summaryrefslogtreecommitdiffstats
path: root/wsd/FileServer.cpp
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-06-03 16:06:10 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-06-03 18:15:33 +0200
commit714640993bb09f34cef97e878fd8e8b13ea4fb2b (patch)
tree44b130f2d4f04d690339866b0ca3f87103e1a180 /wsd/FileServer.cpp
parentlibfuzzer: fix build (diff)
downloadonline-714640993bb09f34cef97e878fd8e8b13ea4fb2b.tar.gz
online-714640993bb09f34cef97e878fd8e8b13ea4fb2b.zip
Remember to shutdown the socket after serving files.
re-factor to make it hard not to. Change-Id: I26ebc48b4660276ede64a22167ac4779cebf5cd4 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95440 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'wsd/FileServer.cpp')
-rw-r--r--wsd/FileServer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 1c47b0f8da..a298adb6c4 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -442,7 +442,7 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request,
// Useful to not serve from memory sometimes especially during loleaflet development
// Avoids having to restart loolwsd everytime you make a change in loleaflet
const std::string filePath = Poco::Path(LOOLWSD::FileServerRoot, relPath).absolute().toString();
- HttpHelper::sendFile(socket, filePath, mimeType, response, noCache);
+ HttpHelper::sendFileAndShutdown(socket, filePath, mimeType, &response, noCache);
return;
}
#endif
@@ -470,6 +470,7 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request,
(!gzip ? "un":"") << "compressed : file [" << relPath << "]: " << header);
socket->send(header);
socket->send(*content);
+ // shutdown by caller
}
}
catch (const Poco::Net::NotAuthenticatedException& exc)