aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-03-31 11:10:00 +0000
committerGerrit Code Review <gerrit@fd.io>2020-03-31 11:10:00 +0000
commit23c3bb7400839b664096ad5e16a2346386109bda (patch)
treed1999acef9f91cd25db9b7c63fd2963cd7ba0e57 /libtransport
parentd46e59824bd3fc67abe7bd725965aa454942d640 (diff)
parent3718e549ee31ac764b327bbf3d6e51dd7e224b46 (diff)
Merge "[HICN-581] update hicn stack to support windows, again"
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/CMakeLists.txt8
-rw-r--r--libtransport/includes/hicn/transport/core/packet.h1
-rw-r--r--libtransport/src/core/prefix.cc3
-rw-r--r--libtransport/src/core/tcp_socket_connector.cc2
-rw-r--r--libtransport/src/core/udp_socket_connector.cc2
-rw-r--r--libtransport/src/http/response.cc14
6 files changed, 15 insertions, 15 deletions
diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt
index 973dbaf35..c431ace04 100644
--- a/libtransport/CMakeLists.txt
+++ b/libtransport/CMakeLists.txt
@@ -99,7 +99,11 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
find_package_wrapper(Libhicn REQUIRED)
else()
if (DISABLE_SHARED_LIBRARIES)
- set(HICN_LIBRARIES ${LIBHICN_STATIC} log)
+ if (WIN32)
+ set(HICN_LIBRARIES ${LIBHICN_STATIC})
+ else ()
+ set(HICN_LIBRARIES ${LIBHICN_STATIC} log)
+ endif ()
list(APPEND DEPENDENCIES
${LIBHICN_STATIC}
)
@@ -144,8 +148,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
find_package(OpenSSL REQUIRED)
endif ()
-message ("---------------------------> ${OPENSSL_LIBRARIES}")
-
list(APPEND LIBRARIES
${LIBPARC_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
diff --git a/libtransport/includes/hicn/transport/core/packet.h b/libtransport/includes/hicn/transport/core/packet.h
index 3ddc4a595..e58e7962d 100644
--- a/libtransport/includes/hicn/transport/core/packet.h
+++ b/libtransport/includes/hicn/transport/core/packet.h
@@ -257,7 +257,6 @@ class Packet : public std::enable_shared_from_this<Packet> {
utils::MemBuf *header_head_;
utils::MemBuf *payload_head_;
mutable Format format_;
-
static const core::Name base_name;
};
diff --git a/libtransport/src/core/prefix.cc b/libtransport/src/core/prefix.cc
index 59898ab70..30f780461 100644
--- a/libtransport/src/core/prefix.cc
+++ b/libtransport/src/core/prefix.cc
@@ -226,7 +226,7 @@ Name Prefix::getRandomName() const {
ip_prefix_.len;
size_t size = (size_t)ceil((float)addr_len / 8.0);
- uint8_t buffer[size];
+ uint8_t *buffer = (uint8_t *) malloc(sizeof(uint8_t) * size);
RAND_bytes(buffer, size);
@@ -237,6 +237,7 @@ Name Prefix::getRandomName() const {
name_ip_buffer[i] = buffer[j];
j++;
}
+ free(buffer);
return Name(ip_prefix_.family, (uint8_t *)&name_ip);
}
diff --git a/libtransport/src/core/tcp_socket_connector.cc b/libtransport/src/core/tcp_socket_connector.cc
index 58df8fb08..20b3d6ce6 100644
--- a/libtransport/src/core/tcp_socket_connector.cc
+++ b/libtransport/src/core/tcp_socket_connector.cc
@@ -15,7 +15,7 @@
#include <core/tcp_socket_connector.h>
#ifdef _WIN32
-#include <portability/win_portability.h>
+#include <hicn/transport/portability/win_portability.h>
#endif
#include <hicn/transport/errors/errors.h>
diff --git a/libtransport/src/core/udp_socket_connector.cc b/libtransport/src/core/udp_socket_connector.cc
index ec59c2e64..f5ddd6270 100644
--- a/libtransport/src/core/udp_socket_connector.cc
+++ b/libtransport/src/core/udp_socket_connector.cc
@@ -14,7 +14,7 @@
*/
#ifdef _WIN32
-#include <portability/win_portability.h>
+#include <hicn/transport/portability/win_portability.h>
#endif
#include <hicn/transport/errors/errors.h>
diff --git a/libtransport/src/http/response.cc b/libtransport/src/http/response.cc
index ba0acd1ac..409992835 100644
--- a/libtransport/src/http/response.cc
+++ b/libtransport/src/http/response.cc
@@ -16,8 +16,8 @@
#include <hicn/transport/errors/errors.h>
#include <hicn/transport/http/response.h>
-#include <experimental/algorithm>
-#include <experimental/functional>
+#include <algorithm>
+#include <functional>
#include <cstring>
@@ -62,11 +62,9 @@ std::size_t HTTPResponse::parseHeaders(const uint8_t *buffer, std::size_t size,
const char *crlf2 = "\r\n\r\n";
const char *begin = (const char *)buffer;
const char *end = begin + size;
- auto it =
- std::experimental::search(begin, end,
- std::experimental::make_boyer_moore_searcher(
- crlf2, crlf2 + strlen(crlf2)));
-
+ const char *begincrlf2 = (const char *)crlf2;
+ const char *endcrlf2 = begincrlf2 + strlen(crlf2);
+ auto it = std::search(begin, end, begincrlf2, endcrlf2);
if (it != end) {
std::stringstream ss;
ss.str(std::string(begin, it));
@@ -135,4 +133,4 @@ const std::string &HTTPResponse::getStatusString() const {
} // namespace http
-} // namespace transport \ No newline at end of file
+} // namespace transport