Include client IP address and port in HTTP requests

fixes #11706
This commit is contained in:
Gunnar Beutner 2016-07-25 09:43:13 +02:00
parent 45dd027101
commit cdda3bad8c
3 changed files with 8 additions and 1 deletions

View File

@ -391,3 +391,8 @@ bool TlsStream::IsDataAvailable(void) const
return m_RecvQ->GetAvailableBytes() > 0;
}
Socket::Ptr TlsStream::GetSocket(void) const
{
return m_Socket;
}

View File

@ -51,6 +51,8 @@ public:
TlsStream(const Socket::Ptr& socket, const String& hostname, ConnectionRole role, const boost::shared_ptr<SSL_CTX>& sslContext = MakeSSLContext());
~TlsStream(void);
Socket::Ptr GetSocket(void) const;
boost::shared_ptr<X509> GetClientCertificate(void) const;
boost::shared_ptr<X509> GetPeerCertificate(void) const;

View File

@ -163,7 +163,7 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
Log(LogInformation, "HttpServerConnection")
<< "Request: " << request.RequestMethod << " " << requestUrl
<< " (" << (user ? user->GetName() : "<unauthenticated>") << ")";
<< " (from " << m_Stream->GetSocket()->GetPeerAddress() << ", user: " << (user ? user->GetName() : "<unauthenticated>") << ")";
HttpResponse response(m_Stream, request);