File tree Expand file tree Collapse file tree 8 files changed +15
-6
lines changed
boost/network/protocol/http Expand file tree Collapse file tree 8 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 2.8)
7
7
project (CPP-NETLIB )
8
8
set (Boost_USE_STATIC_LIBS ON )
9
9
set (Boost_USE_MULTI_THREADED ON )
10
- find_package ( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread filesystem program_options )
10
+ find_package ( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread chrono filesystem program_options )
11
11
find_package ( OpenSSL )
12
12
find_package ( Threads )
13
13
set (CMAKE_VERBOSE_MAKEFILE true )
Original file line number Diff line number Diff line change @@ -151,9 +151,8 @@ namespace boost { namespace network { namespace http {
151
151
boost::copy (crlf, oi);
152
152
}
153
153
boost::copy (crlf, oi);
154
- boost::iterator_range<std::string::const_iterator> body_data =
155
- boost::network::body (request);
156
- return boost::copy (body_data, oi);
154
+ auto body_data = boost::network::body (request);
155
+ return std::copy (body_data.begin (), body_data.end (), oi);
157
156
}
158
157
159
158
} /* http */
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ client_connection * client_connection::clone() const {
22
22
BOOST_NETWORK_MESSAGE (" client_connection::clone()" );
23
23
// For exposition only.
24
24
BOOST_ASSERT (false && " This should not ever be called." );
25
+ return 0 ;
25
26
}
26
27
27
28
Original file line number Diff line number Diff line change 7
7
// (See accompanying file LICENSE_1_0.txt or copy at
8
8
// http://www.boost.org/LICENSE_1_0.txt)
9
9
10
+ #include < boost/optional.hpp>
10
11
#include < boost/network/protocol/http/response/response_base.hpp>
11
12
12
13
namespace boost { namespace network { namespace http {
Original file line number Diff line number Diff line change 8
8
// (See accompanying file LICENSE_1_0.txt or copy at
9
9
// http://www.boost.org/LICENSE_1_0.txt)
10
10
11
+ #include < boost/optional.hpp>
11
12
#include < boost/network/protocol/http/response/response_base.hpp>
12
13
13
14
namespace boost { namespace network { namespace http {
Original file line number Diff line number Diff line change 29
29
#include < boost/thread/locks.hpp>
30
30
#include < boost/thread/recursive_mutex.hpp>
31
31
#include < boost/utility/enable_if.hpp>
32
+ #include < boost/enable_shared_from_this.hpp>
32
33
#include < list>
33
34
#include < vector>
34
35
#include < iterator>
Original file line number Diff line number Diff line change @@ -282,7 +282,10 @@ class sync_server_connection : public boost::enable_shared_from_this<sync_server
282
282
<< constants::crlf ();
283
283
segmented_write (status_line.str ());
284
284
std::ostringstream header_stream;
285
- for (auto const &header : headers) {
285
+ auto it = std::begin (headers), end = std::end (headers);
286
+ for (; it != end; ++it) {
287
+ const auto &header = *it;
288
+ // for (auto const &header : headers) {
286
289
header_stream << header.first << constants::colon () << constants::space ()
287
290
<< header.second << constants::crlf ();
288
291
}
@@ -293,7 +296,7 @@ class sync_server_connection : public boost::enable_shared_from_this<sync_server
293
296
buffer_type buffer;
294
297
response_.get_body ([&done, &buffer](iterator_range<char const *> data) {
295
298
if (boost::empty (data)) done = true ;
296
- else std::copy (begin (data), end (data), buffer.begin ());
299
+ else std::copy (std:: begin (data), std:: end (data), buffer.begin ());
297
300
}, buffer.size ());
298
301
if (!done) output_buffers_.emplace_back (std::move (buffer));
299
302
}
Original file line number Diff line number Diff line change @@ -23,12 +23,15 @@ add_executable(hello_world_client http/hello_world_client.cpp)
23
23
set (BOOST_CLIENT_LIBS
24
24
${Boost_PROGRAM_OPTIONS_LIBRARY}
25
25
${Boost_THREAD_LIBRARY}
26
+ ${Boost_CHRONO_LIBRARY}
26
27
${Boost_DATE_TIME_LIBRARY}
27
28
${Boost_REGEX_LIBRARY}
29
+ ${Boost_FILESYSTEM_LIBRARY}
28
30
${Boost_SYSTEM_LIBRARY} )
29
31
30
32
set (BOOST_SERVER_LIBS
31
33
${Boost_THREAD_LIBRARY}
34
+ ${Boost_CHRONO_LIBRARY}
32
35
${Boost_SYSTEM_LIBRARY}
33
36
${Boost_DATE_TIME_LIBRARY}
34
37
${Boost_PROGRAM_OPTIONS_LIBRARY} )
You can’t perform that action at this time.
0 commit comments