lib/curl/Request: move code to IsResponseBoundaryHeader()
This commit is contained in:
parent
1b6666fa39
commit
190d525099
@ -168,13 +168,20 @@ CurlRequest::Done(CURLcode result)
|
||||
}
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static bool
|
||||
IsResponseBoundaryHeader(StringView s)
|
||||
{
|
||||
return s.size > 5 && memcmp(s.data, "HTTP/", 5) == 0;
|
||||
}
|
||||
|
||||
inline void
|
||||
CurlRequest::HeaderFunction(StringView s)
|
||||
{
|
||||
if (state > State::HEADERS)
|
||||
return;
|
||||
|
||||
if (s.size > 5 && memcmp(s.data, "HTTP/", 5) == 0) {
|
||||
if (IsResponseBoundaryHeader(s)) {
|
||||
/* this is the boundary to a new response, for example
|
||||
after a redirect */
|
||||
headers.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user