diff --git a/src/Cedar/DDNS.c b/src/Cedar/DDNS.c index a4436daf..88854b24 100644 --- a/src/Cedar/DDNS.c +++ b/src/Cedar/DDNS.c @@ -493,20 +493,6 @@ void DCThread(THREAD *thread, void *param) FreeInterruptManager(interrupt); } -// Command to update immediately -void DCUpdateNow(DDNS_CLIENT *c) -{ - // Validate arguments - if (c == NULL) - { - return; - } - - c->NextRegisterTick_IPv4 = c->NextRegisterTick_IPv6 = 0; - - Set(c->Event); -} - // Execution of registration UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace_v6) { @@ -526,9 +512,6 @@ UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace char current_azure_ip[MAX_SIZE]; INTERNET_SETTING t; UINT build = 0; - bool use_https = false; - bool use_vgs = false; - bool no_cert_verify = false; char add_header_name[64]; char add_header_value[64]; // Validate arguments @@ -652,33 +635,20 @@ UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace Format(url2, sizeof(url2), "%s?v=%I64u", url, Rand64()); Format(url3, sizeof(url3), url2, key_hash_str[2], key_hash_str[3]); - if (use_https == false) - { - ReplaceStr(url3, sizeof(url3), url3, "https://", "http://"); - } + ReplaceStr(url3, sizeof(url3), url3, "https://", "http://"); ReplaceStr(url3, sizeof(url3), url3, ".servers", ".open.servers"); + cert_hash = StrToBin(DDNS_CERT_HASH); - if (no_cert_verify == false) - { - cert_hash = StrToBin(DDNS_CERT_HASH); - } - - ret = NULL; - - - if (ret == NULL) - { - Debug("WpcCall: %s\n", url3); - ret = WpcCallEx2(url3, &t, DDNS_CONNECT_TIMEOUT, DDNS_COMM_TIMEOUT, "register", req, - NULL, NULL, ((cert_hash != NULL && ((cert_hash->Size % SHA1_SIZE) == 0)) ? cert_hash->Buf : NULL), - (cert_hash != NULL ? cert_hash->Size / SHA1_SIZE : 0), - NULL, DDNS_RPC_MAX_RECV_SIZE, - add_header_name, add_header_value, - DDNS_SNI_VER_STRING); - Debug("WpcCall Ret: %u\n", ret); - } + Debug("WpcCall: %s\n", url3); + ret = WpcCallEx2(url3, &t, DDNS_CONNECT_TIMEOUT, DDNS_COMM_TIMEOUT, "register", req, + NULL, NULL, ((cert_hash != NULL && ((cert_hash->Size % SHA1_SIZE) == 0)) ? cert_hash->Buf : NULL), + (cert_hash != NULL ? cert_hash->Size / SHA1_SIZE : 0), + NULL, DDNS_RPC_MAX_RECV_SIZE, + add_header_name, add_header_value, + DDNS_SNI_VER_STRING); + Debug("WpcCall Ret: %u\n", ret); FreeBuf(cert_hash); @@ -828,7 +798,6 @@ UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use URL_DATA data; BUF *recv; BUF *cert_hash = NULL; - bool no_cert_verify = false; // Validate arguments if (dst == NULL || c == NULL) { @@ -872,11 +841,7 @@ UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use return ERR_INTERNAL_ERROR; } - if (no_cert_verify == false) - { - cert_hash = StrToBin(DDNS_CERT_HASH); - } - + cert_hash = StrToBin(DDNS_CERT_HASH); StrCpy(data.SniString, sizeof(data.SniString), DDNS_SNI_VER_STRING); diff --git a/src/Cedar/DDNS.h b/src/Cedar/DDNS.h index f7138fca..42c15c53 100644 --- a/src/Cedar/DDNS.h +++ b/src/Cedar/DDNS.h @@ -237,7 +237,6 @@ void DCThread(THREAD *thread, void *param); UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace_v6); UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use_ssl, char *replace_v6); UINT DCGetMyIp(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, char *replace_v6); -void DCUpdateNow(DDNS_CLIENT *c); void DCGetStatus(DDNS_CLIENT *c, DDNS_CLIENT_STATUS *st); UINT DCChangeHostName(DDNS_CLIENT *c, char *hostname); void DCSetInternetSetting(DDNS_CLIENT *c, INTERNET_SETTING *t);