summaryrefslogtreecommitdiff
path: root/ext/net/ops_unix.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/net/ops_unix.rs')
-rw-r--r--ext/net/ops_unix.rs27
1 files changed, 24 insertions, 3 deletions
diff --git a/ext/net/ops_unix.rs b/ext/net/ops_unix.rs
index b45b02343..bf03f4015 100644
--- a/ext/net/ops_unix.rs
+++ b/ext/net/ops_unix.rs
@@ -209,8 +209,7 @@ where
Ok((rid, pathname))
}
-#[op]
-pub fn op_net_listen_unixpacket<NP>(
+pub fn net_listen_unixpacket<NP>(
state: &mut OpState,
path: String,
) -> Result<(ResourceId, Option<String>), AnyError>
@@ -218,7 +217,6 @@ where
NP: NetPermissions + 'static,
{
let address_path = Path::new(&path);
- super::check_unstable(state, "Deno.listenDatagram");
let permissions = state.borrow_mut::<NP>();
permissions.check_read(address_path, "Deno.listenDatagram()")?;
permissions.check_write(address_path, "Deno.listenDatagram()")?;
@@ -233,6 +231,29 @@ where
Ok((rid, pathname))
}
+#[op]
+pub fn op_net_listen_unixpacket<NP>(
+ state: &mut OpState,
+ path: String,
+) -> Result<(ResourceId, Option<String>), AnyError>
+where
+ NP: NetPermissions + 'static,
+{
+ super::check_unstable(state, "Deno.listenDatagram");
+ net_listen_unixpacket::<NP>(state, path)
+}
+
+#[op]
+pub fn op_node_unstable_net_listen_unixpacket<NP>(
+ state: &mut OpState,
+ path: String,
+) -> Result<(ResourceId, Option<String>), AnyError>
+where
+ NP: NetPermissions + 'static,
+{
+ net_listen_unixpacket::<NP>(state, path)
+}
+
pub fn pathstring(pathname: &Path) -> Result<String, AnyError> {
into_string(pathname.into())
}