vcpkg/ports/wt/0001-boost-1.66.patch

371 lines
13 KiB
Diff
Raw Normal View History

2018-02-23 19:36:35 +08:00
From a0fd67d85947c835cd55078edacf3c2ac84ca53f Mon Sep 17 00:00:00 2001
From: Robert Schumacher <roschuma@microsoft.com>
Date: Fri, 23 Feb 2018 03:12:00 -0800
Subject: [PATCH 1/3] boost 1.66
diff --git a/src/Wt/Http/Client.C b/src/Wt/Http/Client.C
index 85230d1..a2c893e 100644
--- a/src/Wt/Http/Client.C
+++ b/src/Wt/Http/Client.C
@@ -642,7 +642,7 @@ private:
protected:
asio::io_service& ioService_;
- asio::strand strand_;
+ asio::io_context::strand strand_;
tcp::resolver resolver_;
asio::streambuf requestBuf_;
asio::streambuf responseBuf_;
diff --git a/src/Wt/Http/Client.h b/src/Wt/Http/Client.h
index f3c7169..0f638e8 100644
--- a/src/Wt/Http/Client.h
+++ b/src/Wt/Http/Client.h
@@ -21,11 +21,7 @@
#include <string>
#ifdef WT_ASIO_IS_BOOST_ASIO
-namespace boost {
- namespace asio {
- class io_service;
- }
-}
+#include <boost/asio/io_service.hpp>
#else // WT_ASIO_IS_STANDALONE_ASIO
namespace asio {
class io_service;
diff --git a/src/http/Connection.C b/src/http/Connection.C
index cab7708..cca4e0a 100644
--- a/src/http/Connection.C
+++ b/src/http/Connection.C
@@ -78,7 +78,7 @@ void Connection::scheduleStop()
void Connection::start()
{
- LOG_DEBUG(socket().native() << ": start()");
+ LOG_DEBUG(socket().native_handle() << ": start()");
request_parser_.reset();
request_.reset();
@@ -106,7 +106,7 @@ void Connection::stop()
void Connection::setReadTimeout(int seconds)
{
if (seconds != 0) {
- LOG_DEBUG(socket().native() << " setting read timeout (ws: "
+ LOG_DEBUG(socket().native_handle() << " setting read timeout (ws: "
<< request_.webSocketVersion << ")");
state_ |= Reading;
@@ -118,7 +118,7 @@ void Connection::setReadTimeout(int seconds)
void Connection::setWriteTimeout(int seconds)
{
- LOG_DEBUG(socket().native() << " setting write timeout (ws: "
+ LOG_DEBUG(socket().native_handle() << " setting write timeout (ws: "
<< request_.webSocketVersion << ")");
state_ |= Writing;
@@ -129,7 +129,7 @@ void Connection::setWriteTimeout(int seconds)
void Connection::cancelReadTimer()
{
- LOG_DEBUG(socket().native() << " cancel read timeout");
+ LOG_DEBUG(socket().native_handle() << " cancel read timeout");
state_.clear(Reading);
readTimer_.cancel();
@@ -137,7 +137,7 @@ void Connection::cancelReadTimer()
void Connection::cancelWriteTimer()
{
- LOG_DEBUG(socket().native() << " cancel write timeout");
+ LOG_DEBUG(socket().native_handle() << " cancel write timeout");
state_.clear(Writing);
writeTimer_.cancel();
@@ -163,7 +163,7 @@ void Connection::handleReadRequest0()
#ifdef DEBUG
try {
- LOG_DEBUG(socket().native() << "incoming request: "
+ LOG_DEBUG(socket().native_handle() << "incoming request: "
<< socket().remote_endpoint().port() << " (avail= "
<< (rcv_buffer_size_ - (rcv_remaining_ - buffer.data())) << "): "
<< std::string(rcv_remaining_,
@@ -189,7 +189,7 @@ void Connection::handleReadRequest0()
if (doWebSockets)
request_.enableWebSocket();
- LOG_DEBUG(socket().native() << "request: " << status);
+ LOG_DEBUG(socket().native_handle() << "request: " << status);
if (status >= 300)
sendStockReply(status);
@@ -242,7 +242,7 @@ void Connection::sendStockReply(StockReply::status_type status)
void Connection::handleReadRequest(const Wt::AsioWrapper::error_code& e,
std::size_t bytes_transferred)
{
- LOG_DEBUG(socket().native() << ": handleReadRequest(): " << e.message());
+ LOG_DEBUG(socket().native_handle() << ": handleReadRequest(): " << e.message());
cancelReadTimer();
@@ -261,7 +261,7 @@ void Connection::close()
cancelReadTimer();
cancelWriteTimer();
- LOG_DEBUG(socket().native() << ": close()");
+ LOG_DEBUG(socket().native_handle() << ": close()");
ConnectionManager_.stop(shared_from_this());
}
@@ -274,7 +274,7 @@ bool Connection::closed() const
void Connection::handleError(const Wt::AsioWrapper::error_code& e)
{
- LOG_DEBUG(socket().native() << ": error: " << e.message());
+ LOG_DEBUG(socket().native_handle() << ": error: " << e.message());
close();
}
@@ -349,7 +349,7 @@ void Connection::handleReadBody0(ReplyPtr reply,
const Wt::AsioWrapper::error_code& e,
std::size_t bytes_transferred)
{
- LOG_DEBUG(socket().native() << ": handleReadBody0(): " << e.message());
+ LOG_DEBUG(socket().native_handle() << ": handleReadBody0(): " << e.message());
if (disconnectCallback_) {
if (e && e != asio::error::operation_aborted) {
@@ -357,7 +357,7 @@ void Connection::handleReadBody0(ReplyPtr reply,
disconnectCallback_ = boost::function<void()>();
f();
} else if (!e) {
- LOG_ERROR(socket().native()
+ LOG_ERROR(socket().native_handle()
<< ": handleReadBody(): while waiting for disconnect, "
"received unexpected data, closing");
close();
@@ -403,14 +403,14 @@ void Connection::startWriteResponse(ReplyPtr reply)
int size = asio::buffer_size(buffers[i]);
s += size;
#ifdef DEBUG_DUMP
- char *data = (char *)asio::detail::buffer_cast_helper(buffers[i]);
+ char *data = asio::buffer_cast<char*>(buffers[i]);
for (int j = 0; j < size; ++j)
std::cerr << data[j];
#endif
}
#endif
- LOG_DEBUG(socket().native() << " sending: " << s << "(buffers: "
+ LOG_DEBUG(socket().native_handle() << " sending: " << s << "(buffers: "
<< buffers.size() << ")");
if (!buffers.empty()) {
@@ -423,7 +423,7 @@ void Connection::startWriteResponse(ReplyPtr reply)
void Connection::handleWriteResponse(ReplyPtr reply)
{
- LOG_DEBUG(socket().native() << ": handleWriteResponse() " <<
+ LOG_DEBUG(socket().native_handle() << ": handleWriteResponse() " <<
haveResponse_ << " " << responseDone_);
if (haveResponse_)
startWriteResponse(reply);
@@ -458,7 +458,7 @@ void Connection::handleWriteResponse0(ReplyPtr reply,
const Wt::AsioWrapper::error_code& e,
std::size_t bytes_transferred)
{
- LOG_DEBUG(socket().native() << ": handleWriteResponse0(): "
+ LOG_DEBUG(socket().native_handle() << ": handleWriteResponse0(): "
<< bytes_transferred << " ; " << e.message());
cancelWriteTimer();
diff --git a/src/http/Connection.h b/src/http/Connection.h
index b0b71a3..bc0b6ed 100644
--- a/src/http/Connection.h
+++ b/src/http/Connection.h
@@ -61,7 +61,7 @@ public:
virtual ~Connection();
Server *server() const { return server_; }
- asio::strand& strand() { return strand_; }
+ asio::io_context::strand& strand() { return strand_; }
/// Stop all asynchronous operations associated with the connection.
void scheduleStop();
@@ -104,7 +104,7 @@ protected:
/// The manager for this connection.
ConnectionManager& ConnectionManager_;
- asio::strand strand_;
+ asio::io_context::strand strand_;
void finishReply();
diff --git a/src/http/Reply.C b/src/http/Reply.C
index 0d79e39..5e6c615 100644
--- a/src/http/Reply.C
+++ b/src/http/Reply.C
@@ -596,7 +596,7 @@ bool Reply::encodeNextContentBuffer(
originalSize += bs;
gzipStrm_.avail_in = bs;
- gzipStrm_.next_in = (unsigned char *)asio::detail::buffer_cast_helper(b);
+ gzipStrm_.next_in = (unsigned char *)b.data();
unsigned char out[16*1024];
do {
diff --git a/src/http/Server.h b/src/http/Server.h
index 3d3229a..373073f 100644
--- a/src/http/Server.h
+++ b/src/http/Server.h
@@ -129,7 +129,7 @@ private:
Wt::WLogger accessLogger_;
/// The strand for handleTcpAccept(), handleSslAccept() and handleStop()
- asio::strand accept_strand_;
+ asio::io_context::strand accept_strand_;
/// Acceptors used to listen for incoming http connections.
std::vector<TcpListener> tcp_listeners_;
diff --git a/src/http/SessionProcess.C b/src/http/SessionProcess.C
index 72d9a88..92320b0 100644
--- a/src/http/SessionProcess.C
+++ b/src/http/SessionProcess.C
@@ -80,7 +80,7 @@ void SessionProcess::asyncExec(const Configuration &config,
if (!ec)
acceptor_->listen(0, ec);
#ifndef WT_WIN32
- fcntl(acceptor_->native(), F_SETFD, FD_CLOEXEC);
+ fcntl(acceptor_->native_handle(), F_SETFD, FD_CLOEXEC);
#endif // !WT_WIN32
if (ec) {
LOG_ERROR("Couldn't create listening socket: " << ec.message());
diff --git a/src/http/SslConnection.C b/src/http/SslConnection.C
index 74c8642..2c34b53 100644
--- a/src/http/SslConnection.C
+++ b/src/http/SslConnection.C
@@ -81,9 +81,9 @@ void SslConnection::handleHandshake(const Wt::AsioWrapper::error_code& error)
void SslConnection::stop()
{
- LOG_DEBUG(socket().native() << ": stop()");
+ LOG_DEBUG(socket().native_handle() << ": stop()");
finishReply();
- LOG_DEBUG(socket().native() << ": SSL shutdown");
+ LOG_DEBUG(socket().native_handle() << ": SSL shutdown");
Connection::stop();
@@ -108,20 +108,20 @@ void SslConnection::stopNextLayer(const Wt::AsioWrapper::error_code& ec)
// In case of timeout, we will get here twice.
sslShutdownTimer_.cancel();
if (ec) {
- LOG_DEBUG(socket().native() << ": ssl_shutdown failed:"
+ LOG_DEBUG(socket().native_handle() << ": ssl_shutdown failed:"
<< ec.message());
}
try {
if (socket().is_open()) {
Wt::AsioWrapper::error_code ignored_ec;
- LOG_DEBUG(socket().native() << ": socket shutdown");
+ LOG_DEBUG(socket().native_handle() << ": socket shutdown");
socket().shutdown(asio::ip::tcp::socket::shutdown_both,
ignored_ec);
- LOG_DEBUG(socket().native() << "closing socket");
+ LOG_DEBUG(socket().native_handle() << "closing socket");
socket().close();
}
} catch (Wt::AsioWrapper::system_error& e) {
- LOG_DEBUG(socket().native() << ": error " << e.what());
+ LOG_DEBUG(socket().native_handle() << ": error " << e.what());
}
}
@@ -161,7 +161,7 @@ void SslConnection::startAsyncReadBody(ReplyPtr reply,
Buffer& buffer, int timeout)
{
if (state_ & Reading) {
- LOG_DEBUG(socket().native() << ": state_ = "
+ LOG_DEBUG(socket().native_handle() << ": state_ = "
<< (state_ & Reading ? "reading " : "")
<< (state_ & Writing ? "writing " : ""));
stop();
@@ -198,7 +198,7 @@ void SslConnection
int timeout)
{
if (state_ & Writing) {
- LOG_DEBUG(socket().native() << ": state_ = "
+ LOG_DEBUG(socket().native_handle() << ": state_ = "
<< (state_ & Reading ? "reading " : "")
<< (state_ & Writing ? "writing " : ""));
stop();
diff --git a/src/http/TcpConnection.C b/src/http/TcpConnection.C
index ad73164..4eaf83b 100644
--- a/src/http/TcpConnection.C
+++ b/src/http/TcpConnection.C
@@ -38,17 +38,17 @@ asio::ip::tcp::socket& TcpConnection::socket()
void TcpConnection::stop()
{
- LOG_DEBUG(socket().native() << ": stop()");
+ LOG_DEBUG(socket().native_handle() << ": stop()");
finishReply();
try {
Wt::AsioWrapper::error_code ignored_ec;
socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec);
- LOG_DEBUG(socket().native() << ": closing socket");
+ LOG_DEBUG(socket().native_handle() << ": closing socket");
socket_.close();
} catch (Wt::AsioWrapper::system_error& e) {
- LOG_DEBUG(socket().native() << ": error " << e.what());
+ LOG_DEBUG(socket().native_handle() << ": error " << e.what());
}
Connection::stop();
@@ -56,10 +56,10 @@ void TcpConnection::stop()
void TcpConnection::startAsyncReadRequest(Buffer& buffer, int timeout)
{
- LOG_DEBUG(socket().native() << ": startAsyncReadRequest");
+ LOG_DEBUG(socket().native_handle() << ": startAsyncReadRequest");
if (state_ & Reading) {
- LOG_DEBUG(socket().native() << ": state_ = "
+ LOG_DEBUG(socket().native_handle() << ": state_ = "
<< (state_ & Reading ? "reading " : "")
<< (state_ & Writing ? "writing " : ""));
stop();
@@ -81,10 +81,10 @@ void TcpConnection::startAsyncReadRequest(Buffer& buffer, int timeout)
void TcpConnection::startAsyncReadBody(ReplyPtr reply,
Buffer& buffer, int timeout)
{
- LOG_DEBUG(socket().native() << ": startAsyncReadBody");
+ LOG_DEBUG(socket().native_handle() << ": startAsyncReadBody");
if (state_ & Reading) {
- LOG_DEBUG(socket().native() << ": state_ = "
+ LOG_DEBUG(socket().native_handle() << ": state_ = "
<< (state_ & Reading ? "reading " : "")
<< (state_ & Writing ? "writing " : ""));
stop();
@@ -109,10 +109,10 @@ void TcpConnection::startAsyncWriteResponse
const std::vector<asio::const_buffer>& buffers,
int timeout)
{
- LOG_DEBUG(socket().native() << ": startAsyncWriteResponse");
+ LOG_DEBUG(socket().native_handle() << ": startAsyncWriteResponse");
if (state_ & Writing) {
- LOG_DEBUG(socket().native() << ": state_ = "
+ LOG_DEBUG(socket().native_handle() << ": state_ = "
<< (state_ & Reading ? "reading " : "")
<< (state_ & Writing ? "writing " : ""));
stop();
--
2.16.2.windows.1