[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-2' - wsd/FileServer.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Tue Jul 17 08:28:02 UTC 2018
wsd/FileServer.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit c7a4a463d6252ce7827299a0e9bdf6d78f81ad52
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Fri Feb 23 19:16:57 2018 -0500
wsd: warn for invalid file requests by clients instead of error
Also, logs append new-line automatically.
Change-Id: Ie5b09e454236cab2cdaa14d6f8be7b67e8fb1000
Reviewed-on: https://gerrit.libreoffice.org/52416
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 18750d2d39948e6fda38e2c9b8be15b375c896cb)
Reviewed-on: https://gerrit.libreoffice.org/57538
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index db02203a2..32717319e 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -421,7 +421,7 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request, Poco::M
}
catch (const Poco::FileNotFoundException& exc)
{
- LOG_ERR("FileServerRequestHandler: " << exc.displayText());
+ LOG_WRN("FileServerRequestHandler: " << exc.displayText());
// 404 not found
std::ostringstream oss;
@@ -440,7 +440,7 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
struct stat fileStat;
DIR *workingdir;
- LOG_TRC("Pre-reading directory: " << basePath << path << "\n");
+ LOG_TRC("Pre-reading directory: " << basePath << path);
workingdir = opendir((basePath + path).c_str());
while ((currentFile = readdir(workingdir)) != NULL)
@@ -456,7 +456,7 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
else if (S_ISREG(fileStat.st_mode))
{
- LOG_TRC("Reading file: '" << basePath << relPath << " as '" << relPath << "'\n");
+ LOG_TRC("Reading file: '" << basePath << relPath << " as '" << relPath << "'");
std::ifstream file(basePath + relPath, std::ios::binary);
@@ -471,7 +471,8 @@ void FileServerRequestHandler::readDirToHash(const std::string &basePath, const
compressedFile.reserve(fileStat.st_size);
std::string uncompressedFile;
uncompressedFile.reserve(fileStat.st_size);
- do {
+ do
+ {
file.read(&buf[0], fileStat.st_size);
const long unsigned int size = file.gcount();
if (size == 0)
@@ -573,7 +574,7 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
{
tokenTtl = std::stoul(accessTokenTtl);
}
- catch(const std::exception& exc)
+ catch (const std::exception& exc)
{
LOG_ERR("access_token_ttl must be represented as the number of milliseconds since January 1, 1970 UTC, when the token will expire");
}
More information about the Libreoffice-commits
mailing list