Skip to content

Commit

Permalink
[coro_http]fix chunked and remote address (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Apr 24, 2024
1 parent 041d9b5 commit a7716ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion include/ylt/standalone/cinatra/coro_http_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,6 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
if (chunk_size == 0) {
// all finished, no more data
chunked_buf_.consume(chunked_buf_.size());
data.status = 200;
data.eof = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion include/ylt/standalone/cinatra/coro_http_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class coro_http_connection
if (!remote_addr_.empty()) {
return remote_addr_;
}
set_address_impl(remote_addr_, false);
set_address_impl(remote_addr_);
return remote_addr_;
}

Expand Down
2 changes: 2 additions & 0 deletions include/ylt/standalone/cinatra/coro_http_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,10 @@ class coro_http_server {
}

void init_address(std::string address) {
#if __has_include(<ylt/easylog.hpp>)
easylog::logger<>::instance(); // init easylog singleton to make sure
// server destruct before easylog.
#endif
if (size_t pos = address.find(':'); pos != std::string::npos) {
auto port_sv = std::string_view(address).substr(pos + 1);

Expand Down

0 comments on commit a7716ea

Please sign in to comment.