- char ipaddr[MAXBUF];
-#ifdef IPV6
- if (socketfamily == AF_INET6)
- inet_ntop(AF_INET6, &((const sockaddr_in6*)ip)->sin6_addr, ipaddr, sizeof(ipaddr));
- else
-#endif
- inet_ntop(AF_INET, &((const sockaddr_in*)ip)->sin_addr, ipaddr, sizeof(ipaddr));
-
- New->SetFd(socket);
- New->SetSockAddr(socketfamily, ipaddr, port);
-
- /* Give each of the modules an attempt to hook the user for I/O */
- FOREACH_MOD_I(Instance, I_OnHookUserIO, OnHookUserIO(New, targetip));
-
- if (New->io)
- {
- try
- {
- New->io->OnRawSocketAccept(socket, ipaddr, port);
- }
- catch (CoreException& modexcept)
- {
- ServerInstance->Logs->Log("SOCKET", DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
- }
- }
+ // If this listener has an IO hook provider set then tell it about the connection
+ if (via->iohookprov)
+ via->iohookprov->OnAccept(eh, client, server);