Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Apr 24, 2024
1 parent cc271bd commit 046ec0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/ylt/standalone/cinatra/coro_http_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
std::chrono::seconds(8);
std::chrono::steady_clock::duration req_timeout_duration_ =
std::chrono::seconds(60);
bool enable_tcp_no_delay_ = false;
bool enable_tcp_no_delay_ = true;
std::string resp_chunk_str_;
std::span<char> out_buf_;

Expand Down
7 changes: 5 additions & 2 deletions include/ylt/standalone/cinatra/coro_http_response.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ class coro_http_response {
: resp_str.append(CONN_CLOSE_SV);
}

if (!content_type_.empty()) {
resp_str.append(content_type_);
if (content_view_.empty()) {
resp_str.append(content_);
}
else {
resp_str.append(content_view_);
}

append_header_str(resp_str, resp_headers_);
Expand Down
4 changes: 2 additions & 2 deletions include/ylt/standalone/cinatra/coro_http_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ class coro_http_server {
}

void init_address(std::string address) {
CINATRA_LOG_ERROR << "init log"; // init easylog singleton to make sure
// server destruct before easylog.
easylog::logger<>::instance(); // init easylog singleton to make sure
// server destruct before easylog.
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 046ec0c

Please sign in to comment.