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: Fix payload issue on HTTP upload #294

Closed
wants to merge 1 commit into from
Closed

net: http_client: Fix payload issue on HTTP upload #294

wants to merge 1 commit into from

Conversation

arvinf
Copy link
Contributor

@arvinf arvinf commented Apr 20, 2020

This PR is a backport of a bug fix in the Zephyr HTTP client that causes request payloads to fail (relevant issue). The changes have already been approved for merge in the main Zephyr repo (see PR).

I am submitting this backport to be merged early, instead of the next Zephyr release, because the bug cripples upload functionality in the HTTP client for binary payloads and should be resolved as soon as possible for nRF SDK users.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 20, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

Bug fix and improved `payload` handling in `http_client_req`.

Changes to `http_client_req` behaviour:

If the user provides `payload_len` it is used to generate the
`Content-Length` header. This is done even if `payload_cb` is used to
provide the actual data. If no `payload_len` is specified then no
`Content-Length` is generated.

If `payload_cb` is provided it is called to send the payload data.
Otherwise `payload` is used as the payload buffer and sent. If
`payload_len` is not zero, it is used as the size of `payload`.
Otherwise `payload` is assumed to be a string and `strlen` is used to
determine its size. This is to maintain current behaviour and not break
existing samples.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
@rlubos
Copy link
Contributor

rlubos commented Apr 21, 2020

@arvinf We typically pull upstream fixes during upmerges to avoid confusion during the merge. The next upmerge should take place shortly.

@nvlsianpu nvlsianpu added the DNM label Apr 22, 2020
@nvlsianpu
Copy link
Contributor

DNM until Upmerge #296 will be merged

@mbolivar-nordic mbolivar-nordic force-pushed the master branch 2 times, most recently from 381e998 to a512e75 Compare June 3, 2020 15:39
@rlubos
Copy link
Contributor

rlubos commented Oct 8, 2020

This got merged with upmerge.

@rlubos rlubos closed this Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants