diff options
Diffstat (limited to 'ext/net/ops_tls.rs')
-rw-r--r-- | ext/net/ops_tls.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs index 01f29b2ad..6289d963f 100644 --- a/ext/net/ops_tls.rs +++ b/ext/net/ops_tls.rs @@ -25,8 +25,8 @@ use deno_core::futures::task::Poll; use deno_core::futures::task::RawWaker; use deno_core::futures::task::RawWakerVTable; use deno_core::futures::task::Waker; -use deno_core::op_async; -use deno_core::op_sync; +use deno_core::op; + use deno_core::parking_lot::Mutex; use deno_core::AsyncRefCell; use deno_core::AsyncResult; @@ -644,11 +644,11 @@ impl Write for ImplementWriteTrait<'_, TcpStream> { pub fn init<P: NetPermissions + 'static>() -> Vec<OpPair> { vec![ - ("op_tls_start", op_async(op_tls_start::<P>)), - ("op_tls_connect", op_async(op_tls_connect::<P>)), - ("op_tls_listen", op_sync(op_tls_listen::<P>)), - ("op_tls_accept", op_async(op_tls_accept)), - ("op_tls_handshake", op_async(op_tls_handshake)), + op_tls_start::decl::<P>(), + op_tls_connect::decl::<P>(), + op_tls_listen::decl::<P>(), + op_tls_accept::decl(), + op_tls_handshake::decl(), ] } @@ -765,6 +765,7 @@ pub struct StartTlsArgs { alpn_protocols: Option<Vec<String>>, } +#[op] pub async fn op_tls_start<NP>( state: Rc<RefCell<OpState>>, args: StartTlsArgs, @@ -857,6 +858,7 @@ where }) } +#[op] pub async fn op_tls_connect<NP>( state: Rc<RefCell<OpState>>, args: ConnectTlsArgs, @@ -1016,6 +1018,7 @@ pub struct ListenTlsArgs { alpn_protocols: Option<Vec<String>>, } +#[op] pub fn op_tls_listen<NP>( state: &mut OpState, args: ListenTlsArgs, @@ -1112,6 +1115,7 @@ where }) } +#[op] pub async fn op_tls_accept( state: Rc<RefCell<OpState>>, rid: ResourceId, @@ -1163,6 +1167,7 @@ pub async fn op_tls_accept( }) } +#[op] pub async fn op_tls_handshake( state: Rc<RefCell<OpState>>, rid: ResourceId, |