Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/Cedar
diff options
context:
space:
mode:
authorMykhaylo Yehorov <yehorov@gmail.com>2016-05-04 12:27:52 +0300
committerMykhaylo Yehorov <yehorov@gmail.com>2016-05-04 12:27:52 +0300
commit03ffd7535ac3ecb0b5985ab919ed3f50fa6aa7dd (patch)
treee7f8fb32a7c8325deffbdb012fed7b4c7b334949 /src/Cedar
parent698babf408789fc74a9ee5fbc693beff7ad01bef (diff)
parent1e17c9bcfd7e7b31756aa5389bcbff76c2c9c88a (diff)
merge upstream v4.21-9613-beta
Diffstat (limited to 'src/Cedar')
-rw-r--r--src/Cedar/Cedar.h12
-rw-r--r--src/Cedar/Command.c34
-rw-r--r--src/Cedar/Command.h1
-rw-r--r--src/Cedar/SM.c22
-rw-r--r--src/Cedar/WinUi.c59
5 files changed, 118 insertions, 10 deletions
diff --git a/src/Cedar/Cedar.h b/src/Cedar/Cedar.h
index ae21fc1d..23a94ffd 100644
--- a/src/Cedar/Cedar.h
+++ b/src/Cedar/Cedar.h
@@ -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)
diff --git a/src/Cedar/Command.c b/src/Cedar/Command.c
index 241bef37..80872d2f 100644
--- a/src/Cedar/Command.c
+++ b/src/Cedar/Command.c
@@ -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)
{
diff --git a/src/Cedar/Command.h b/src/Cedar/Command.h
index 61e55864..2ce75b89 100644
--- a/src/Cedar/Command.h
+++ b/src/Cedar/Command.h
@@ -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
};
diff --git a/src/Cedar/SM.c b/src/Cedar/SM.c
index 405ef509..a45213b4 100644
--- a/src/Cedar/SM.c
+++ b/src/Cedar/SM.c
@@ -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
diff --git a/src/Cedar/WinUi.c b/src/Cedar/WinUi.c
index 3c751a3e..c0d0d7a7 100644
--- a/src/Cedar/WinUi.c
+++ b/src/Cedar/WinUi.c
@@ -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));