app: http: Handle "Connection: close" header in HTTP response#303
Merged
Conversation
|
You can find the documentation preview for this PR here. |
Contributor
MarkusLassila
left a comment
There was a problem hiding this comment.
Looking good. Some comments.
880d74d to
a0722f1
Compare
divipillai
reviewed
May 18, 2026
| For chunked transfer encoding this includes the raw framing bytes (chunk-size lines, ``\r\n`` separators, and the final ``0\r\n\r\n`` terminator). | ||
| On cancel (``status_code=-1`` from ``AT#XHTTPCCANCEL``), it contains the number of response body bytes already delivered to the host. | ||
| * The ``<connection_close>`` parameter is an integer. | ||
| It is ``1`` when the server included a ``Connection: close`` header in its response, indicating that the TCP connection will be closed after this response. |
Collaborator
There was a problem hiding this comment.
Suggested change
| It is ``1`` when the server included a ``Connection: close`` header in its response, indicating that the TCP connection will be closed after this response. | |
| It is ``1`` when the server includes a ``Connection: close`` header in its response, indicating that the TCP connection will be closed after this response. |
Add <connection_close> field to #XHTTPCSTAT URC to indicate when the server signals connection closure via the "Connection: close" header. XHTTPCSTAT: <handle>,<status_code>,<bytes>,<connection_close> When <connection_close> is set, the host must close and reopen the socket before sending the next request. Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
a0722f1 to
7f499d9
Compare
trantanen
approved these changes
May 18, 2026
divipillai
approved these changes
May 18, 2026
MarkusLassila
approved these changes
May 18, 2026
| HTTP_RECV_BUF_SIZE - req->recv_buf_len - 1, | ||
| NRF_MSG_DONTWAIT); | ||
| if (!(events & NRF_POLLIN)) { | ||
| break; |
Contributor
There was a problem hiding this comment.
Suggested change
| break; | |
| return; |
| http_send_data(req, req->recv_buf, req->recv_buf_len); | ||
| req->recv_buf_len = 0; | ||
| if (!(events & NRF_POLLIN)) { | ||
| break; |
Contributor
There was a problem hiding this comment.
Suggested change
| break; | |
| return; |
Split HTTP_STATE_RECEIVING_HEADERS and HTTP_STATE_RECEIVING_BODY to separate switch cases. Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
7f499d9 to
baf8da8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add <connection_close> field to #XHTTPCSTAT URC to indicate when the server signals connection closure via the "Connection: close" header.
XHTTPCSTAT: ,<status_code>,,<connection_close>
When <connection_close> is set, the host must close and reopen the socket before sending the next request.
Split HTTP_STATE_RECEIVING_HEADERS and HTTP_STATE_RECEIVING_BODY to separate switch cases.