summaryrefslogtreecommitdiff
path: root/indra/llcorehttp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r--indra/llcorehttp/CMakeLists.txt64
-rw-r--r--indra/llcorehttp/bufferarray.cpp6
-rwxr-xr-xindra/llcorehttp/tests/test_llcorehttp_peer.py1
3 files changed, 21 insertions, 50 deletions
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index 6a301ad50d..87796abd3c 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -7,22 +7,13 @@ include(GoogleMock)
include(CURL)
include(OpenSSL)
include(NGHTTP2)
-include(ZLIB)
+include(ZLIBNG)
include(LLCoreHttp)
include(LLAddBuildTest)
-include(LLMessage)
include(LLCommon)
include(Tut)
include(bugsplat)
-include_directories (${CMAKE_CURRENT_SOURCE_DIR})
-
-include_directories(
- ${LLMESSAGE_INCLUDE_DIRS}
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLCOREHTTP_INCLUDE_DIRS}
- )
-
set(llcorehttp_SOURCE_FILES
bufferarray.cpp
bufferstream.cpp
@@ -80,8 +71,6 @@ set(llcorehttp_HEADER_FILES
_thread.h
)
-set_source_files_properties(${llcorehttp_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
if (DARWIN OR LINUX)
# Boost headers define unused members in condition_variable so...
set_source_files_properties(${llcorehttp_SOURCE_FILES}
@@ -92,14 +81,17 @@ list(APPEND llcorehttp_SOURCE_FILES ${llcorehttp_HEADER_FILES})
add_library (llcorehttp ${llcorehttp_SOURCE_FILES})
target_link_libraries(
- llcorehttp
- ${CURL_LIBRARIES}
- ${OPENSSL_LIBRARIES}
- ${CRYPTO_LIBRARIES}
- ${NGHTTP2_LIBRARIES}
- ${BOOST_THREAD_LIBRARY}
- ${BOOST_SYSTEM_LIBRARY}
+ llcorehttp
+ llcommon
+ ll::libcurl
+ ll::openssl
+ ll::nghttp2
)
+target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+# llmessage depends on llcorehttp, yet llcorehttp also depends on llmessage (at least for includes).
+# Cannot/Should not use target_link_libraries here to add llmessage to the dependencies, as that would
+# lead to circular dependencies (or in case of cmake, the first project declaring it's dependencies wins)
+target_include_directories( llcorehttp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../llmessage)
# tests
set(LLCOREHTTP_TESTS ON CACHE BOOL
@@ -119,26 +111,15 @@ if (LL_TESTS AND LLCOREHTTP_TESTS)
tests/test_bufferstream.hpp
)
- set_source_files_properties(${llcorehttp_TEST_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
-
list(APPEND llcorehttp_TEST_SOURCE_FILES ${llcorehttp_TEST_HEADER_FILES})
# LL_ADD_PROJECT_UNIT_TESTS(llcorehttp "${llcorehttp_TEST_SOURCE_FILES}")
# set(TEST_DEBUG on)
set(test_libs
- ${LLCOREHTTP_LIBRARIES}
- ${WINDOWS_LIBRARIES}
- ${LLMESSAGE_LIBRARIES}
- ${LLCOMMON_LIBRARIES}
- ${GOOGLEMOCK_LIBRARIES}
- ${CURL_LIBRARIES}
- ${OPENSSL_LIBRARIES}
- ${CRYPTO_LIBRARIES}
- ${NGHTTP2_LIBRARIES}
- ${BOOST_THREAD_LIBRARY}
- ${BOOST_SYSTEM_LIBRARY}
+ llcorehttp
+ llmessage
+ llcommon
)
# If http_proxy is in the current environment (e.g. to fetch s3-proxy
@@ -155,7 +136,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS)
if (DARWIN)
# Path inside the app bundle where we'll need to copy libraries
set(LL_TEST_DESTINATION_DIR
- ${CMAKE_BINARY_DIR}/sharedlibs/Resources
+ ${CMAKE_BINARY_DIR}/sharedlibs/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,,../>Resources
)
# Create the Contents/Resources directory
@@ -200,18 +181,9 @@ endif (DARWIN)
)
set(example_libs
- ${LEGACY_STDIO_LIBS}
- ${LLCOREHTTP_LIBRARIES}
- ${WINDOWS_LIBRARIES}
- ${LLMESSAGE_LIBRARIES}
- ${LLCOMMON_LIBRARIES}
- ${GOOGLEMOCK_LIBRARIES}
- ${CURL_LIBRARIES}
- ${OPENSSL_LIBRARIES}
- ${CRYPTO_LIBRARIES}
- ${NGHTTP2_LIBRARIES}
- ${BOOST_THREAD_LIBRARY}
- ${BOOST_SYSTEM_LIBRARY}
+ llcorehttp
+ llmessage
+ llcommon
)
add_executable(http_texture_load
diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp
index e0b2876a00..8d2e7c6a63 100644
--- a/indra/llcorehttp/bufferarray.cpp
+++ b/indra/llcorehttp/bufferarray.cpp
@@ -196,7 +196,7 @@ size_t BufferArray::read(size_t pos, void * dst, size_t len)
return 0;
size_t result(0), offset(0);
- const int block_limit(mBlocks.size());
+ const auto block_limit(mBlocks.size());
int block_start(findBlock(pos, &offset));
if (block_start < 0)
return 0;
@@ -228,7 +228,7 @@ size_t BufferArray::write(size_t pos, const void * src, size_t len)
return 0;
size_t result(0), offset(0);
- const int block_limit(mBlocks.size());
+ const auto block_limit(mBlocks.size());
int block_start(findBlock(pos, &offset));
if (block_start >= 0)
@@ -288,7 +288,7 @@ int BufferArray::findBlock(size_t pos, size_t * ret_offset)
if (pos >= mLen)
return -1; // Doesn't exist
- const int block_limit(mBlocks.size());
+ const int block_limit(narrow(mBlocks.size()));
for (int i(0); i < block_limit; ++i)
{
if (pos < mBlocks[i]->mUsed)
diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py
index 778de90962..185e8e25c6 100755
--- a/indra/llcorehttp/tests/test_llcorehttp_peer.py
+++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py
@@ -38,7 +38,6 @@ from io import StringIO
from http.server import HTTPServer, BaseHTTPRequestHandler
-from llbase.fastest_elementtree import parse as xml_parse
from llbase import llsd
# we're in llcorehttp/tests ; testrunner.py is found in llmessage/tests