mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Use helper function for logging messages
This commit is contained in:
parent
ec13bba4da
commit
dba711d099
8 changed files with 26 additions and 29 deletions
|
@ -79,7 +79,7 @@ void Connection::read()
|
|||
const long bufferLimit = RequestParser::MAX_CONTENT_SIZE * 1.1; // some margin for headers
|
||||
if (m_receivedData.size() > bufferLimit)
|
||||
{
|
||||
Logger::instance()->addMessage(tr("Http request size exceeds limitation, closing socket. Limit: %1, IP: %2")
|
||||
LogMsg(tr("Http request size exceeds limitation, closing socket. Limit: %1, IP: %2")
|
||||
.arg(bufferLimit).arg(m_socket->peerAddress().toString()), Log::WARNING);
|
||||
|
||||
Response resp(413, u"Payload Too Large"_qs);
|
||||
|
@ -93,7 +93,7 @@ void Connection::read()
|
|||
|
||||
case RequestParser::ParseStatus::BadRequest:
|
||||
{
|
||||
Logger::instance()->addMessage(tr("Bad Http request, closing socket. IP: %1")
|
||||
LogMsg(tr("Bad Http request, closing socket. IP: %1")
|
||||
.arg(m_socket->peerAddress().toString()), Log::WARNING);
|
||||
|
||||
Response resp(400, u"Bad Request"_qs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue