From 2937f02f00b427bffe1509a40459e02aa62e47b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 13 Aug 2021 12:07:05 +0200 Subject: fix(ext/http): remove unwrap() when HTTP conn errors (#11674) --- ext/http/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ext/http/lib.rs') 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::(conn_rid) - .unwrap(); - + .take::(conn_rid); if should_ignore_error(&e) { true } else { -- cgit v1.2.3