We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I readed example https://www.boost.org/doc/libs/1_85_0/libs/beast/doc/html/beast/more_examples/expect_100_continue_server.html with how to receive 100-continue message. But my code was call by async API. My code is here
void ClientConnection::DoReadHeader() { auto self(shared_from_this()); p_.emplace(); p_->body_limit(boost::none); if (timeout_ > 0) { stream_.expires_after(std::chrono::seconds(timeout_)); } else { stream_.expires_at(boost::asio::steady_timer::time_point::max()); } boost::beast::http::async_read_header(stream_, buffer_, *p_, boost::beast::bind_front_handler(&ClientConnection::OnReadHeader, self)); } void ClientConnection::OnReadHeader(boost::beast::error_code ec, std::size_t bytes) { boost::ignore_unused(bytes); auto self(shared_from_this()); if (ec) { if (ec != boost::beast::http::error::end_of_stream) { LOG_E("[ClientConnection] OnReadHeader error : %s", ec.what().c_str()); } auto fun = clientHandler_.GetFun(ClientHandlerType::HEADER_RES_ERROR); if (fun != nullptr) { fun(self); } return DoClose(); } auto fun = clientHandler_.GetFun(ClientHandlerType::HEADER_RES); if (fun != nullptr) { fun(self); } if (p_->chunked()) { p_->on_chunk_header(headerCb); p_->on_chunk_body(bodyCb); if (!p_->is_done()) { if (timeout_ > 0) { stream_.expires_after(std::chrono::seconds(timeout_)); } else { stream_.expires_at(boost::asio::steady_timer::time_point::max()); } boost::beast::http::async_read(stream_, buffer_, *p_, boost::beast::bind_front_handler(&ClientConnection::OnChunkBody, self)); } } else { if (!p_->is_done()) { if (timeout_ > 0) { stream_.expires_after(std::chrono::seconds(timeout_)); } else { stream_.expires_at(boost::asio::steady_timer::time_point::max()); } boost::beast::http::async_read(stream_, buffer_, *p_, boost::beast::bind_front_handler(&ClientConnection::OnReadBody, self)); } } }
ClientConnection.zip
The text was updated successfully, but these errors were encountered:
The provided code is incomplete and cannot be compiled or tested. Could you provide more details on the issue?
Sorry, something went wrong.
No branches or pull requests
I readed example https://www.boost.org/doc/libs/1_85_0/libs/beast/doc/html/beast/more_examples/expect_100_continue_server.html with how to receive 100-continue message.
But my code was call by async API.
My code is here
ClientConnection.zip
The text was updated successfully, but these errors were encountered: