1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-03 17:08:35 -05:00

fix lint errors

This commit is contained in:
Yoshiya Hinosawa 2024-09-26 13:54:09 +09:00
parent 8aea0f0d09
commit 122cefaed4
No known key found for this signature in database
GPG key ID: 9017DB4559488785
3 changed files with 6 additions and 14 deletions

View file

@ -4,8 +4,6 @@ use std::borrow::Cow;
use std::cell::RefCell;
use std::pin::Pin;
use std::rc::Rc;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use std::task::Context;
use std::task::Poll;
@ -80,7 +78,6 @@ pub struct NodeHttpClientResponse {
response:
Pin<Box<dyn Future<Output = Result<Response<Incoming>, Error>> + Send>>,
url: String,
connection_started: Arc<AtomicBool>,
}
impl deno_core::Resource for NodeHttpClientResponse {
@ -108,20 +105,16 @@ where
.resource_table
.take::<TcpStreamResource>(conn_rid)?;
let resource = Rc::try_unwrap(resource_rc)
.map_err(|e| bad_resource("TCP stream is currently in use"))?;
.map_err(|_e| bad_resource("TCP stream is currently in use"))?;
let (read_half, write_half) = resource.into_inner();
let tcp_stream = read_half.reunite(write_half)?;
let io = TokioIo::new(tcp_stream);
let (mut sender, conn) = hyper::client::conn::http1::handshake(io).await?;
let connection_started = Arc::new(AtomicBool::new(false));
let conn_start = connection_started.clone();
let (notify, receiver) = tokio::sync::oneshot::channel::<()>();
// Spawn a task to poll the connection, driving the HTTP state
let _handle = tokio::task::spawn(async move {
conn_start.store(true, std::sync::atomic::Ordering::Relaxed);
let _ = notify.send(());
conn.await?;
Ok::<_, AnyError>(())
@ -197,7 +190,6 @@ where
.add(NodeHttpClientResponse {
response: res,
url: url.clone(),
connection_started,
});
let conn_rid = state
.borrow_mut()

View file

@ -516,6 +516,7 @@ Object.defineProperties(
this._headerSent = true;
}
} else {
// deno-lint-ignore no-console
console.warn("socket not found");
}
},

View file

@ -69,7 +69,6 @@ import { TcpConn } from "ext:deno_net/01_net.js";
import { STATUS_CODES } from "node:_http_server";
import { methods as METHODS } from "node:_http_common";
const { internalRidSymbol } = core;
const { ArrayIsArray } = primordials;
type Chunk = string | Buffer | Uint8Array;
@ -615,7 +614,7 @@ class ClientRequest extends OutgoingMessage {
try {
await this._bodyWriter.ready;
await this._bodyWriter?.close();
} catch (err) {
} catch {
// The readable stream resource is dropped right after
// read is complete closing the writable stream resource.
// If we try to close the writer again, it will result in an
@ -623,7 +622,7 @@ class ClientRequest extends OutgoingMessage {
}
try {
cb?.();
} catch (_) {
} catch {
//
}
})();
@ -633,7 +632,7 @@ class ClientRequest extends OutgoingMessage {
try {
await this._bodyWriter.ready;
await this._bodyWriter?.close();
} catch (err) {
} catch {
// The readable stream resource is dropped right after
// read is complete closing the writable stream resource.
// If we try to close the writer again, it will result in an
@ -641,7 +640,7 @@ class ClientRequest extends OutgoingMessage {
}
try {
cb?.();
} catch (_) {
} catch {
//
}
})();