summaryrefslogtreecommitdiff
path: root/ext/net/raw.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2023-05-16 01:24:41 +0200
committerGitHub <noreply@github.com>2023-05-16 01:24:41 +0200
commit27303ef688ae56008aafab513d84e39096a51e34 (patch)
tree2a8f139b0b96458bf0bbe68c263fdb8c18a7bcea /ext/net/raw.rs
parent1171c549526ba9eaa070f7d02431748f12fddf9d (diff)
refactor(ext/http): simpler ws server in http_next (#19133)
Merges `op_http_upgrade_next` and `op_ws_server_create`, significantly simplifying websocket construction in ext/http (next), and removing one JS -> Rust call. Also WS server now doesn't bypass `HttpPropertyExtractor`.
Diffstat (limited to 'ext/net/raw.rs')
-rw-r--r--ext/net/raw.rs25
1 files changed, 0 insertions, 25 deletions
diff --git a/ext/net/raw.rs b/ext/net/raw.rs
index 3f230a08b..0c92c4670 100644
--- a/ext/net/raw.rs
+++ b/ext/net/raw.rs
@@ -260,31 +260,6 @@ pub fn take_network_stream_resource(
Err(bad_resource_id())
}
-/// Inserts a raw stream (back?) into the resource table and returns a resource ID. This can then be used to create raw connection
-/// objects on the JS side.
-pub fn put_network_stream_resource(
- resource_table: &mut ResourceTable,
- stream: NetworkStream,
-) -> Result<ResourceId, AnyError> {
- let res = match stream {
- NetworkStream::Tcp(conn) => {
- let (r, w) = conn.into_split();
- resource_table.add(TcpStreamResource::new((r, w)))
- }
- NetworkStream::Tls(conn) => {
- let (r, w) = conn.into_split();
- resource_table.add(TlsStreamResource::new((r, w)))
- }
- #[cfg(unix)]
- NetworkStream::Unix(conn) => {
- let (r, w) = conn.into_split();
- resource_table.add(UnixStreamResource::new((r, w)))
- }
- };
-
- Ok(res)
-}
-
/// In some cases it may be more efficient to extract the resource from the resource table and use it directly (for example, an HTTP server).
/// This method will extract a stream from the resource table and return it, unwrapped.
pub fn take_network_stream_listener_resource(