diff --git a/Extenders/agent_beacon/src_beacon/beacon/ConnectorHTTP.cpp b/Extenders/agent_beacon/src_beacon/beacon/ConnectorHTTP.cpp index 3a53d707..4c99378b 100644 --- a/Extenders/agent_beacon/src_beacon/beacon/ConnectorHTTP.cpp +++ b/Extenders/agent_beacon/src_beacon/beacon/ConnectorHTTP.cpp @@ -229,19 +229,17 @@ void ConnectorHTTP::SendData(BYTE* data, ULONG data_size) attempt++; if (!connected) { - if ( dwError == ERROR_INTERNET_CANNOT_CONNECT || dwError == ERROR_INTERNET_TIMEOUT ) { - if (this->hConnect) { - this->functions->InternetCloseHandle(this->hConnect); - this->hConnect = NULL; - } - if (this->hInternet) { - this->functions->InternetCloseHandle(this->hInternet); - this->hInternet = NULL; - } - - this->functions->InternetSetOptionA(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); - this->functions->InternetSetOptionA(NULL, INTERNET_OPTION_REFRESH, NULL, 0); + if (this->hConnect) { + this->functions->InternetCloseHandle(this->hConnect); + this->hConnect = NULL; } + if (this->hInternet) { + this->functions->InternetCloseHandle(this->hInternet); + this->hInternet = NULL; + } + + this->functions->InternetSetOptionA(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + this->functions->InternetSetOptionA(NULL, INTERNET_OPTION_REFRESH, NULL, 0); this->server_index = (this->server_index + 1) % this->server_count; } @@ -283,4 +281,4 @@ void ConnectorHTTP::CloseConnector() this->functions->InternetCloseHandle(this->hInternet); this->functions->InternetCloseHandle(this->hConnect); -} \ No newline at end of file +}