Repository navigation
fix(net): make every AUTH stream ending exact on both sides #4550
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
Changes from all commits
240a2b8
c63b1d1
7bc0dd0
39d5f08
c508eba
a0ef1f1
9f1d6e5
d2755ac
6857be9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -738,10 +738,34 @@ pub(crate) struct Issue { | |
| pub peer: Option<Error>, | ||
| } | ||
|
|
||
| impl Issue { | ||
| /// A fresh stream's shared state. | ||
| pub(crate) fn shared() -> kio::Shared<Self> { | ||
| kio::Shared::default() | ||
| /// The serving task's hold on one peer token's [`Issue`]. | ||
| /// | ||
| /// Dropping it settles [`Issued::closed`] with the session's error, unless the task | ||
| /// already recorded why the stream ended, so no exit path leaves the acceptor waiting. | ||
| pub(crate) struct Serving { | ||
| pub issue: kio::Shared<Issue>, | ||
| handle: Handle, | ||
| } | ||
|
|
||
| impl Serving { | ||
| /// A fresh stream's shared state, settled by the session `handle` if the task drops. | ||
| pub(crate) fn new(handle: Handle) -> Self { | ||
| Self { | ||
| issue: kio::Shared::default(), | ||
| handle, | ||
| } | ||
| } | ||
|
|
||
| /// Record why the stream ended on the peer's side; the first reason wins. | ||
| pub(crate) fn end(&self, err: Error) { | ||
| self.issue.lock().peer.get_or_insert(err); | ||
| } | ||
| } | ||
|
|
||
| impl Drop for Serving { | ||
| fn drop(&mut self) { | ||
| let err = self.handle.state.read().closed().unwrap_or(Error::Cancel); | ||
| self.end(err); | ||
|
Comment on lines
+765
to
+768
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a lite session driver reaches a terminal result but its caller retains the AGENTS.md reference: rs/AGENTS.md:L13-L15 Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.