1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 08:14:58 +03:00

v4.21-9613-beta

This commit is contained in:
dnobori
2016-04-24 23:49:31 +09:00
parent c0c1b914db
commit 1e17c9bcfd
40 changed files with 246 additions and 52 deletions

View File

@ -135,10 +135,10 @@
// Version number
#define CEDAR_VER 420
#define CEDAR_VER 421
// Build Number
#define CEDAR_BUILD 9608
#define CEDAR_BUILD 9613
// Beta number
//#define BETA_NUMBER 3
@ -159,10 +159,10 @@
// Specifies the build date
#define BUILD_DATE_Y 2016
#define BUILD_DATE_M 4
#define BUILD_DATE_D 17
#define BUILD_DATE_HO 20
#define BUILD_DATE_MI 58
#define BUILD_DATE_SE 26
#define BUILD_DATE_D 24
#define BUILD_DATE_HO 15
#define BUILD_DATE_MI 39
#define BUILD_DATE_SE 17
// Tolerable time difference
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)

View File

@ -1331,6 +1331,27 @@ void TtsWorkerThread(THREAD *thread, void *param)
{
ret = Recv(ts->Sock, recv_buf_data, buf_size, false);
}
if (ts->FirstSendTick == 0)
{
ts->FirstSendTick = now;
}
else
{
if (ts->FirstSendTick <= now)
{
if (ts->Span != 0)
{
UINT64 giveup_tick = ts->FirstSendTick + ts->Span * 3ULL + 180000ULL;
if (now > giveup_tick)
{
ret = 0;
}
}
}
}
break;
case 3:
@ -1757,6 +1778,7 @@ void TtcThread(THREAD *thread, void *param)
bool ok = false;
UINT buf_size;
UCHAR *send_buf_data, *recv_buf_data;
IP ip_ret;
// Validate arguments
if (thread == NULL || param == NULL)
{
@ -1786,10 +1808,13 @@ void TtcThread(THREAD *thread, void *param)
ok = true;
Zero(&ip_ret, sizeof(ip_ret));
for (i = 0;i < ttc->NumTcp;i++)
{
SOCK *s;
TTC_SOCK *ts = ZeroMalloc(sizeof(TTC_SOCK));
char target_host[MAX_SIZE];
ts->Id = i + 1;
@ -1806,7 +1831,14 @@ void TtcThread(THREAD *thread, void *param)
ts->Download = ((i % 2) == 0) ? true : false;
}
s = ConnectEx2(ttc->Host, ttc->Port, 0, ttc->Cancel);
StrCpy(target_host, sizeof(target_host), ttc->Host);
if (IsZeroIp(&ip_ret) == false)
{
IPToStr(target_host, sizeof(target_host), &ip_ret);
}
s = ConnectEx4(target_host, ttc->Port, 0, ttc->Cancel, NULL, NULL, false, false, true, &ip_ret);
if (s == NULL)
{

View File

@ -202,6 +202,7 @@ struct TTS_SOCK
UINT64 SessionId; // Session ID
bool NoMoreSendData; // Flag not to send more data
UINT64 FirstRecvTick; // Time which the data has been received last
UINT64 FirstSendTick; // Time which the data has been sent last
UINT64 Span; // Period
};

View File

@ -16557,6 +16557,11 @@ void SmSaveKeyPairDlgInit(HWND hWnd, SM_SAVE_KEY_PAIR *s)
Check(hWnd, R_X509_AND_KEY, true);
}
if (MsIsWine())
{
Disable(hWnd, R_SECURE);
}
SmSaveKeyPairDlgUpdate(hWnd, s);
}
@ -19350,8 +19355,13 @@ ENTER_PASSWORD:
Enable(hWnd, IDOK);
Enable(hWnd, B_ABOUT);
Enable(hWnd, IDCANCEL);
Enable(hWnd, B_SECURE_MANAGER);
Enable(hWnd, B_SELECT_SECURE);
if (MsIsWine() == false)
{
Enable(hWnd, B_SECURE_MANAGER);
Enable(hWnd, B_SELECT_SECURE);
}
Enable(hWnd, B_CERT_TOOL);
}
@ -20150,6 +20160,12 @@ void SmMainDlgInit(HWND hWnd)
DlgFont(hWnd, IDOK, 10, true);
if (MsIsWine())
{
Disable(hWnd, B_SECURE_MANAGER);
Disable(hWnd, B_SELECT_SECURE);
}
Focus(hWnd, L_SETTING);
SmMainDlgUpdate(hWnd);
@ -20479,6 +20495,8 @@ void SmMainDlg()
// Server Manager main process
void MainSM()
{
// MsgBoxEx(NULL, 0, L"MsIsWine: %u\n", MsIsWine());
if (sm->TempSetting == NULL)
{
// Open the main window

View File

@ -462,6 +462,10 @@ WINUI_UPDATE *InitUpdateUi(wchar_t *title, char *name, char *family_name, UINT64
{
return NULL;
}
if (MsIsWine())
{
return false;
}
if (IsEmptyStr(family_name))
{
family_name = UPDATE_FAMILY_NAME;
@ -3143,9 +3147,57 @@ void InitDialogInternational(HWND hWnd, void *pparam)
if (hControl != NULL)
{
bool set_font = true;
HFONT hFont = GetDialogDefaultFontEx(param && ((DIALOG_PARAM *)param)->meiryo);
SetFont(hControl, 0, hFont);
if (MsIsWine())
{
char classname[MAX_PATH];
char parent_classname[MAX_PATH];
HWND hParent = GetParent(hControl);
Zero(classname, sizeof(classname));
Zero(parent_classname, sizeof(parent_classname));
GetClassNameA(hControl, classname, sizeof(classname));
if (hParent != NULL)
{
GetClassNameA(hParent, parent_classname, sizeof(parent_classname));
}
if (StrCmpi(classname, "edit") == 0)
{
set_font = false;
}
if (StrCmpi(classname, "combobox") == 0)
{
set_font = false;
}
if (StrCmpi(classname, "syslistview32") == 0)
{
set_font = false;
}
if (StrCmpi(classname, "sysheader32") == 0)
{
set_font = false;
}
if (StrCmpi(parent_classname, "SysIPAddress32") == 0 ||
StrCmpi(classname, "SysIPAddress32") == 0)
{
set_font = true;
hFont = GetFont("Tahoma", 8, false, false, false, false);
}
}
if (set_font)
{
SetFont(hControl, 0, hFont);
}
if (MsIsVista())
{
@ -3727,6 +3779,11 @@ void AboutDlgInit(HWND hWnd, WINUI_ABOUT *a)
SetFont(hWnd, S_INFO3, GetFont("Arial", 7, false, false, false, false));
if (MsIsWine())
{
Disable(hWnd, B_LANGUAGE);
}
//DlgFont(hWnd, S_INFO4, 8, false);
SetShow(hWnd, B_UPDATE_CONFIG, (a->Update != NULL));