From c2e0ee9231a547b4f6fd65487a7102036a852ed6 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Fri, 29 Mar 2024 14:58:33 -0700 Subject: BUG-134040: Fix broken SOCKS5 proxy Second Life's SOCKS5 proxy has been broken on windows for at least six years due to a conflation of milliseconds and microseconds in the APR timeout value used when attempting to ping the proxy. --- indra/llmessage/llproxy.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp index 749e599c66..17f0d9f345 100644 --- a/indra/llmessage/llproxy.cpp +++ b/indra/llmessage/llproxy.cpp @@ -465,7 +465,7 @@ void LLProxy::applyProxySettings(CURL* handle) /** * @brief Send one TCP packet and receive one in return. * - * This operation is done synchronously with a 1000ms timeout. Therefore, it should not be used when a blocking + * This operation is done synchronously with a 100ms timeout. Therefore, it should not be used when a blocking * operation would impact the operation of the viewer. * * @param handle_ptr Pointer to a connected LLSocket of type STREAM_TCP. @@ -482,7 +482,7 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou apr_size_t expected_len = outlen; - handle->setBlocking(1000); + handle->setBlocking(100000); // 100ms, 100000us. Should be sufficient for localhost, nearby network rv = apr_socket_send(apr_socket, dataout, &outlen); if (APR_SUCCESS != rv) @@ -498,8 +498,6 @@ static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataou rv = -1; } - ms_sleep(1); - if (APR_SUCCESS == rv) { expected_len = maxinlen; -- cgit v1.2.3 From 57d423745fd1d3d0ea6a0c69b869a20c27e27fc5 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Fri, 5 Apr 2024 19:25:02 +0200 Subject: Linux viewer (ReleaseOS) resurrection (#1099) Co-authored-by: AiraYumi --- indra/llmessage/CMakeLists.txt | 3 --- indra/llmessage/llnamevalue.cpp | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index e44309476b..88ab29ec67 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -3,14 +3,11 @@ project(llmessage) include(00-Common) -include(GoogleMock) include(LLAddBuildTest) include(LLCommon) include(LLCoreHttp) include(LLAddBuildTest) include(Python) -include(Tut) -include(Python) include(JsonCpp) set(llmessage_SOURCE_FILES diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index c51883ee3d..15de4046ac 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -35,6 +35,10 @@ #include "llstring.h" #include "llstringtable.h" +#if LL_LINUX +#pragma GCC diagnostic ignored "-Wstringop-truncation" // It's actually okay what happens here +#endif + // Anonymous enumeration to provide constants in this file. // *NOTE: These values may be used in sscanf statements below as their // value-1, so search for '2047' if you cange NV_BUFFER_LEN or '63' if -- cgit v1.2.3 From 8f0c41c2e5d5c66df5e975b743140112494c4a7a Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Mon, 15 Apr 2024 22:59:16 +0200 Subject: Chore/pragma gcc cleansweep (#1226) * Remove all GCC warning suppression pragmas. * For Linux just just raise(SIGSEGV) as the crash driver. This has a much higher chance of the compiler understanding out intent and figuring out we end the program here. * Remove -Wno-stringop-overflow and -Wno-stringop-truncation from GCC_WARNINGS. After calling raise(SIGSEGV) as the crash driver I saw no issue with those warnings anymore After removing thoses GCC pragmas there is also no need for clang -Wno-unknown-warning-option anymore. * Remove CMakePresets from this PR. * Remove Lindens from comments :) --- indra/llmessage/llnamevalue.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index 15de4046ac..97b2d3aa5f 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -35,10 +35,6 @@ #include "llstring.h" #include "llstringtable.h" -#if LL_LINUX -#pragma GCC diagnostic ignored "-Wstringop-truncation" // It's actually okay what happens here -#endif - // Anonymous enumeration to provide constants in this file. // *NOTE: These values may be used in sscanf statements below as their // value-1, so search for '2047' if you cange NV_BUFFER_LEN or '63' if @@ -971,4 +967,3 @@ std::ostream& operator<<(std::ostream& s, const LLNameValue &a) } return s; } - -- cgit v1.2.3 From 1ebf006b73c06d037e3d3ae4393136082195096d Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Wed, 27 Mar 2024 19:51:59 -0400 Subject: Remove dead googlemock dependency and related setup code --- indra/llmessage/tests/llmockhttpclient.h | 66 -------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 indra/llmessage/tests/llmockhttpclient.h (limited to 'indra/llmessage') diff --git a/indra/llmessage/tests/llmockhttpclient.h b/indra/llmessage/tests/llmockhttpclient.h deleted file mode 100644 index 1611ab7bd8..0000000000 --- a/indra/llmessage/tests/llmockhttpclient.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * @brief - * - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -/* Macro Definitions */ -#ifndef LL_LLMOCKHTTPCLIENT_H -#define LL_LLMOCKHTTPCLIENT_H - -#include "linden_common.h" -#include "llhttpclientinterface.h" - -#include - -class LLMockHTTPClient : public LLHTTPClientInterface -{ -public: - MOCK_METHOD2(get, void(const std::string& url, LLCurl::ResponderPtr responder)); - MOCK_METHOD3(get, void(const std::string& url, LLCurl::ResponderPtr responder, const LLSD& headers)); - MOCK_METHOD3(put, void(const std::string& url, const LLSD& body, LLCurl::ResponderPtr responder)); -}; - -// A helper to match responder types -template -struct ResponderType -{ - bool operator()(LLCurl::ResponderPtr ptr) const - { - T* p = dynamic_cast(ptr.get()); - return p != NULL; - } -}; - -inline bool operator==(const LLSD& l, const LLSD& r) -{ - std::ostringstream ls, rs; - ls << l; - rs << r; - return ls.str() == rs.str(); - -} - - -#endif //LL_LLMOCKHTTPCLIENT_H - -- cgit v1.2.3 From 74205607b7e106f3b7566ef4a4b9c2fcdfa2f83e Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Fri, 13 Sep 2024 16:28:48 +0200 Subject: Clean up Windows build (#2562) * APR_DECLARE_STATIC and APU_DECLARE_STATIC gets already defined in APR.cmake * Move both _CRT_SECURE_NO_WARNINGS and _WINSOCK_DEPRECATED_NO_WARNINGS definitions to 00-Common.cmake * Always define WIN32_LEAN_AND_MEAN and include subset of Windows API by default * Remove llwin32headerslean.h and remove unnecessary WIN32_LEAN_AND_MEAN definition handling in llwin32headers.h * Clean up includes of Windows API headers * Get rid of workaround to link against IPHLPAPI.lib in lluuid.cpp - this seems to have been an issue in the past that has been fixed --- indra/llmessage/llhost.cpp | 3 +-- indra/llmessage/lliopipe.h | 2 +- indra/llmessage/lliosocket.h | 2 +- indra/llmessage/llmail.cpp | 1 - indra/llmessage/net.cpp | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index ace316512f..e7e3e27f58 100644 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -31,8 +31,7 @@ #include "llerror.h" #if LL_WINDOWS - #define WIN32_LEAN_AND_MEAN - #include + #include #else #include #include // ntonl() diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index 1887b5cd9a..b40539f38c 100644 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -30,7 +30,7 @@ #define LL_LLIOPIPE_H #include -#include "llwin32headerslean.h" +#include "llwin32headers.h" #include "apr_poll.h" #include "llsd.h" diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index 0a3f2617e6..4b79c77b56 100644 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -38,7 +38,7 @@ */ #include "lliopipe.h" -#include "llwin32headerslean.h" +#include "llwin32headers.h" #include "apr_pools.h" #include "apr_network_io.h" #include "llchainio.h" diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp index 9e10a356db..b842aeda62 100644 --- a/indra/llmessage/llmail.cpp +++ b/indra/llmessage/llmail.cpp @@ -28,7 +28,6 @@ #include "llmail.h" -// APR on Windows needs full windows headers #include "llwin32headers.h" #include #include diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp index 1c49f9be36..f153c938cf 100644 --- a/indra/llmessage/net.cpp +++ b/indra/llmessage/net.cpp @@ -32,7 +32,7 @@ #include #if LL_WINDOWS -#include "llwin32headerslean.h" +#include "llwin32headers.h" #else #include #include -- cgit v1.2.3