+
+ ModResult res;
+ FIRST_MOD_RESULT(OnAcceptConnection, res, (incomingSockfd, this, &client, &server));
+ if (res == MOD_RES_PASSTHRU)
+ {
+ std::string type = bind_tag->getString("type", "clients");
+ if (type == "clients")
+ {
+ ServerInstance->Users->AddUser(incomingSockfd, this, &client, &server);
+ res = MOD_RES_ALLOW;
+ }
+ }
+ if (res == MOD_RES_ALLOW)
+ {
+ ServerInstance->stats->statsAccept++;
+ }
+ else
+ {
+ ServerInstance->stats->statsRefused++;
+ ServerInstance->Logs->Log("SOCKET",DEFAULT,"Refusing connection on %s - %s",
+ bind_desc.c_str(), res == MOD_RES_DENY ? "Connection refused by module" : "Module for this port not found");
+ ServerInstance->SE->Close(incomingSockfd);
+ }