| 231 | } |
| 232 | |
| 233 | void |
| 234 | on_connect(beast::error_code ec, tcp::resolver::results_type::endpoint_type) |
| 235 | { |
| 236 | if(ec) |
| 237 | { |
| 238 | report_.aggregate( |
| 239 | [](crawl_report& rep) |
| 240 | { |
| 241 | ++rep.connect_failures; |
| 242 | }); |
| 243 | return do_get_host(); |
| 244 | } |
| 245 | |
| 246 | // Set a timeout on the operation |
| 247 | stream_.expires_after(std::chrono::seconds(10)); |
| 248 | |
| 249 | // Send the HTTP request to the remote host |
| 250 | http::async_write( |
| 251 | stream_, |
| 252 | req_, |
| 253 | beast::bind_front_handler( |
| 254 | &worker::on_write, |
| 255 | shared_from_this())); |
| 256 | } |
| 257 | |
| 258 | void |
| 259 | on_write( |
nothing calls this directly
no test coverage detected