net: http_client: Set body_start pointer unconditionally

Set `body_start` pointer regardless of the body position in the recv
buffer. In result, the pointer shall indicate correctly position of the
body for each fragment, it's also explicit now that if the pointer is
not set for a fragment, there's no body in that particular fragment.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2022-01-21 09:48:01 +01:00 committed by Anas Nashif
commit 4557d183b9

View file

@ -264,8 +264,8 @@ static int on_body(struct http_parser *parser, const char *at, size_t length)
req->internal.response.http_cb->on_body(parser, at, length);
}
if (!req->internal.response.body_start &&
(uint8_t *)at != (uint8_t *)req->internal.response.recv_buf) {
/* Reset the body_start pointer for each fragment. */
if (!req->internal.response.body_start) {
req->internal.response.body_start = (uint8_t *)at;
}