aboutsummaryrefslogtreecommitdiff
path: root/ports/wt/0001-boost-1.66.patch
blob: b11ffdb05633617efc990c2ddc4edfd5aa83058b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
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