Skip to content

Commit a8475a4

Browse files
committed
Adaptation for Asio from Boost-1.87.
1 parent 67a8102 commit a8475a4

File tree

15 files changed

+31
-23
lines changed

15 files changed

+31
-23
lines changed

dev/restinio/http_server_run.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,9 @@ template<typename Traits>
680680
inline void
681681
initiate_shutdown( http_server_t<Traits> & server )
682682
{
683-
server.io_context().post( [&server] {
683+
asio_ns::post(
684+
server.io_context(),
685+
[&server] {
684686
server.close_sync();
685687
server.io_context().stop();
686688
} );

dev/restinio/impl/acceptor.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class acceptor_t final
263263
ep = m_acceptor.local_endpoint();
264264

265265
// Now we can switch acceptor to listen state.
266-
m_acceptor.listen( asio_ns::socket_base::max_connections );
266+
m_acceptor.listen( asio_ns::socket_base::max_listen_connections );
267267

268268
// Call accept connections routine.
269269
for( std::size_t i = 0; i< this->concurrent_accept_sockets_count(); ++i )
@@ -620,7 +620,7 @@ class acceptor_t final
620620
else if( str_addr == "ip6-localhost" )
621621
str_addr = "::1";
622622

623-
result = asio_ns::ip::address::from_string( str_addr );
623+
result = asio_ns::ip::make_address( str_addr );
624624
}
625625
else if( auto * addr_v = std::get_if<asio_ns::ip::address>( &from ) )
626626
{

dev/restinio/impl/connection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ class connection_t final
11311131
m_logger.trace( [&]{
11321132
// Get status line:
11331133
const string_view_t status_line{
1134-
asio_ns::buffer_cast< const char * >(
1135-
next_write_group->first.items().front().buf() ),
1134+
static_cast< const char * >(
1135+
next_write_group->first.items().front().buf().data() ),
11361136
next_write_group->first.status_line_size() };
11371137

11381138
return fmt::format(

dev/test/basic_auth/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ auto
1616
make_dummy_endpoint()
1717
{
1818
return restinio::endpoint_t{
19-
restinio::asio_ns::ip::address::from_string("127.0.0.1"),
19+
restinio::asio_ns::ip::make_address("127.0.0.1"),
2020
12345u
2121
};
2222
}

dev/test/bearer_auth/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ auto
1515
make_dummy_endpoint()
1616
{
1717
return restinio::endpoint_t{
18-
restinio::asio_ns::ip::address::from_string("127.0.0.1"),
18+
restinio::asio_ns::ip::make_address("127.0.0.1"),
1919
12345u
2020
};
2121
}

dev/test/common/pub.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ do_with_socket(
4040

4141
socket.connect(
4242
restinio::asio_ns::ip::tcp::endpoint{
43-
restinio::asio_ns::ip::address::from_string( str_addr ),
43+
restinio::asio_ns::ip::make_address( str_addr ),
4444
port
4545
} );
4646

dev/test/default_constructed_settings/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ TEST_CASE( "Acceptor options" , "[settings][acceptor_options]" )
291291

292292
acceptor_option_setter = s.acceptor_options_setter();
293293

294-
asio_ns::io_service io_svc;
294+
asio_ns::io_context io_svc;
295295
asio_ns::ip::tcp::acceptor dummy_acceptor{ io_svc };
296296

297297
restinio::acceptor_options_t acceptor_options{ dummy_acceptor };
@@ -318,7 +318,7 @@ TEST_CASE( "Socket options" , "[settings][socket_options]" )
318318

319319
socket_option_setter = s.socket_options_setter();
320320

321-
asio_ns::io_service io_svc;
321+
asio_ns::io_context io_svc;
322322
asio_ns::ip::tcp::socket dummy_socket{ io_svc };
323323
restinio::socket_options_t socket_options{ dummy_socket };
324324

dev/test/file_upload/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ auto
1515
make_dummy_endpoint()
1616
{
1717
return restinio::endpoint_t{
18-
restinio::asio_ns::ip::address::from_string("127.0.0.1"),
18+
restinio::asio_ns::ip::make_address("127.0.0.1"),
1919
12345u
2020
};
2121
}

dev/test/handle_requests/echo_body/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ perform_test()
116116
[&request_handler]( auto & settings ){
117117
settings
118118
.port( utest_default_port() )
119-
.address( restinio::asio_ns::ip::address::from_string( "127.0.0.1" ) )
119+
.address( restinio::asio_ns::ip::make_address( "127.0.0.1" ) )
120120
.request_handler( request_handler );
121121
}
122122
};

dev/test/multipart_body/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ auto
3939
make_dummy_endpoint()
4040
{
4141
return restinio::endpoint_t{
42-
restinio::asio_ns::ip::address::from_string("127.0.0.1"),
42+
restinio::asio_ns::ip::make_address("127.0.0.1"),
4343
12345u
4444
};
4545
}

0 commit comments

Comments
 (0)