diff options
-rw-r--r-- | include/socket.h | 3 | ||||
-rw-r--r-- | src/listensocket.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/socket.h b/include/socket.h index 556ee1a90..1f699dbd7 100644 --- a/include/socket.h +++ b/include/socket.h @@ -210,8 +210,9 @@ class CoreExport ListenSocket : public EventHandler /** Called when a new connection has successfully been accepted on this listener. * @param ipconnectedto The IP address the connection arrived on * @param fd The file descriptor of the new connection + * @param incomingip The IP from which the connection was made */ - virtual void OnAcceptReady(const std::string &ipconnectedto, int fd); + virtual void OnAcceptReady(const std::string &ipconnectedto, int fd, const std::string &incomingip); }; //class CoreExport ListenSocketClient : public ListenSocket diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 7c679c1d3..07ff2886e 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -148,7 +148,7 @@ void ListenSocket::AcceptInternal() ServerInstance->SE->NonBlocking(incomingSockfd); ServerInstance->stats->statsAccept++; - this->OnAcceptReady(target, incomingSockfd); + this->OnAcceptReady(target, incomingSockfd, buf); } void ListenSocket::HandleEvent(EventType e, int err) @@ -167,7 +167,7 @@ void ListenSocket::HandleEvent(EventType e, int err) } } -void ListenSocket::OnAcceptReady(const std::string &ipconnectedto, int nfd) +void ListenSocket::OnAcceptReady(const std::string &ipconnectedto, int nfd, const std::string &incomingip) { ServerInstance->Users->AddUser(ServerInstance, nfd, bind_port, false, this->family, client, ipconnectedto); } |