Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcfb1714

Browse files
committed
Finalized changes to std-ification.
1 parentd14bfe2 commitcfb1714

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

‎CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ else()
2424
endif()
2525
set(Boost_USE_MULTITHREADEDON)
2626
if(CPP-NETLIB_BUILD_TESTS)
27-
set(Boost_COMPONENTS unit_test_frameworksystemregex date_timethread chronofilesystem program_options )
27+
set(Boost_COMPONENTS unit_test_frameworksystemregex date_time filesystem program_options )
2828
else()
29-
set(Boost_COMPONENTSsystemregex date_timethread chronofilesystem program_options )
29+
set(Boost_COMPONENTSsystemregex date_time filesystem program_options )
3030
endif()
3131
find_package( Boost 1.51 REQUIRED${Boost_COMPONENTS} )
3232
find_package( OpenSSL )

‎include/network/include/http/server.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef NETWORK_INCLUDE_HTTP_SERVER_HPP_
1010
#defineNETWORK_INCLUDE_HTTP_SERVER_HPP_
1111

12-
#include<asio/io_service.hpp>
12+
#include<boost/asio/io_service.hpp>
1313
#include<network/protocol/http/server.hpp>
1414
#include<network/utils/thread_pool.hpp>
1515
#include<network/detail/debug.hpp>

‎include/network/protocol/http/client/macros.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#ifndef NETWORK_HTTP_BODY_CALLBACK
1414
#defineNETWORK_HTTP_BODY_CALLBACK(function_name, range_name, error_name) \
15-
voidfunction_name (boost::iterator_range<constchar*>const & range_name,asio::error_codeconst & error_name)
15+
voidfunction_name (boost::iterator_range<constchar*>const & range_name,boost::system::error_codeconst & error_name)
1616
#endif
1717

1818
#endif/* NETWORK_PROTOCOL_HTTP_CLIENT_MACROS_HPP_20110430*/

‎include/network/protocol/http/request/request.hpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#ifndef NETWORK_PROTOCOL_HTTP_REQUEST_REQUEST_HPP_20111021
88
#defineNETWORK_PROTOCOL_HTTP_REQUEST_REQUEST_HPP_20111021
99

10+
#ifndef NETWORK_DEFAULT_CHUNK_SIZE
11+
#defineNETWORK_DEFAULT_CHUNK_SIZE4096
12+
#endif// NETWORK_DEFAULT_CHUNK_SIZE
13+
1014
#include<network/protocol/http/request/request_base.hpp>
1115
#include<network/uri.hpp>
1216
#include<network/protocol/http/message/directives/major_version.hpp>

‎include/network/protocol/http/request/request.ipp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ void request::get_body(std::function<void(std::string::const_iterator, size_t)>
246246
chunk_reader(local_buffer.cbegin(), bytes_read);
247247
}
248248

249+
voidrequest::get_body(std::function<void(std::string::const_iterator,size_t)> chunk_reader)const {
250+
this->get_body(chunk_reader, NETWORK_DEFAULT_CHUNK_SIZE);
251+
}
252+
249253
// From request_base...
250254
// Setters
251255
voidrequest::set_method(std::stringconst & method) {

‎libs/network/example/CMakeLists.txt‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,17 @@ add_executable(hello_world_client http/hello_world_client.cpp)
2020
# add_executable(fileserver http/fileserver.cpp)
2121
#endif (UNIX)
2222
set(BOOST_CLIENT_LIBS
23-
${Boost_CHRONO_LIBRARY}
2423
${Boost_DATE_TIME_LIBRARY}
2524
${Boost_SYSTEM_LIBRARY}
2625
${Boost_FILESYSTEM_LIBRARY}
2726
${Boost_PROGRAM_OPTIONS_LIBRARY}
2827
${Boost_REGEX_LIBRARY}
29-
${Boost_THREAD_LIBRARY}
3028
)
3129
set(BOOST_SERVER_LIBS
32-
${Boost_CHRONO_LIBRARY}
3330
${Boost_DATE_TIME_LIBRARY}
3431
${Boost_SYSTEM_LIBRARY}
3532
${Boost_FILESYSTEM_LIBRARY}
3633
${Boost_PROGRAM_OPTIONS_LIBRARY}
37-
${Boost_THREAD_LIBRARY}
3834
)
3935

4036
target_link_libraries(uri_builder

‎libs/network/test/http/request_base_test.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(request_storage_flow) {
4545
staticchar data[] =
4646
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae ante sed nunc dapibus convallis in at neque. Vestibulum sed congue nunc. Sed tempus lorem non dui ultrices porttitor porta ligula venenatis. Sed a orci gravida tellus condimentum laoreet. Vivamus pulvinar, tortor eu adipiscing tempus, dolor urna tincidunt enim, id pretium eros ante quis dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In hac habitasse platea dictumst. Maecenas mattis metus.";
4747
simple.append(data,sizeof(data));
48-
char output[sizeof(data)];
48+
std::string output;
4949
size_t bytes_read = simple.read(output,0,sizeof(data));
5050
BOOST_CHECK_EQUAL(bytes_read,sizeof(data));
5151
std::string flattened;
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE(request_storage_copy) {
6060
request_testoriginal(64);
6161
staticchar quick_brown[] ="The quick brown fox jumps over the lazy dog.";
6262
original.append(quick_brown,sizeof(quick_brown));
63-
char output[sizeof(quick_brown)];
63+
std::string output;
6464
request_testcopy(original);
6565
size_t bytes_read = copy.read(output,0,sizeof(quick_brown));
6666
BOOST_CHECK_EQUAL(bytes_read,sizeof(quick_brown));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp