summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-08-13 12:07:05 +0200
committerGitHub <noreply@github.com>2021-08-13 12:07:05 +0200
commit2937f02f00b427bffe1509a40459e02aa62e47b0 (patch)
tree77b55bd12ccaf52d1b61477ae74644a936fd4bc6 /ext/http/lib.rs
parentebb79b28a5e1689a1d198082b35d37a4541d2a90 (diff)
fix(ext/http): remove unwrap() when HTTP conn errors (#11674)
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs
index 2c858143c..db55ca53d 100644
--- a/ext/http/lib.rs
+++ b/ext/http/lib.rs
@@ -196,13 +196,12 @@ async fn op_http_request_next(
Poll::Ready(Err(e)) => {
// TODO(ry) close RequestResource associated with connection
// TODO(ry) close ResponseBodyResource associated with connection
- // close ConnResource
- state
+ // try to close ConnResource, but don't unwrap as it might
+ // already be closed
+ let _ = state
.borrow_mut()
.resource_table
- .take::<ConnResource>(conn_rid)
- .unwrap();
-
+ .take::<ConnResource>(conn_rid);
if should_ignore_error(&e) {
true
} else {