-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
WritableStream is now flushed prior to startTls. #572
Conversation
KJ_IF_MAYBE(expectedHost, s->expectedServerHostname) { | ||
acceptedHostname = *expectedHost; | ||
auto& context = IoContext::current(); | ||
auto secureStreamPromise = context.awaitJs(writable->flush(js).then(js, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens here if the writable errors while trying to flush?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would hope that it gets propagated up as part of the PromisedAsyncIoStream below. Is that a fair assumption?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should. let's be sure to test that case in the starttls tests just to make sure :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, will add to my TODOs.
74fa56a
to
a784891
Compare
As discussed in #498 (comment) (and internally, TL;DR: we need to flush as JS can buffer in WritableStream).
This PR implements a new
flush
method on the WritableStream. This is used prior to calling the tlsStarter which initiates the TLS connection.Test Plan
With script: https://gist.github.com/dom96/e5424c9c03c2b0c8e2eb97ba63163a73
Output
Expand