]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add incoming IP to OnAcceptReady
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 8 Sep 2008 10:43:00 +0000 (10:43 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 8 Sep 2008 10:43:00 +0000 (10:43 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10467 e03df62e-2008-0410-955e-edbf42e46eb7

include/socket.h
src/listensocket.cpp

index 556ee1a9045a4495b868b88d22ac9426dd44cdcd..1f699dbd7ad6f06502470683ffa90edeade4919b 100644 (file)
@@ -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
index 7c679c1d3fe9b650dba2e6c6080f693943e35284..07ff2886ebe0aed57d63e65907e01914ca4d1fc5 100644 (file)
@@ -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);
 }