[coro_http]fix chunked and remote address (#665)
This commit is contained in:
parent
041d9b5a57
commit
a7716eae9d
|
@ -1722,7 +1722,6 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
|
||||||
if (chunk_size == 0) {
|
if (chunk_size == 0) {
|
||||||
// all finished, no more data
|
// all finished, no more data
|
||||||
chunked_buf_.consume(chunked_buf_.size());
|
chunked_buf_.consume(chunked_buf_.size());
|
||||||
data.status = 200;
|
|
||||||
data.eof = true;
|
data.eof = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,7 +402,7 @@ class coro_http_connection
|
||||||
if (!remote_addr_.empty()) {
|
if (!remote_addr_.empty()) {
|
||||||
return remote_addr_;
|
return remote_addr_;
|
||||||
}
|
}
|
||||||
set_address_impl(remote_addr_, false);
|
set_address_impl(remote_addr_);
|
||||||
return remote_addr_;
|
return remote_addr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -863,8 +863,10 @@ class coro_http_server {
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_address(std::string address) {
|
void init_address(std::string address) {
|
||||||
|
#if __has_include(<ylt/easylog.hpp>)
|
||||||
easylog::logger<>::instance(); // init easylog singleton to make sure
|
easylog::logger<>::instance(); // init easylog singleton to make sure
|
||||||
// server destruct before easylog.
|
// server destruct before easylog.
|
||||||
|
#endif
|
||||||
if (size_t pos = address.find(':'); pos != std::string::npos) {
|
if (size_t pos = address.find(':'); pos != std::string::npos) {
|
||||||
auto port_sv = std::string_view(address).substr(pos + 1);
|
auto port_sv = std::string_view(address).substr(pos + 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue