change for some private functions

pull/315/head
ssrlive 2 years ago
parent b473e19f7e
commit c7735e902e
  1. 2
      src/handshake/client.rs
  2. 1
      src/handshake/machine.rs
  3. 3
      src/handshake/mod.rs
  4. 3
      src/handshake/server.rs

@ -94,7 +94,7 @@ impl<S: Read + Write> HandshakeRole for ClientHandshake<S> {
}
/// Verifies and generates a client WebSocket request from the original request and extracts a WebSocket key from it.
fn generate_request(mut request: Request) -> Result<(Vec<u8>, String)> {
pub fn generate_request(mut request: Request) -> Result<(Vec<u8>, String)> {
let mut req = Vec::new();
write!(
req,

@ -101,6 +101,7 @@ pub enum RoundResult<Obj, Stream> {
#[derive(Debug)]
pub enum StageResult<Obj, Stream> {
/// Reading round finished.
#[allow(missing_docs)]
DoneReading { result: Obj, stream: Stream, tail: Vec<u8> },
/// Writing round finished.
DoneWriting(Stream),

@ -4,7 +4,8 @@ pub mod client;
pub mod headers;
pub mod server;
mod machine;
#[allow(missing_docs)]
pub mod machine;
use std::{
error::Error as ErrorTrait,

@ -94,7 +94,8 @@ pub fn create_response_with_body<T>(
}
// Assumes that this is a valid response
fn write_response<T>(mut w: impl io::Write, response: &HttpResponse<T>) -> Result<()> {
#[allow(missing_docs)]
pub fn write_response<T>(mut w: impl io::Write, response: &HttpResponse<T>) -> Result<()> {
writeln!(
w,
"{version:?} {status}\r",

Loading…
Cancel
Save