Skip to content
Commit 8f983ccd authored by Robert Lubos's avatar Robert Lubos Committed by Daniel DeGrasse
Browse files

net: lib: http_client: Fix end of message detection



HTTP 1.1 server has two ways of indicating the message body length -
either by providing the Content Length header, or by closing the
connection when the entire body has been transmitted.

The second method didn't work with Zephyr's HTTP client implementation,
as EOF on a socket was treated as an error condition. Therefore, if no
Content Length was provided by the server, such transfers would always
end up with ECONNRESET error.

In order to fix this, we need to notify the parser about the EOF on a
socket when connection is closed. It is the parser role to determine
whether the EOF was expected in current state (by marking end of message
flag) or not (by setting an error).

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent b3ccee47
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment