- if (!sock->GetHook())
- {
- sock->SendCapabilities();
- if (sock->GetLinkState() == CONNECTING)
- sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass, sock->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
- }
- else
- {
- if (sock->GetHook() && InspSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send())
- {
- InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
- sock->SendCapabilities();
- if (sock->GetLinkState() == CONNECTING)
- sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass, sock->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
- }
- else
- {
- Instance->Timers->AddTimer(new HandshakeTimer(Instance, sock, lnk, Utils));
- }
- }
+ CancelRepeat();
+ BufferedSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
+ sock->SendCapabilities();