summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-11-09 12:10:21 +0100
committerGitHub <noreply@github.com>2021-11-09 12:10:21 +0100
commit75793baae83123f890442c5d32e3dd38eb18ce1c (patch)
tree0d14bd5edbe28c3beebe9f0944437a89e0e3f724 /runtime
parent31fde9deba6d4ca55293d60a030babd8d4ce12af (diff)
Revert "refactor(ext/http): rewrite hyper integration and fix bug (#12332)" (#12704)
This reverts commit 5b1e537446454f6332de44adbeb6a15ff072c2fa.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/errors.rs5
-rw-r--r--runtime/ops/http.rs5
2 files changed, 2 insertions, 8 deletions
diff --git a/runtime/errors.rs b/runtime/errors.rs
index 1491161d3..fe6e71193 100644
--- a/runtime/errors.rs
+++ b/runtime/errors.rs
@@ -17,7 +17,6 @@ use deno_fetch::reqwest;
use std::env;
use std::error::Error;
use std::io;
-use std::sync::Arc;
fn get_dlopen_error_class(error: &dlopen::Error) -> &'static str {
use dlopen::Error::*;
@@ -165,10 +164,6 @@ pub fn get_error_class_name(e: &AnyError) -> Option<&'static str> {
})
.or_else(|| e.downcast_ref::<hyper::Error>().map(get_hyper_error_class))
.or_else(|| {
- e.downcast_ref::<Arc<hyper::Error>>()
- .map(|e| get_hyper_error_class(&**e))
- })
- .or_else(|| {
e.downcast_ref::<deno_core::Canceled>().map(|e| {
let io_err: io::Error = e.to_owned().into();
get_io_error_class(&io_err)
diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs
index fddac9261..683dc1a57 100644
--- a/runtime/ops/http.rs
+++ b/runtime/ops/http.rs
@@ -6,7 +6,6 @@ use deno_core::op_sync;
use deno_core::Extension;
use deno_core::OpState;
use deno_core::ResourceId;
-use deno_http::http_create_conn_resource;
use deno_net::io::TcpStreamResource;
use deno_net::ops_tls::TlsStreamResource;
@@ -30,7 +29,7 @@ fn op_http_start(
let (read_half, write_half) = resource.into_inner();
let tcp_stream = read_half.reunite(write_half)?;
let addr = tcp_stream.local_addr()?;
- return http_create_conn_resource(state, tcp_stream, addr, "http");
+ return deno_http::start_http(state, tcp_stream, addr, "http");
}
if let Ok(resource_rc) = state
@@ -42,7 +41,7 @@ fn op_http_start(
let (read_half, write_half) = resource.into_inner();
let tls_stream = read_half.reunite(write_half);
let addr = tls_stream.get_ref().0.local_addr()?;
- return http_create_conn_resource(state, tls_stream, addr, "https");
+ return deno_http::start_http(state, tls_stream, addr, "https");
}
Err(bad_resource_id())