From 3abdfff5f7e4f2b1e8e30cec2ab5fef00822b977 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 30 Nov 2023 11:25:28 +0800 Subject: [PATCH] =?UTF-8?q?IDE=E5=BF=98=E8=AE=B0=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=8B=E7=9A=84clang-format=E4=BA=86,=20?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/HttpClient.cpp b/src/Http/HttpClient.cpp index a13f9d8e..9bfccff2 100644 --- a/src/Http/HttpClient.cpp +++ b/src/Http/HttpClient.cpp @@ -58,7 +58,7 @@ void HttpClient::sendRequest(const string &url) { _header.emplace("User-Agent", kServerName); _header.emplace("Accept", "*/*"); _header.emplace("Accept-Language", "zh-CN,zh;q=0.8"); - if(_http_persistent) { + if (_http_persistent) { _header.emplace("Connection", "keep-alive"); } else { _header.emplace("Connection", "close"); @@ -191,7 +191,7 @@ void HttpClient::onRecv(const Buffer::Ptr &pBuf) { } void HttpClient::onError(const SockException &ex) { - if(ex.getErrCode() == Err_reset && _http_persistent){ + if (ex.getErrCode() == Err_reset && _http_persistent) { // 连接被重置,可能是服务器主动断开了连接, 或者服务器内核参数或防火墙的持久连接空闲时间超时或不一致. // 如果是持久化连接,那么我们可以通过重连来解决这个问题 // The connection was reset, possibly because the server actively disconnected the connection,