Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: http: client: Return error if waiting timeout #68930

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions subsys/net/lib/http/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,16 @@ int http_client_req(int sock, struct http_request *req,
total_recv = http_wait_data(sock, req, timeout);
if (total_recv < 0) {
NET_DBG("Wait data failure (%d)", total_recv);
} else {
NET_DBG("Received %d bytes", total_recv);
ret = total_recv;
goto out;
} else if (total_recv == 0) {
NET_DBG("Timeout while waiting data");
ret = -ETIMEDOUT;
goto out;
}

NET_DBG("Received %d bytes", total_recv);

return total_sent;

out:
Expand Down
Loading