支持http响应无content-length字段的情况:#850

This commit is contained in:
xiongziliang 2021-05-22 10:22:56 +08:00
parent 7067472a18
commit 975c11b74c

View File

@ -21,8 +21,7 @@ HttpRequester::~HttpRequester(){
ssize_t HttpRequester::onResponseHeader(const string &status,const HttpHeader &headers) { ssize_t HttpRequester::onResponseHeader(const string &status,const HttpHeader &headers) {
_strRecvBody.clear(); _strRecvBody.clear();
//无Content-Length字段时默认后面没有content return HttpClientImp::onResponseHeader(status, headers);
return 0;
} }
void HttpRequester::onResponseBody(const char *buf,size_t size,size_t recvedSize,size_t totalSize) { void HttpRequester::onResponseBody(const char *buf,size_t size,size_t recvedSize,size_t totalSize) {