From 93a09024ab433c866e87c5a6e33f982d7e8e32ab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Aug 2019 14:57:51 +0300 Subject: unified fake User-Agent field generation for all http-related protocols --- protocols/Omegle/src/communication.cpp | 2 +- protocols/Omegle/src/main.cpp | 22 ---------------------- protocols/Omegle/src/stdafx.h | 1 - 3 files changed, 1 insertion(+), 24 deletions(-) (limited to 'protocols/Omegle/src') diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index d8100fbabe..4a78b38615 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -267,7 +267,7 @@ NETLIBHTTPHEADER* Omegle_client::get_request_headers(int request_type, int* head } headers[2].szName = "User-Agent"; - headers[2].szValue = (char *)g_strUserAgent.c_str(); + headers[2].szValue = Netlib_GetUserAgent(); headers[1].szName = "Accept"; headers[1].szValue = "*/*"; headers[0].szName = "Accept-Language"; diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index 197a932188..1a520f222c 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -26,7 +26,6 @@ along with this program. If not, see . CMPlugin g_plugin; -std::string g_strUserAgent; DWORD g_mirandaVersion; ///////////////////////////////////////////////////////////////////////////////////////// @@ -61,26 +60,5 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC int CMPlugin::Load() { InitIcons(); - - // Init native User-Agent - { - std::stringstream agent; - agent << "Miranda NG/"; - agent << ((g_mirandaVersion >> 24) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion >> 16) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion >> 8) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion)& 0xFF); -#ifdef _WIN64 - agent << " Omegle Protocol x64/"; -#else - agent << " Omegle Protocol/"; -#endif - agent << __VERSION_STRING_DOTS; - g_strUserAgent = agent.str(); - } - return 0; } diff --git a/protocols/Omegle/src/stdafx.h b/protocols/Omegle/src/stdafx.h index 4ce85fe8a5..a768ac0efa 100644 --- a/protocols/Omegle/src/stdafx.h +++ b/protocols/Omegle/src/stdafx.h @@ -74,7 +74,6 @@ class OmegleProto; #include "theme.h" #include "resource.h" -extern std::string g_strUserAgent; extern DWORD g_mirandaVersion; class ScopedLock -- cgit v1.2.3