diff --git a/docs/PROPOSAL.md b/docs/PROPOSAL.md index 41cac540..4aeddba6 100644 --- a/docs/PROPOSAL.md +++ b/docs/PROPOSAL.md @@ -5,7 +5,7 @@ This describes an effort to provide HTTP/3 support for the [hyper.rs](http://hyp ## 1. Goals -What would be the goals of this effort, and what wouldn’t be. +What would be the goals of this effort, and what wouldn't be. - Provide a standalone HTTP/3 crate. - This is similar to what we did with `h2`. This allows folks that want more control over HTTP/3 specifically to be able to do so. Or people may wish to reduce their dependencies to the bare minimum, and thus don’t want to include crates supporting HTTP/1 and 2 (like `hyper` does). diff --git a/examples/webtransport_server.rs b/examples/webtransport_server.rs index 0698f091..d9a480fe 100644 --- a/examples/webtransport_server.rs +++ b/examples/webtransport_server.rs @@ -141,7 +141,7 @@ async fn main() -> Result<(), Box> { // WebTransportSession::accept(h3_conn).await.unwrap(); // tracing::info!("Finished establishing webtransport session"); // // 4. Get datagrams, bidirectional streams, and unidirectional streams and wait for client requests here. - // // h3_conn needs to handover the datagrams, bidirectional streams, and unidirectional streams to the webtransport session. + // // h3_conn needs to hand over the datagrams, bidirectional streams, and unidirectional streams to the webtransport session. // let result = handle.await; } Err(err) => { @@ -177,7 +177,7 @@ async fn handle_connection(mut conn: Connection, Byt let session = WebTransportSession::accept(req, stream, conn).await?; tracing::info!("Established webtransport session"); // 4. Get datagrams, bidirectional streams, and unidirectional streams and wait for client requests here. - // h3_conn needs to handover the datagrams, bidirectional streams, and unidirectional streams to the webtransport session. + // h3_conn needs to hand over the datagrams, bidirectional streams, and unidirectional streams to the webtransport session. handle_session_and_echo_all_inbound_messages(session).await?; return Ok(()); diff --git a/h3/src/client/connection.rs b/h3/src/client/connection.rs index 01ec7e16..26a154be 100644 --- a/h3/src/client/connection.rs +++ b/h3/src/client/connection.rs @@ -34,7 +34,7 @@ use super::stream::RequestStream; /// This struct is cloneable so multiple requests can be sent concurrently. /// /// Existing instances are atomically counted internally, so whenever all of them have been -/// dropped, the connection will be automatically closed whith HTTP/3 connection error code +/// dropped, the connection will be automatically closed with HTTP/3 connection error code /// `HTTP_NO_ERROR = 0`. /// /// # Examples @@ -120,7 +120,7 @@ where T: quic::OpenStreams, B: Buf, { - /// Send a HTTP/3 request to the server + /// Send an HTTP/3 request to the server pub async fn send_request( &mut self, req: http::Request<()>, @@ -247,9 +247,9 @@ where /// Client connection driver /// /// Maintains the internal state of an HTTP/3 connection, including control and QPACK. -/// It needs to be polled continously via [`poll_close()`]. On connection closure, this +/// It needs to be polled continuously via [`poll_close()`]. On connection closure, this /// will resolve to `Ok(())` if the peer sent `HTTP_NO_ERROR`, or `Err()` if a connection-level -/// error occured. +/// error occurred. /// /// [`shutdown()`] initiates a graceful shutdown of this connection. After calling it, no request /// initiation will be further allowed. Then [`poll_close()`] will resolve when all ongoing requests @@ -258,7 +258,7 @@ where /// /// # Examples /// -/// ## Drive a connection concurrenty +/// ## Drive a connection concurrently /// /// ```rust /// # use bytes::Buf; @@ -318,7 +318,7 @@ where /// Ok::<(), Box>(()) /// }); /// -/// // Do client things, wait for close contition... +/// // Do client things, wait for close condition... /// /// // Initiate shutdown /// shutdown_tx.send(2); diff --git a/h3/src/connection.rs b/h3/src/connection.rs index 51a2c603..6c4957bc 100644 --- a/h3/src/connection.rs +++ b/h3/src/connection.rs @@ -606,7 +606,7 @@ where Poll::Pending => return Poll::Pending, Poll::Ready(Err(_)) => { // could not create grease stream - // dont try again + // don't try again self.send_grease_stream_flag = false; warn!("grease stream creation failed with"); return Poll::Ready(()); @@ -641,7 +641,7 @@ where Poll::Pending => return Poll::Pending, Poll::Ready(Err(_)) => { // could not write grease frame - // dont try again + // don't try again self.send_grease_stream_flag = false; warn!("write data on grease stream failed with"); return Poll::Ready(()); @@ -668,7 +668,7 @@ where Poll::Pending => return Poll::Pending, Poll::Ready(Err(_)) => { // could not finish grease stream - // dont try again + // don't try again self.send_grease_stream_flag = false; warn!("finish grease stream failed with"); return Poll::Ready(()); @@ -678,7 +678,7 @@ where }; // grease stream is closed - // dont do another one + // don't do another one self.send_grease_stream_flag = false; Poll::Ready(()) } @@ -899,7 +899,7 @@ where Ok(()) } - /// Stops an stream with an error code + /// Stops a stream with an error code pub fn stop_stream(&mut self, code: Code) { self.stream.reset(code.into()); } diff --git a/h3/src/error.rs b/h3/src/error.rs index b622262c..053ab611 100644 --- a/h3/src/error.rs +++ b/h3/src/error.rs @@ -233,7 +233,7 @@ impl Error { } /// returns the [`ErrorLevel`] of an [`Error`] - /// This indicates weather a accept loop should continue. + /// This indicates weather an accept loop should continue. pub fn get_error_level(&self) -> ErrorLevel { match self.inner.kind { Kind::Application { diff --git a/h3/src/proto/frame.rs b/h3/src/proto/frame.rs index 71a8baf4..fcebcd84 100644 --- a/h3/src/proto/frame.rs +++ b/h3/src/proto/frame.rs @@ -559,7 +559,7 @@ impl fmt::Display for SettingsError { match self { SettingsError::Exceeded => write!( f, - "max settings number exeeded, check for duplicate entries" + "max settings number exceeded, check for duplicate entries" ), SettingsError::Malformed => write!(f, "malformed settings frame"), SettingsError::Repeated(id) => write!(f, "got setting 0x{:x} twice", id.0), diff --git a/h3/src/proto/headers.rs b/h3/src/proto/headers.rs index ea348045..b251723d 100644 --- a/h3/src/proto/headers.rs +++ b/h3/src/proto/headers.rs @@ -94,7 +94,7 @@ impl Header { Ok(( self.pseudo.method.ok_or(HeaderError::MissingMethod)?, - // When empty host field is built into a uri it fails + // When empty host field is built into an uri it fails //= https://www.rfc-editor.org/rfc/rfc9114#section-4.3.1 //# If these fields are present, they MUST NOT be //# empty. diff --git a/h3/src/qpack/prefix_string/encode.rs b/h3/src/qpack/prefix_string/encode.rs index bf3aca70..ccdb001f 100644 --- a/h3/src/qpack/prefix_string/encode.rs +++ b/h3/src/qpack/prefix_string/encode.rs @@ -46,7 +46,7 @@ impl HuffmanEncoder { let forward = end_range.byte as usize - self.buffer.len() + if end_range.bit > 0 { 1 } else { 0 }; for _ in 0..forward { - // push filler value that will ends huffman decoding if not + // push filler value that will end huffman decoding if not // modified self.buffer.push(255); } diff --git a/h3/src/qpack/vas.rs b/h3/src/qpack/vas.rs index 010c858e..5fccbfef 100644 --- a/h3/src/qpack/vas.rs +++ b/h3/src/qpack/vas.rs @@ -7,7 +7,7 @@ /* * # Virtually infinite address space mapper. * - * It can be described as a infinitively growable list, with a visibility + * It can be described as an infinitive growable list, with a visibility * window that can only move in the direction of insertion. * * Origin Visible window @@ -34,7 +34,7 @@ * pos: real index in memory container * pst: post-base relative index (only with base index) * - * first oldest lastest + * first oldest latest * element insertion insertion * (not available available * available) | | @@ -52,7 +52,7 @@ * * # Base index * A base index can arbitrary shift the relative index. - * The base index itself is a absolute index. + * The base index itself is an absolute index. * * base index: 17 * | diff --git a/h3/src/quic.rs b/h3/src/quic.rs index f73c735f..d4d6790b 100644 --- a/h3/src/quic.rs +++ b/h3/src/quic.rs @@ -141,7 +141,7 @@ pub trait SendStream { /// Allows sending unframed pure bytes to a stream. Similar to [`AsyncWrite`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncWrite.html) pub trait SendStreamUnframed: SendStream { - /// Attempts write data into the stream. + /// Attempts to write data into the stream. /// /// Returns the number of bytes written. /// @@ -162,7 +162,7 @@ pub trait RecvStream { /// Poll the stream for more data. /// - /// When the receive side will no longer receive more data (such as because + /// When the receiving side will no longer receive more data (such as because /// the peer closed their sending side), this should return `None`. fn poll_data( &mut self, diff --git a/h3/src/server/connection.rs b/h3/src/server/connection.rs index 32936c6a..8279496b 100644 --- a/h3/src/server/connection.rs +++ b/h3/src/server/connection.rs @@ -148,7 +148,7 @@ where } } - /// Accepts an http request where the first frame has already been read and decoded. + /// Accepts a http request where the first frame has already been read and decoded. /// /// /// This is needed as a bidirectional stream may be read as part of incoming webtransport diff --git a/h3/src/server/request.rs b/h3/src/server/request.rs index b70e3dfa..19c379d8 100644 --- a/h3/src/server/request.rs +++ b/h3/src/server/request.rs @@ -9,7 +9,7 @@ use super::stream::RequestStream; pub struct ResolveRequest, B: Buf> { request_stream: RequestStream, - // Ok or `REQUEST_HEADER_FIELDS_TO_LARGE` which neeeds to be sent + // Ok or `REQUEST_HEADER_FIELDS_TO_LARGE` which needs to be sent decoded: Result, max_field_section_size: u64, } diff --git a/h3/src/tests/connection.rs b/h3/src/tests/connection.rs index e63acea9..9ca89fd2 100644 --- a/h3/src/tests/connection.rs +++ b/h3/src/tests/connection.rs @@ -104,7 +104,7 @@ async fn server_drop_close() { } // In this test the client calls send_data() without doing a finish(), -// i.e client keeps the body stream open. And cient expects server to +// i.e client keeps the body stream open. And client expects server to // read_data() and send a response #[tokio::test] async fn server_send_data_without_finish() { @@ -385,7 +385,7 @@ async fn control_close_send_error() { //# error of type H3_CLOSED_CRITICAL_STREAM. control_stream.finish().unwrap(); // close the client control stream immediately - // create the Connection manually so it does not open a second Control stream + // create the Connection manually, so it does not open a second Control stream let connection_error = loop { let accepted = connection.accept_bi().await; diff --git a/h3/src/tests/request.rs b/h3/src/tests/request.rs index 2001b0b3..7262c454 100644 --- a/h3/src/tests/request.rs +++ b/h3/src/tests/request.rs @@ -857,7 +857,7 @@ async fn get_timeout_client_recv_response() { let mut incoming_req = server::Connection::new(conn).await.unwrap(); // _req must not be dropped, else the connection will be closed and the timeout - // wont be triggered + // won't be triggered let _req = incoming_req.accept().await.expect("accept").unwrap(); tokio::time::sleep(Duration::from_millis(500)).await; };