Skip to content

Commit

Permalink
Rename is_local_reset to is_local_error
Browse files Browse the repository at this point in the history
It also returns true for I/O errors and local GO_AWAYs.
  • Loading branch information
nox authored and seanmonstar committed May 10, 2023
1 parent 70eade5 commit 7a77f93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/proto/streams/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ impl Recv {

let sz = sz as WindowSize;

let is_ignoring_frame = stream.state.is_local_reset();
let is_ignoring_frame = stream.state.is_local_error();

if !is_ignoring_frame && !stream.state.is_recv_streaming() {
// TODO: There are cases where this can be a stream error of
Expand Down Expand Up @@ -853,7 +853,7 @@ impl Recv {

/// Add a locally reset stream to queue to be eventually reaped.
pub fn enqueue_reset_expiration(&mut self, stream: &mut store::Ptr, counts: &mut Counts) {
if !stream.state.is_local_reset() || stream.is_pending_reset_expiration() {
if !stream.state.is_local_error() || stream.is_pending_reset_expiration() {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/proto/streams/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ impl State {
matches!(self.inner, Closed(Cause::ScheduledLibraryReset(..)))
}

pub fn is_local_reset(&self) -> bool {
pub fn is_local_error(&self) -> bool {
match self.inner {
Closed(Cause::Error(ref e)) => e.is_local(),
Closed(Cause::ScheduledLibraryReset(..)) => true,
Expand Down
2 changes: 1 addition & 1 deletion src/proto/streams/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ impl Inner {

let stream = self.store.resolve(key);

if stream.state.is_local_reset() {
if stream.state.is_local_error() {
// Locally reset streams must ignore frames "for some time".
// This is because the remote may have sent trailers before
// receiving the RST_STREAM frame.
Expand Down

0 comments on commit 7a77f93

Please sign in to comment.