diff --git a/external/qhttpserver/src/qhttpserver.cpp b/external/qhttpserver/src/qhttpserver.cpp index 07e4a85..507645d 100755 --- a/external/qhttpserver/src/qhttpserver.cpp +++ b/external/qhttpserver/src/qhttpserver.cpp @@ -115,6 +115,7 @@ bool QHttpServer::listen(const QHostAddress &address, quint16 port) if (couldBindToPort) { connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); } else { + m_errorString = m_tcpServer->errorString(); delete m_tcpServer; m_tcpServer = NULL; } @@ -126,6 +127,11 @@ bool QHttpServer::listen(quint16 port) return listen(QHostAddress::Any, port); } +QString QHttpServer::errorString() const +{ + return m_errorString; +} + void QHttpServer::close() { if (m_tcpServer) diff --git a/external/qhttpserver/src/qhttpserver.h b/external/qhttpserver/src/qhttpserver.h index a3cb74b..4adb391 100755 --- a/external/qhttpserver/src/qhttpserver.h +++ b/external/qhttpserver/src/qhttpserver.h @@ -79,6 +79,9 @@ public: @sa listen(const QHostAddress&, quint16) */ bool listen(quint16 port); + /// Return the last error encountered. + QString errorString() const; + /// Stop the server and listening for new connections. void close(); signals: @@ -94,6 +97,7 @@ private slots: private: QTcpServer *m_tcpServer; + QString m_errorString; }; #endif