diff --git a/httpserver/httpconnectionhandler.cpp b/httpserver/httpconnectionhandler.cpp index fc92311a2..d6046c260 100644 --- a/httpserver/httpconnectionhandler.cpp +++ b/httpserver/httpconnectionhandler.cpp @@ -97,7 +97,9 @@ void HttpConnectionHandler::createSocket() void HttpConnectionHandler::run() { +#ifdef SUPERVERBOSE qDebug("HttpConnectionHandler (%p): thread started", this); +#endif try { exec(); @@ -109,13 +111,17 @@ void HttpConnectionHandler::run() socket->close(); delete socket; readTimer.stop(); +#ifdef SUPERVERBOSE qDebug("HttpConnectionHandler (%p): thread stopped", this); +#endif } void HttpConnectionHandler::handleConnection(tSocketDescriptor socketDescriptor) { +#ifdef SUPERVERBOSE qDebug("HttpConnectionHandler (%p): handle new connection", this); +#endif busy = true; Q_ASSERT(socket->isOpen()==false); // if not, then the handler is already busy @@ -228,7 +234,11 @@ void HttpConnectionHandler::read() if (currentRequest->getStatus()==HttpRequest::complete) { readTimer.stop(); - qDebug("HttpConnectionHandler (%p): received request",this); + qDebug("HttpConnectionHandler (%p) received request from %s (%s) %s", + this, + qPrintable(currentRequest->getPeerAddress().toString()), + currentRequest->getMethod().toStdString().c_str(), + currentRequest->getPath().toStdString().c_str()); // Copy the Connection:close header to the response HttpResponse response(socket); @@ -266,7 +276,9 @@ void HttpConnectionHandler::read() response.write(QByteArray(),true); } +#ifdef SUPERVERBOSE qDebug("HttpConnectionHandler (%p): finished request",this); +#endif // Find out whether the connection must be closed if (!closeConnection)