diff options
author | Toby Ealden <toby.ealden@gmail.com> | 2024-10-15 19:05:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-15 23:35:10 +0530 |
commit | c5a7f98d82b64408764dfd269a17b5ddb6974737 (patch) | |
tree | 103c77506f9d6f4bbeee7899451f4182365e5309 /ext/node/ops/http2.rs | |
parent | 38888061698f230f2288cf520daf86d781c395bd (diff) |
fix(ext/node): handle http2 server ending stream (#26235)
Closes #24845
Diffstat (limited to 'ext/node/ops/http2.rs')
-rw-r--r-- | ext/node/ops/http2.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/node/ops/http2.rs b/ext/node/ops/http2.rs index 9595cb33d..705a8ecdc 100644 --- a/ext/node/ops/http2.rs +++ b/ext/node/ops/http2.rs @@ -488,13 +488,11 @@ pub async fn op_http2_client_get_response_body_chunk( loop { let result = poll_fn(|cx| poll_data_or_trailers(cx, &mut body)).await; if let Err(err) = result { - let reason = err.reason(); - if let Some(reason) = reason { - if reason == Reason::CANCEL { - return Ok((None, false, true)); - } + match err.reason() { + Some(Reason::NO_ERROR) => return Ok((None, true, false)), + Some(Reason::CANCEL) => return Ok((None, false, true)), + _ => return Err(err.into()), } - return Err(err.into()); } match result.unwrap() { DataOrTrailers::Data(data) => { |