summaryrefslogtreecommitdiff
path: root/indra/llcorehttp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r--indra/llcorehttp/CMakeLists.txt30
-rw-r--r--indra/llcorehttp/_httpoprequest.cpp2
-rw-r--r--indra/llcorehttp/_thread.h4
-rw-r--r--indra/llcorehttp/httpcommon.h2
-rw-r--r--indra/llcorehttp/tests/llcorehttp_test.cpp (renamed from indra/llcorehttp/tests/all_test.cpp)4
-rw-r--r--indra/llcorehttp/tests/test_bufferarray.hpp3
-rw-r--r--indra/llcorehttp/tests/test_httpheaders.hpp2
-rw-r--r--indra/llcorehttp/tests/test_httpoperation.hpp2
-rw-r--r--indra/llcorehttp/tests/test_httprequest.hpp12
-rw-r--r--indra/llcorehttp/tests/test_httpstatus.hpp2
-rw-r--r--indra/llcorehttp/tests/test_refcounted.hpp2
11 files changed, 38 insertions, 27 deletions
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index e0d1817781..a950e9180c 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -73,23 +73,24 @@ target_link_libraries(
${CARES_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
+ ${BOOST_THREAD_LIBRARY}
)
# tests
-#if (LL_TESTS)
-if (LL_TESTS AND 0)
+if (LL_TESTS)
+#if (LL_TESTS AND 0)
SET(llcorehttp_TEST_SOURCE_FILES
- test_allocator.cpp
+ tests/test_allocator.cpp
)
set(llcorehttp_TEST_HEADER_FILS
- test_httpstatus.hpp
- test_refcounted.hpp
- test_httpoperation.hpp
- test_httprequest.hpp
- test_httprequestqueue.hpp
- test_httpheaders.hpp
- test_bufferarray.hpp
+ tests/test_httpstatus.hpp
+ tests/test_refcounted.hpp
+ tests/test_httpoperation.hpp
+ tests/test_httprequest.hpp
+ tests/test_httprequestqueue.hpp
+ tests/test_httpheaders.hpp
+ tests/test_bufferarray.hpp
)
set_source_files_properties(${llcorehttp_TEST_HEADER_FILES}
@@ -105,13 +106,16 @@ if (LL_TESTS AND 0)
${WINDOWS_LIBRARIES}
${LLCOMMON_LIBRARIES}
${GOOGLEMOCK_LIBRARIES}
+ ${CURL_LIBRARIES}
+ ${OPENSSL_LIBRARIES}
+ ${CRYPTO_LIBRARIES}
)
- LL_ADD_INTEGRATION_TEST(all
+ LL_ADD_INTEGRATION_TEST(llcorehttp
"${llcorehttp_TEST_SOURCE_FILES}"
"${test_libs}"
)
-#endif (LL_TESTS)
-endif (LL_TESTS AND 0)
+endif (LL_TESTS)
+#endif (LL_TESTS AND 0)
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 316df8bd49..3c9eb71b9a 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -259,6 +259,8 @@ HttpStatus HttpOpRequest::prepareForGet(HttpService * service)
HttpStatus status;
mCurlHandle = curl_easy_init();
+ curl_easy_setopt(mCurlHandle, CURLOPT_TIMEOUT, 30);
+ curl_easy_setopt(mCurlHandle, CURLOPT_CONNECTTIMEOUT, 30);
curl_easy_setopt(mCurlHandle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str());
diff --git a/indra/llcorehttp/_thread.h b/indra/llcorehttp/_thread.h
index 0937d698c7..46a333a749 100644
--- a/indra/llcorehttp/_thread.h
+++ b/indra/llcorehttp/_thread.h
@@ -27,9 +27,11 @@
#ifndef LLCOREINT_THREAD_H_
#define LLCOREINT_THREAD_H_
+#include <boost/thread.hpp>
+#include <boost/function.hpp>
-#include "_refcounted.h"
+#include "_refcounted.h"
namespace LLCoreInt
{
diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h
index cd7c09f097..5fc497e720 100644
--- a/indra/llcorehttp/httpcommon.h
+++ b/indra/llcorehttp/httpcommon.h
@@ -93,6 +93,8 @@
/// <TBD>
///
+#include "linden_common.h"
+
#include <string>
diff --git a/indra/llcorehttp/tests/all_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp
index 636f6f8c05..ad596d61cc 100644
--- a/indra/llcorehttp/tests/all_test.cpp
+++ b/indra/llcorehttp/tests/llcorehttp_test.cpp
@@ -1,5 +1,5 @@
/**
- * @file test_all
+ * @file llcorehttp_test
* @brief Main test runner
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
@@ -41,6 +41,7 @@
#include "test_bufferarray.hpp"
#include "test_httprequestqueue.hpp"
+#if 0
namespace tut
{
@@ -62,3 +63,4 @@ int main()
curl_global_cleanup();
}
+#endif
diff --git a/indra/llcorehttp/tests/test_bufferarray.hpp b/indra/llcorehttp/tests/test_bufferarray.hpp
index 4f5d0284a1..ecbb5ef250 100644
--- a/indra/llcorehttp/tests/test_bufferarray.hpp
+++ b/indra/llcorehttp/tests/test_bufferarray.hpp
@@ -26,7 +26,7 @@
#ifndef TEST_LLCORE_BUFFER_ARRAY_H_
#define TEST_LLCORE_BUFFER_ARRAY_H_
-#include <core-http/bufferarray.h>
+#include "bufferarray.h"
#include <iostream>
@@ -183,7 +183,6 @@ void BufferArrayTestObjectType::test<4>()
char str1[] = "abcdefghij";
size_t str1_len(strlen(str1));
char str2[] = "ABCDEFGHIJ";
- size_t str2_len(strlen(str2));
char buffer[256];
size_t len = ba->write(str1, str1_len);
diff --git a/indra/llcorehttp/tests/test_httpheaders.hpp b/indra/llcorehttp/tests/test_httpheaders.hpp
index d22b516691..ce0d19b058 100644
--- a/indra/llcorehttp/tests/test_httpheaders.hpp
+++ b/indra/llcorehttp/tests/test_httpheaders.hpp
@@ -26,7 +26,7 @@
#ifndef TEST_LLCORE_HTTP_HEADERS_H_
#define TEST_LLCORE_HTTP_HEADERS_H_
-#include <core-http/httpheaders.h>
+#include "httpheaders.h"
#include <iostream>
diff --git a/indra/llcorehttp/tests/test_httpoperation.hpp b/indra/llcorehttp/tests/test_httpoperation.hpp
index c9feaddb2a..6c3df1e9e3 100644
--- a/indra/llcorehttp/tests/test_httpoperation.hpp
+++ b/indra/llcorehttp/tests/test_httpoperation.hpp
@@ -27,7 +27,7 @@
#define TEST_LLCORE_HTTP_OPERATION_H_
#include "_httpoperation.h"
-#include <core-http/httphandler.h>
+#include "httphandler.h"
#include <iostream>
diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp
index df5640859f..ab25a2eb1a 100644
--- a/indra/llcorehttp/tests/test_httprequest.hpp
+++ b/indra/llcorehttp/tests/test_httprequest.hpp
@@ -26,11 +26,11 @@
#ifndef TEST_LLCORE_HTTP_REQUEST_H_
#define TEST_LLCORE_HTTP_REQUEST_H_
-#include <core-http/httprequest.h>
-#include <core-http/httphandler.h>
-#include <core-http/httpresponse.h>
-#include <core-http/_httpservice.h>
-#include <core-http/_httprequestqueue.h>
+#include "httprequest.h"
+#include "httphandler.h"
+#include "httpresponse.h"
+#include "_httpservice.h"
+#include "_httprequestqueue.h"
#include <curl/curl.h>
@@ -360,7 +360,7 @@ void HttpRequestTestObjectType::test<5>()
mStatus = HttpStatus(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_CONNECT);
HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID,
0.0f,
- "http://localhost:2/nothing/here",
+ "http://127.0.0.1:2/nothing/here",
0,
0,
NULL,
diff --git a/indra/llcorehttp/tests/test_httpstatus.hpp b/indra/llcorehttp/tests/test_httpstatus.hpp
index fa5803a17c..38bf494dec 100644
--- a/indra/llcorehttp/tests/test_httpstatus.hpp
+++ b/indra/llcorehttp/tests/test_httpstatus.hpp
@@ -27,7 +27,7 @@
#ifndef TEST_HTTP_STATUS_H_
#define TEST_HTTP_STATUS_H_
-#include <core-http/httpcommon.h>
+#include "httpcommon.h"
#include <curl/curl.h>
#include <curl/multi.h>
diff --git a/indra/llcorehttp/tests/test_refcounted.hpp b/indra/llcorehttp/tests/test_refcounted.hpp
index 6a17947288..cb4b50287a 100644
--- a/indra/llcorehttp/tests/test_refcounted.hpp
+++ b/indra/llcorehttp/tests/test_refcounted.hpp
@@ -26,7 +26,7 @@
#ifndef TEST_LLCOREINT_REF_COUNTED_H_
#define TEST_LLCOREINT_REF_COUNTED_H_
-#include <_refcounted.h>
+#include "_refcounted.h"
#include "test_allocator.h"