httplistener.cpp   httplistener.cpp 
skipping to change at line 15 skipping to change at line 15
#include "httplistener.h" #include "httplistener.h"
#include "httpconnectionhandler.h" #include "httpconnectionhandler.h"
#include "httpconnectionhandlerpool.h" #include "httpconnectionhandlerpool.h"
#include <QCoreApplication> #include <QCoreApplication>
HttpListener::HttpListener(const HttpListenerSettings &settings, HttpReques tHandler* requestHandler, QObject *parent) HttpListener::HttpListener(const HttpListenerSettings &settings, HttpReques tHandler* requestHandler, QObject *parent)
: QTcpServer(parent) : QTcpServer(parent)
{ {
Q_ASSERT(requestHandler!=0); Q_ASSERT(requestHandler!=0);
pool=NULL; pool=Q_NULLPTR;
this->settings=settings; this->settings=settings;
this->requestHandler=requestHandler; this->requestHandler=requestHandler;
// Reqister type of socketDescriptor for signal/slot handling // Reqister type of socketDescriptor for signal/slot handling
qRegisterMetaType<tSocketDescriptor>("tSocketDescriptor"); qRegisterMetaType<tSocketDescriptor>("tSocketDescriptor");
// Start listening // Start listening
listen(); listen();
} }
HttpListener::~HttpListener() HttpListener::~HttpListener()
{ {
skipping to change at line 53 skipping to change at line 53
else { else {
qDebug("HttpListener: Listening on port %i",port); qDebug("HttpListener: Listening on port %i",port);
} }
} }
void HttpListener::close() { void HttpListener::close() {
QTcpServer::close(); QTcpServer::close();
qDebug("HttpListener: closed"); qDebug("HttpListener: closed");
if (pool) { if (pool) {
delete pool; delete pool;
pool=NULL; pool=Q_NULLPTR;
} }
} }
void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) { void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) {
#ifdef SUPERVERBOSE #ifdef SUPERVERBOSE
qDebug("HttpListener: New connection"); qDebug("HttpListener: New connection");
#endif #endif
HttpConnectionHandler* freeHandler=NULL; HttpConnectionHandler* freeHandler=Q_NULLPTR;
if (pool) if (pool)
{ {
freeHandler=pool->getConnectionHandler(); freeHandler=pool->getConnectionHandler();
} }
// Let the handler process the new connection. // Let the handler process the new connection.
if (freeHandler) if (freeHandler)
{ {
// The descriptor is passed via signal/slot because the handler liv es in another // The descriptor is passed via signal/slot because the handler liv es in another
// thread and cannot open the socket when directly called by anothe r thread. // thread and cannot open the socket when directly called by anothe r thread.
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/