mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
interrupt socket receive when header is too long.
This commit is contained in:
parent
198c483c66
commit
49e3a1760f
@ -80,7 +80,7 @@ namespace Husky
|
||||
_contentLength = 0;
|
||||
}
|
||||
public:
|
||||
bool parseHeaders(const char* buffer, size_t len)
|
||||
bool parseHeader(const char* buffer, size_t len)
|
||||
{
|
||||
string headerStr(buffer, len);
|
||||
size_t lpos = 0, rpos = 0;
|
||||
|
@ -82,7 +82,11 @@ namespace Husky
|
||||
{
|
||||
if(!httpInfo.isHeaderFinished())
|
||||
{
|
||||
httpInfo.parseHeaders(recvBuf, n);
|
||||
if(!httpInfo.parseHeader(recvBuf, n))
|
||||
{
|
||||
LogError("parseHeader failed. ");
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
httpInfo.appendBody(recvBuf, n);
|
||||
|
Loading…
x
Reference in New Issue
Block a user