Skip to content

Vs2015fixes #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boost/network/protocol/http/client/async_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct async_client
typedef typename resolver<Tag>::type resolver_type;
typedef typename string<Tag>::type string_type;

typedef std::function<void(boost::iterator_range<char const*> const&,
typedef std::function<void(boost::iterator_range<typename std::array<typename char_<Tag>::type, 1024>::const_iterator> const&,
boost::system::error_code const&)>
body_callback_function_type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct http_async_connection
this->destination_promise.set_exception(std::make_exception_ptr(error));
this->body_promise.set_exception(std::make_exception_ptr(error));
if ( callback )
callback( boost::iterator_range<const char*>(), ec );
callback( boost::iterator_range<typename std::array<typename char_<Tag>::type, 1024>::const_iterator>(), ec );
this->timer_.cancel();
}

Expand Down Expand Up @@ -321,7 +321,7 @@ struct http_async_connection
// body (in the case of a HEAD request).
this->body_promise.set_value("");
if ( callback )
callback( boost::iterator_range<const char*>(), boost::asio::error::eof );
callback( boost::iterator_range<typename std::array<typename char_<Tag>::type, 1024>::const_iterator>(), boost::asio::error::eof );
this->destination_promise.set_value("");
this->source_promise.set_value("");
// this->part.assign('\0');
Expand Down Expand Up @@ -392,7 +392,7 @@ struct http_async_connection
} else {
string_type body_string;
std::swap(body_string, this->partial_parsed);
body_string.append(this->part.begin(), bytes_transferred);
body_string.append(this->part.begin(), this->part.begin() + bytes_transferred);
if (this->is_chunk_encoding) {
this->body_promise.set_value(parse_chunk_encoding(body_string));
} else {
Expand Down Expand Up @@ -468,7 +468,7 @@ struct http_async_connection
this->body_promise.set_exception(std::make_exception_ptr(error));
}
else
callback( boost::iterator_range<const char*>(), report_code );
callback( boost::iterator_range<typename std::array<typename char_<Tag>::type, 1024>::const_iterator>(), report_code );
break;
default:
BOOST_ASSERT(false && "Bug, report this to the developers!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ struct http_async_protocol_handler {
void parse_body(Delegate& delegate_, Callback callback, size_t bytes) {
// TODO(dberris): we should really not use a string for the partial body
// buffer.
partial_parsed.append(part_begin, bytes);
partial_parsed.append(part_begin, part_begin + bytes);
part_begin = part.begin();
delegate_->read_some(
boost::asio::mutable_buffers_1(part.data(), part.size()), callback);
Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/client/facade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class basic_client_facade {
* body as it comes in. In case of errors, the second argument is an error
* code.
*/
typedef std::function<void(iterator_range<char const*> const&,
typedef std::function<void(iterator_range<typename std::array<typename char_<Tag>::type, 1024>::const_iterator> const&,
boost::system::error_code const&)>
body_callback_function_type;

Expand Down
4 changes: 3 additions & 1 deletion boost/network/protocol/http/client/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <array>
#include <boost/range/iterator_range.hpp>
#include <boost/network/traits/string.hpp>
#include <system_error>

#ifndef BOOST_NETWORK_HTTP_BODY_CALLBACK
#define BOOST_NETWORK_HTTP_BODY_CALLBACK(function_name, range_name, \
error_name) \
void function_name(boost::iterator_range<const char*> const& (range_name), \
void function_name(boost::iterator_range<typename std::array<std::string::traits_type::char_type, 1024>::const_iterator> const& (range_name), \
boost::system::error_code const& (error_name))
#endif

Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/policies/async_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct async_connection_policy : resolver_policy<Tag>::type {
typedef typename resolver_base::resolve_function resolve_function;
typedef typename resolver_base::resolve_completion_function
resolve_completion_function;
typedef std::function<void(iterator_range<char const*> const&,
typedef std::function<void(iterator_range<typename std::array<typename char_<Tag>::type, 1024>::const_iterator> const&,
boost::system::error_code const&)>
body_callback_function_type;
typedef std::function<bool(string_type&)> body_generator_function_type;
Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/server/async_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ struct async_connection
}
new_start = std::end(result_range);
auto self = this->shared_from_this();
thread_pool().post([this, self] { handler(request_, self); });
thread_pool().post([this, self] { this->handler(this->request_, self); });
return;
} else {
partial_parsed.append(std::begin(result_range),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void process_request(work_queue& queue) {
};

request->conn->set_status(server::connection::ok);
request->conn->set_header(headers);
request->conn->set_headers(headers);
request->conn->write("Hello, world!");
}

Expand Down