Skip to content

Fix behaviour when reading is complete before returning HTTP streaming resp#624

Merged
DemetrisChr merged 2 commits intocouchbase:mainfrom
DemetrisChr:http-stream-read-complete
Jul 11, 2024
Merged

Fix behaviour when reading is complete before returning HTTP streaming resp#624
DemetrisChr merged 2 commits intocouchbase:mainfrom
DemetrisChr:http-stream-read-complete

Conversation

@DemetrisChr
Copy link
Copy Markdown
Contributor

@DemetrisChr DemetrisChr commented Jul 11, 2024

Motivation

If the entire HTTP body has been read in the initial read before returning the HTTP streaming response, any subsequent attempt to read from the TCP socket will never return.

Changes

  • Set reading_complete when initializing http_streaming_response_body with the value of http_streaming_parser's complete field.
  • Call the stream_end_handler when the entire HTTP message has been read successfully (not only on cancellation).

Comment thread core/io/http_session.cxx
Comment thread core/io/http_session.cxx Outdated
Co-authored-by: Sergey Avseyev <[email protected]>
@DemetrisChr DemetrisChr merged commit 30597b5 into couchbase:main Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants