File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
boost/network/protocol/http Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,10 @@ namespace boost { namespace network { namespace http {
210
210
void handle_read_body_contents (boost::system::error_code const & ec, size_t bytes_to_read, size_t bytes_transferred) {
211
211
if (!ec) {
212
212
size_t difference = bytes_to_read - bytes_transferred;
213
- request_.body .append (buffer_.begin (), buffer_.end ());
213
+ array<char ,BOOST_HTTP_SERVER_BUFFER_SIZE>::iterator start = buffer_.begin (),
214
+ past_end = start;
215
+ std::advance (past_end, bytes_to_read);
216
+ request_.body .append (buffer_.begin (), past_end);
214
217
if (difference == 0 ) {
215
218
handler_ (request_, response_);
216
219
boost::asio::async_write (
@@ -246,6 +249,7 @@ namespace boost { namespace network { namespace http {
246
249
if (!ec) {
247
250
boost::system::error_code ignored_ec;
248
251
socket_.shutdown (tcp::socket::shutdown_both, ignored_ec);
252
+ socket_.close (ignored_ec);
249
253
}
250
254
}
251
255
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ namespace boost { namespace network { namespace http {
34
34
boost::network::uri::http::uri uri_;
35
35
36
36
public:
37
+ typedef Tag tag;
37
38
typedef typename string<Tag>::type string_type;
38
39
39
40
explicit basic_request (string_type const & uri_)
@@ -100,6 +101,7 @@ namespace boost { namespace network { namespace http {
100
101
*/
101
102
template <>
102
103
struct basic_request <tags::http_server> {
104
+ typedef tags::http_server tag;
103
105
typedef string<tags::http_server>::type string_type;
104
106
typedef vector<tags::http_server>::apply<request_header>::type vector_type;
105
107
string_type method;
You can’t perform that action at this time.
0 commit comments