Skip to content

Commit

Permalink
Fix reading of body data
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed May 28, 2024
1 parent b0c653d commit 39b3711
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/lwan-request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ get_remaining_body_data_length(struct lwan_request *request,
if (UNLIKELY((size_t)parsed_size >= max_size))
return HTTP_TOO_LARGE;
if (UNLIKELY(!parsed_size)) {
helper->next_request = NULL;
helper->body_data.value = helper->next_request = NULL;
*total = *have = 0;
} else {
*total = (size_t)parsed_size;
Expand All @@ -1307,10 +1307,10 @@ get_remaining_body_data_length(struct lwan_request *request,
if (*have < *total)
return HTTP_PARTIAL_CONTENT;

helper->body_data.value = helper->next_request;
helper->next_request += *total;
}

helper->body_data.value = helper->next_request;
helper->body_data.len = *total;
return HTTP_OK;
}
Expand Down

0 comments on commit 39b3711

Please sign in to comment.