diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-10-18 12:30:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-18 19:30:46 +0000 |
commit | d047cab14b754d20a43c7119e327b451440aaed9 (patch) | |
tree | bc0c4567f549349c2a1ca75748a69d83bc8f6c5c /ext/http | |
parent | 4b99cde504854baabdcf912f2fce3a7448119653 (diff) |
refactor(ext/websocket): use concrete error type (#26226)
Diffstat (limited to 'ext/http')
-rw-r--r-- | ext/http/http_next.rs | 6 | ||||
-rw-r--r-- | ext/http/lib.rs | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs index abc54c899..7a6cbfa45 100644 --- a/ext/http/http_next.rs +++ b/ext/http/http_next.rs @@ -246,7 +246,11 @@ pub async fn op_http_upgrade_websocket_next( // Stage 3: take the extracted raw network stream and upgrade it to a websocket, then return it let (stream, bytes) = extract_network_stream(upgraded); - ws_create_server_stream(&mut state.borrow_mut(), stream, bytes) + Ok(ws_create_server_stream( + &mut state.borrow_mut(), + stream, + bytes, + )) } #[op2(fast)] diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 934f8a002..5461713aa 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -1053,9 +1053,11 @@ async fn op_http_upgrade_websocket( let (transport, bytes) = extract_network_stream(hyper_v014::upgrade::on(request).await?); - let ws_rid = - ws_create_server_stream(&mut state.borrow_mut(), transport, bytes)?; - Ok(ws_rid) + Ok(ws_create_server_stream( + &mut state.borrow_mut(), + transport, + bytes, + )) } // Needed so hyper can use non Send futures |