-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing hurl with accept-encoding header. (#51)
* fixing hurl with accept-encoding header. * fixing hurl with accept-encoding header. * fixing hurl with accept-encoding header.
- Loading branch information
1 parent
473f13a
commit ca23bcc
Showing
6 changed files
with
106 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,2 @@ | ||
# ------------------------------------------------------------------------------ | ||
# wb_ai_cache | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_ai_cache.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_ai_cache ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_ai_cache | ||
compiled_catch | ||
${DEBUG_LIBRARIES} | ||
${CMAKE_BINARY_DIR}/src/core/libhurlcore.a | ||
${LIBRARIES} | ||
) | ||
SET_TARGET_PROPERTIES(wb_ai_cache PROPERTIES OUTPUT_NAME "wb_ai_cache") | ||
add_test(ai_cache wb_ai_cache) | ||
# ------------------------------------------------------------------------------ | ||
# wb_nresolver | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_nresolver.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_nresolver ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_nresolver | ||
compiled_catch | ||
${DEBUG_LIBRARIES} | ||
${CMAKE_BINARY_DIR}/src/core/libhurlcore.a | ||
${LIBRARIES} | ||
) | ||
SET_TARGET_PROPERTIES(wb_nresolver PROPERTIES OUTPUT_NAME "wb_nresolver") | ||
add_test(nresolver wb_nresolver) | ||
add_hurl_wb_test(ai_cache) | ||
add_hurl_wb_test(nresolver) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,2 @@ | ||
# ------------------------------------------------------------------------------ | ||
# wb_nconn_tcp | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_nconn_tcp.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_nconn_tcp ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_nconn_tcp compiled_catch ${DEBUG_LIBRARIES} ${CMAKE_BINARY_DIR}/src/core/libhurlcore.a ${LIBRARIES}) | ||
SET_TARGET_PROPERTIES(wb_nconn_tcp PROPERTIES OUTPUT_NAME "wb_nconn_tcp") | ||
add_test(nconn_tcp wb_nconn_tcp) | ||
# ------------------------------------------------------------------------------ | ||
# wb_nconn_tls | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_nconn_tls.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_nconn_tls ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_nconn_tls compiled_catch ${DEBUG_LIBRARIES} ${CMAKE_BINARY_DIR}/src/core/libhurlcore.a ${LIBRARIES}) | ||
SET_TARGET_PROPERTIES(wb_nconn_tls PROPERTIES OUTPUT_NAME "wb_nconn_tls") | ||
add_test(nconn_tls wb_nconn_tls) | ||
add_hurl_wb_test(nconn_tcp) | ||
add_hurl_wb_test(nconn_tls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,4 @@ | ||
# ------------------------------------------------------------------------------ | ||
# wb_nbq | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_nbq.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_nbq ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_nbq compiled_catch ${DEBUG_LIBRARIES} ${CMAKE_BINARY_DIR}/src/core/libhurlcore.a ${LIBRARIES}) | ||
SET_TARGET_PROPERTIES(wb_nbq PROPERTIES OUTPUT_NAME "wb_nbq") | ||
add_test(nbq wb_nbq) | ||
# ------------------------------------------------------------------------------ | ||
# wb_obj_pool | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_obj_pool.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_obj_pool ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_obj_pool compiled_catch ${DEBUG_LIBRARIES} ${CMAKE_BINARY_DIR}/src/core/libhurlcore.a ${LIBRARIES}) | ||
SET_TARGET_PROPERTIES(wb_obj_pool PROPERTIES OUTPUT_NAME "wb_obj_pool") | ||
add_test(obj_pool wb_obj_pool) | ||
# ------------------------------------------------------------------------------ | ||
# wb_nlru | ||
# ------------------------------------------------------------------------------ | ||
SET(SRCS wb_nlru.cc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/core) | ||
add_executable(wb_nlru ${HDRS} ${SRCS}) | ||
target_link_libraries(wb_nlru compiled_catch ${DEBUG_LIBRARIES} ${CMAKE_BINARY_DIR}/src/core/libhurlcore.a ${LIBRARIES}) | ||
SET_TARGET_PROPERTIES(wb_nlru PROPERTIES OUTPUT_NAME "wb_nlru") | ||
add_test(nlru wb_nlru) | ||
add_hurl_wb_test(nbq) | ||
add_hurl_wb_test(obj_pool) | ||
add_hurl_wb_test(nlru) | ||
add_hurl_wb_test(kv_map) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
//! ---------------------------------------------------------------------------- | ||
//! Copyright Edgio Inc. | ||
//! | ||
//! \file: TODO | ||
//! \details: TODO | ||
//! | ||
//! Licensed under the terms of the Apache 2.0 open source license. | ||
//! Please refer to the LICENSE file in the project root for the terms. | ||
//! ---------------------------------------------------------------------------- | ||
//! ---------------------------------------------------------------------------- | ||
//! includes | ||
//! ---------------------------------------------------------------------------- | ||
#include "status.h" | ||
#include "support/ndebug.h" | ||
#include "support/kv_map_list.h" | ||
#include "catch/catch.hpp" | ||
//! ---------------------------------------------------------------------------- | ||
//! append | ||
//! ---------------------------------------------------------------------------- | ||
static inline void _append(ns_hurl::kv_map_list_t& a_map, | ||
const std::string& a_key, | ||
const std::string& a_val) | ||
{ | ||
ns_hurl::kv_map_list_t::iterator i_obj = a_map.find(a_key); | ||
if (i_obj != a_map.end()) | ||
{ | ||
i_obj->second.push_back(a_val); | ||
return; | ||
} | ||
ns_hurl::str_list_t l_list; | ||
l_list.push_back(a_val); | ||
a_map[a_key] = l_list; | ||
return; | ||
} | ||
//! ---------------------------------------------------------------------------- | ||
//! append | ||
//! ---------------------------------------------------------------------------- | ||
static inline void _show(ns_hurl::kv_map_list_t& a_map) | ||
{ | ||
for(auto && i_k : a_map) | ||
{ | ||
NDBG_OUTPUT("%s: ", i_k.first.c_str()); | ||
for(auto && i_v : i_k.second) | ||
{ | ||
NDBG_OUTPUT("%s ", i_v.c_str()); | ||
} | ||
NDBG_OUTPUT("\n"); | ||
} | ||
} | ||
//! ---------------------------------------------------------------------------- | ||
//! Tests | ||
//! ---------------------------------------------------------------------------- | ||
TEST_CASE( "kv_map test", "[kv_map]" ) { | ||
SECTION("basic test") { | ||
ns_hurl::kv_map_list_t l_kvml; | ||
NDBG_PRINT("APPEND\n"); | ||
_append(l_kvml, "TEST", "TEST"); | ||
NDBG_PRINT("APPEND\n"); | ||
_append(l_kvml, "TEST-TEST", "TEST"); | ||
REQUIRE((l_kvml.size() == 2)); | ||
} | ||
} |