net: http: Rename body_start to body_frag_start

Following #42026, the body_start pointer now points to the
start of the body fragment in the recv_buffer as long as there
is body in it, either entirely or partially.

Rename the body_start to body_frag_start to better reflect
what it represents.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2022-02-26 15:24:17 +08:00 committed by Carles Cufí
commit 49c2d8a635
3 changed files with 16 additions and 16 deletions

View file

@ -691,19 +691,19 @@ static void response_cb(struct http_response *rsp,
switch (type) {
case HAWKBIT_PROBE:
if (hb_context.dl.http_content_size == 0) {
body_data = rsp->body_start;
body_data = rsp->body_frag_start;
body_len = rsp->data_len;
/*
* subtract the size of the HTTP header from body_len
*/
body_len -= (rsp->body_start - rsp->recv_buf);
body_len -= (rsp->body_frag_start - rsp->recv_buf);
hb_context.dl.http_content_size = rsp->content_length;
} else {
/*
* more general case where body data is set, but no need
* to take the HTTP header into account
*/
body_data = rsp->body_start;
body_data = rsp->body_frag_start;
body_len = rsp->data_len;
}
@ -765,19 +765,19 @@ static void response_cb(struct http_response *rsp,
case HAWKBIT_PROBE_DEPLOYMENT_BASE:
if (hb_context.dl.http_content_size == 0) {
body_data = rsp->body_start;
body_data = rsp->body_frag_start;
body_len = rsp->data_len;
/*
* subtract the size of the HTTP header from body_len
*/
body_len -= (rsp->body_start - rsp->recv_buf);
body_len -= (rsp->body_frag_start - rsp->recv_buf);
hb_context.dl.http_content_size = rsp->content_length;
} else {
/*
* more general case where body data is set, but no need
* to take the HTTP header into account
*/
body_data = rsp->body_start;
body_data = rsp->body_frag_start;
body_len = rsp->data_len;
}
@ -828,19 +828,19 @@ static void response_cb(struct http_response *rsp,
case HAWKBIT_DOWNLOAD:
if (hb_context.dl.http_content_size == 0) {
body_data = rsp->body_start;
body_data = rsp->body_frag_start;
body_len = rsp->data_len;
/*
* subtract the size of the HTTP header from body_len
*/
body_len -= (rsp->body_start - rsp->recv_buf);
body_len -= (rsp->body_frag_start - rsp->recv_buf);
hb_context.dl.http_content_size = rsp->content_length;
} else {
/*
* more general case where body data is set, but no need
* to take the HTTP header into account
*/
body_data = rsp->body_start;
body_data = rsp->body_frag_start;
body_len = rsp->data_len;
}