This repository was archived by the owner on Apr 6, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
includes/cpp_redis/network Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,20 @@ set_target_properties(${PROJECT}
6565 PROPERTIES
6666 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /target" )
6767
68+ IF (CPP_REDIS_READ_SIZE)
69+ set_target_properties (${PROJECT}
70+ PROPERTIES
71+ COMPILE_DEFINITIONS "CPP_REDIS_READ_SIZE=${CPP_REDIS_READ_SIZE} " )
72+ ENDIF (CPP_REDIS_READ_SIZE)
73+
6874
6975###
7076# install
7177###
7278install (TARGETS ${PROJECT} DESTINATION lib)
7379install (DIRECTORY ${CPP_REDIS_INCLUDES} / DESTINATION include )
7480
81+
7582###
7683# examples
7784###
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ cmake .. # only library
2121cmake .. -DBUILD_TESTS=true # library and tests
2222cmake .. -DBUILD_EXAMPLES=true # library and examples
2323cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true # library, tests and examples
24+ cmake .. -DCPP_REDIS_READ_SIZE=4096 # Change the read size used to read data from sockets (default: 4096)
2425make -j
2526```
2627
Original file line number Diff line number Diff line change 1010#include " cpp_redis/network/io_service.hpp"
1111#include " cpp_redis/redis_error.hpp"
1212
13+ #ifndef CPP_REDIS_READ_SIZE
14+ # define CPP_REDIS_READ_SIZE 4096
15+ #endif /* CPP_REDIS_READ_SIZE */
16+
1317namespace cpp_redis {
1418
1519namespace network {
@@ -60,7 +64,7 @@ class tcp_client {
6064 std::atomic_bool m_is_connected;
6165
6266 // ! buffers
63- static const unsigned int READ_SIZE = 2048 ;
67+ static const unsigned int READ_SIZE = CPP_REDIS_READ_SIZE ;
6468 std::vector<char > m_read_buffer;
6569 std::vector<char > m_write_buffer;
6670
You can’t perform that action at this time.
0 commit comments