boostorg / boostorg/beast

head request seems to be waiting for body

Open
#2,322 13 comments 0 reactions 0 assignees View on GitHub
Design Feature Stale
Dominant language
C++
Stars
4.8k
Forks
694
Avg merge
12h 48m
Merged PRs (30d)
1

Description

head request takes ages.
I might be wrong, but I suppose that async_read is waiting for a body, which of course is not there.
Simple workaround might be using async_read_header... but in my opinion async_read should work anyway

### Version of Beast

306

### Steps necessary to reproduce the problem

```cpp
#include
#include
#include
#include

int main()
{
boost::asio::io_context ctx;
boost::asio::ip::tcp::resolver resolver(ctx);
boost::beast::tcp_stream stream(ctx);
boost::beast::flat_buffer buffer_; // (Must persist between reads)
boost::beast::http::request req_;
boost::beast::http::response res_;

resolver.async_resolve("www.google.com", std::to_string(80).c_str(), [&](boost::system::error_code ec, boost::asio::ip::tcp::resolver::results_type results) {
if (ec) {
std::cerr <

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.