Skip to content
Commit e9c0d001 authored by Michael Scott's avatar Michael Scott Committed by Carles Cufí
Browse files

net: http: client: remove payload send_chunk logic

Logic for sending chunks of data is incompatible with adding
Content-Length: header.

Per https://tools.ietf.org/html/rfc7230#section-3.3.1

:
"A sender MUST NOT send a Content-Length header field in any
message that contains a Transfer-Encoding header field."

Going a bit further in my mind: also don't send Transfer-Encoded
chunked data either when the Content-Length header is present.

In general, there will be problems if the http client library
makes payload changes without the user code knowing about it.

This patch removes the use of http_send_chunk() from the new
HTTP client code and instead sends the payload directly to
http_prepare_and_send()

This fixes an issue where every available buffer would be allocated
with repeating payload data because the for loop in http_request()
wasn't ending until we ran out of memory.

NOTE: This patch was previously applied but was lost when
commit d1675bf3 ("net: http: Remove the old legacy API")
moved code around.

Signed-off-by: default avatarMichael Scott <michael@opensourcefoundries.com>
parent 311d0ac6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment