Related to !248: completed synchronous request() fixes
This commit is contained in:
parent
49e2bb9261
commit
c6c7d0a6f2
5 changed files with 160 additions and 124 deletions
|
|
@ -50,6 +50,9 @@ namespace SimpleWeb {
|
|||
void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) {
|
||||
resolver.async_resolve(host_port.first, host_port.second, std::forward<handler_type>(handler));
|
||||
}
|
||||
asio::executor_work_guard<io_context::executor_type> make_work_guard(io_context &context) {
|
||||
return asio::make_work_guard(context);
|
||||
}
|
||||
#else
|
||||
using io_context = asio::io_service;
|
||||
using resolver_results = asio::ip::tcp::resolver::iterator;
|
||||
|
|
@ -73,6 +76,9 @@ namespace SimpleWeb {
|
|||
void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) {
|
||||
resolver.async_resolve(asio::ip::tcp::resolver::query(host_port.first, host_port.second), std::forward<handler_type>(handler));
|
||||
}
|
||||
io_context::work make_work_guard(io_context &context) {
|
||||
return io_context::work(context);
|
||||
}
|
||||
#endif
|
||||
} // namespace SimpleWeb
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue