nb: logging
Change-Id: Ia67f746a6c71b4753d04b92472eddf1614c0d337
This commit is contained in:
parent
57235943c0
commit
72669bf929
3 changed files with 9 additions and 6 deletions
|
@ -426,8 +426,8 @@ protected:
|
||||||
|
|
||||||
auto& log = Log::logger();
|
auto& log = Log::logger();
|
||||||
if (log.trace()) {
|
if (log.trace()) {
|
||||||
LOG_TRC("Incoming data buffer " << _inBuffer.size() <<
|
LOG_TRC("#" << getFD() << ": Incoming data buffer " << _inBuffer.size() <<
|
||||||
" closeSocket? " << _closed);
|
" bytes, closeSocket? " << closed);
|
||||||
log.dump("", &_inBuffer[0], _inBuffer.size());
|
log.dump("", &_inBuffer[0], _inBuffer.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,12 +507,12 @@ protected:
|
||||||
if (log.trace()) {
|
if (log.trace()) {
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
LOG_TRC("Wrote outgoing data " << len << " bytes");
|
LOG_TRC("#" << getFD() << ": Wrote outgoing data " << len << " bytes");
|
||||||
log.dump("", &_outBuffer[0], len);
|
log.dump("", &_outBuffer[0], len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG_SYS("Wrote outgoing data " << len << " bytes");
|
LOG_SYS("#" << getFD() << ": Wrote outgoing data " << len << " bytes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -569,7 +569,10 @@ namespace HttpHelper
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(path.c_str(), &st) != 0)
|
if (stat(path.c_str(), &st) != 0)
|
||||||
|
{
|
||||||
|
LOG_WRN("Failed to stat [" << path << "]. File will not be sent.");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "HTTP/1.1 200 OK\r\n"
|
oss << "HTTP/1.1 200 OK\r\n"
|
||||||
|
|
|
@ -307,7 +307,7 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, const
|
||||||
<< preprocess;
|
<< preprocess;
|
||||||
|
|
||||||
socket->send(oss.str());
|
socket->send(oss.str());
|
||||||
LOG_DBG("Sent file: " << path.toString());
|
LOG_DBG("Sent file: " << path.toString() << ": " << preprocess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
|
|
@ -2795,7 +2795,7 @@ private:
|
||||||
auto socket = _socket.lock();
|
auto socket = _socket.lock();
|
||||||
socket->send(oss.str());
|
socket->send(oss.str());
|
||||||
socket->shutdown();
|
socket->shutdown();
|
||||||
LOG_INF("Sent discovery.xml successfully.");
|
LOG_INF("Sent / response successfully.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleFaviconRequest(const Poco::Net::HTTPRequest& request)
|
void handleFaviconRequest(const Poco::Net::HTTPRequest& request)
|
||||||
|
|
Loading…
Reference in a new issue