+ if (user->registered == REG_ALL)
+ {
+ ServerInstance->Users->QuitUser(user, "STARTTLS not allowed after client registration");
+ }
+ else
+ {
+ if (!user->GetIOHook())
+ {
+ user->WriteNumeric(670, "%s :STARTTLS successful, go ahead with TLS handshake", user->nick.c_str());
+ user->AddIOHook(Caller);
+ Caller->OnRawSocketAccept(user->GetFd(), user->GetIPString(), user->GetPort());
+ }
+ else
+ user->WriteNumeric(671, "%s :STARTTLS failure", user->nick.c_str());
+ }