Add peerAddress() method to QHttpSocket.

This commit is contained in:
Nathan Osman
2016-12-13 12:14:48 -08:00
parent 48967c398b
commit bde806b289
2 changed files with 11 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
#ifndef QHTTPENGINE_QHTTPSOCKET_H
#define QHTTPENGINE_QHTTPSOCKET_H
#include <QHostAddress>
#include <QMultiMap>
#include <QIODevice>
@@ -202,6 +203,11 @@ public:
*/
virtual void close();
/**
* @brief Retrive the address of the remote peer
*/
QHostAddress peerAddress() const;
/**
* @brief Determine if the request headers have been parsed yet
*/

View File

@@ -222,6 +222,11 @@ void QHttpSocket::close()
d->socket->close();
}
QHostAddress QHttpSocket::peerAddress() const
{
return d->socket->peerAddress();
}
bool QHttpSocket::isHeadersParsed() const
{
return d->readState > QHttpSocketPrivate::ReadHeaders;