1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-06 07:44:57 +03:00

v4.08-9449-rtm

This commit is contained in:
dnobori
2014-06-08 16:40:44 +09:00
parent 719ee999d6
commit ea38eef377
285 changed files with 478 additions and 282 deletions

View File

@ -5135,17 +5135,21 @@ LABEL_TIMEOUT:
sock, sock_event, 0, false);
}
if (sock != NULL)
{
Disconnect(sock);
ReleaseSock(sock);
}
if (sock_event != NULL)
{
ReleaseSockEvent(sock_event);
}
if (sock != NULL)
{
if (ret == NULL)
{
Disconnect(sock);
}
ReleaseSock(sock);
}
return ret;
}
}
@ -14645,6 +14649,9 @@ void ConnectThreadForTcp(THREAD *thread, void *param)
if (sock != NULL && p->Tcp_TryStartSsl)
{
bool ssl_ret = false;
p->Tcp_InNegotiation = true;
// Attempt the SSL negotiation to take this opportunity
Lock(p->CancelLock);
{
@ -14702,6 +14709,7 @@ LABEL_CANCEL:
p->Ok = (p->Result_Tcp_Sock == NULL ? false : true);
p->FinishedTick = Tick64();
p->Finished = true;
p->Tcp_InNegotiation = false;
Set(p->FinishEvent);
}
@ -15031,7 +15039,11 @@ SOCK *ConnectEx3(char *hostname, UINT port, UINT timeout, bool *cancel_flag, cha
if (now >= tcp_giveup_tick)
{
// Result of the TCP is uncertain, but give up
break;
if (p1.Finished || p1.Tcp_InNegotiation == false)
{
// Break only when TCP SSL negotiation is not being processed
break;
}
}
}

View File

@ -880,6 +880,7 @@ struct CONNECT_TCP_RUDP_PARAM
bool Tcp_SslNoTls;
LOCK *CancelLock;
SOCK *CancelDisconnectSock;
bool Tcp_InNegotiation;
};
#define SSL_DEFAULT_CONNECT_TIMEOUT (15 * 1000) // SSL default timeout