Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ext/websocket): use concrete error type #26226

Merged
merged 13 commits into from
Oct 18, 2024
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion ext/http/http_next.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
8 changes: 5 additions & 3 deletions ext/http/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ hyper-util.workspace = true
once_cell.workspace = true
rustls-tokio-stream.workspace = true
serde.workspace = true
thiserror.workspace = true
tokio.workspace = true
Loading
Loading