Skip to content

Commit 9d77f58

Browse files
committed
docs: fix spelling mistakes and whitelist correct words
1 parent 2cd7743 commit 9d77f58

8 files changed

Lines changed: 41 additions & 28 deletions

File tree

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"cSpell.words": [
3+
"gosredirector",
4+
"PKCS",
5+
"Redirector",
6+
"repr",
7+
"reqwest",
8+
"SECU",
9+
"splitn",
10+
"VALU",
11+
"XDNS"
12+
]
13+
}

src/api.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ mod headers {
3333
/// Header used for association tokens
3434
pub const ASSOCIATION: &str = "x-association";
3535

36-
/// Legacy header used to derive the server scheme (Exists only for backwards compatability)
36+
/// Legacy header used to derive the server scheme (Exists only for backwards compatibility)
3737
pub const LEGACY_SCHEME: &str = "x-pocket-relay-scheme";
38-
/// Legacy header used to derive the server host (Exists only for backwards compatability)
38+
/// Legacy header used to derive the server host (Exists only for backwards compatibility)
3939
pub const LEGACY_HOST: &str = "x-pocket-relay-host";
40-
/// Legacy header used to derive the server port (Exists only for backwards compatability)
40+
/// Legacy header used to derive the server port (Exists only for backwards compatibility)
4141
pub const LEGACY_PORT: &str = "x-pocket-relay-port";
4242
/// Legacy header telling the server to use local http routing
4343
/// (Existing only for backwards compat, this is the default behavior for newer versions)
@@ -157,7 +157,7 @@ pub async fn lookup_server(
157157

158158
url.push_str(&host);
159159

160-
// Ensure theres a trailing slash (URL path will be interpeted incorrectly without)
160+
// Ensure theres a trailing slash (URL path will be interpreted incorrectly without)
161161
if !url.ends_with('/') {
162162
url.push('/');
163163
}
@@ -216,12 +216,12 @@ pub async fn lookup_server(
216216
));
217217
}
218218

219-
// Debug logging association aquire
219+
// Debug logging association acquire
220220
#[cfg(debug_assertions)]
221221
{
222222
use log::debug;
223223
if let Some(association) = &details.association {
224-
debug!("Aquired association token: {}", association);
224+
debug!("Acquired association token: {}", association);
225225
}
226226
}
227227

@@ -267,7 +267,7 @@ pub async fn create_server_stream(
267267
let mut headers: HeaderMap<HeaderValue> = [
268268
(header::CONNECTION, HeaderValue::from_static("Upgrade")),
269269
(header::UPGRADE, HeaderValue::from_static("blaze")),
270-
// Headers for legacy compatability
270+
// Headers for legacy compatibility
271271
(
272272
HeaderName::from_static(headers::LEGACY_SCHEME),
273273
HeaderValue::from_static("http"),
@@ -348,7 +348,7 @@ pub async fn publish_telemetry_event(
348348
Ok(())
349349
}
350350

351-
/// Errors that could occur when proxying a request
351+
/// Errors that could occur in the proxy process
352352
#[derive(Debug, Error)]
353353
pub enum ProxyError {
354354
/// Initial HTTP request failure

src/fire.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl Decoder for FireCodec {
125125
// Use the existing frame
126126
current_frame
127127
} else {
128-
// Ensure there is atleast enough bytes for the header
128+
// Ensure there is at least enough bytes for the header
129129
if src.len() < Self::MIN_HEADER_SIZE {
130130
return Ok(None);
131131
}

src/servers/http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ pub async fn start_http_server(ctx: Arc<ClientContext>) -> std::io::Result<()> {
4242
.map_err(|err| std::io::Error::new(ErrorKind::Other, err))
4343
}
4444

45-
/// Handles an HTTP request from the HTTP server proxying it along
46-
/// to the Pocket Relay server
45+
/// Handles an HTTP request from the HTTP acting as a proxy
46+
/// for the Pocket Relay server
4747
///
4848
/// ## Arguments
4949
/// * `request` - The HTTP request

src/servers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn has_server_tasks() -> bool {
3737
!values.is_empty()
3838
}
3939

40-
/// Spawns a server related task future onto tokios runtime and
40+
/// Spawns a server related task future onto the tokio runtime and
4141
/// adds the abort handle for the task to the task collection
4242
///
4343
/// ## Arguments

src/servers/qos.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Quality of Service server implementation, this is a pretty crude implementation
2-
//! but it atleast allows clients to sometimes obtain the correct address, usually
2+
//! but it at least allows clients to sometimes obtain the correct address, usually
33
//! the server can fix it
44
55
use super::{spawn_server_task, QOS_PORT};
@@ -24,7 +24,7 @@ pub async fn start_qos_server() -> std::io::Result<()> {
2424
// Accept messages
2525
loop {
2626
let (count, addr) = socket.recv_from(&mut buffer).await?;
27-
// Create an array from the data that was recieved
27+
// Create an array from the data that was received
2828
let buffer: Box<[u8]> = Box::from(&buffer[..count]);
2929

3030
spawn_server_task(handle(socket.clone(), addr, buffer));
@@ -36,7 +36,7 @@ pub async fn start_qos_server() -> std::io::Result<()> {
3636
/// ## Arguments
3737
/// * `socket` - The UDP socket used for sending the responses
3838
/// * `socket_addr` - The socket address of the connection (Target for the response)
39-
/// * `buffer` - Buffer of bytes recieved from the socket
39+
/// * `buffer` - Buffer of bytes received from the socket
4040
async fn handle(socket: Arc<UdpSocket>, socket_addr: SocketAddr, buffer: Box<[u8]>) {
4141
// Extract the IPv4 address from the socket address (Fallback to 0.0.0.0)
4242
let socket_ip = match socket_addr {
@@ -95,7 +95,7 @@ async fn public_address() -> Option<Ipv4Addr> {
9595
}
9696
}
9797

98-
// Hold the write lock to prevent others from attempting to update aswell
98+
// Hold the write lock to prevent others from attempting to update as well
9999
let cached = &mut *PUBLIC_ADDR_CACHE.write().await;
100100

101101
// API addresses for IP lookup

src/servers/tunnel.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ async fn create_tunnel(ctx: Arc<ClientContext>, association: &str) -> std::io::R
123123
Ok(())
124124
}
125125

126-
/// Represents a tunnel and its pool of conenctions that it can
127-
/// send data to and receieve data from
126+
/// Represents a tunnel and its pool of connections that it can
127+
/// send data to and receive data from
128128
struct Tunnel {
129129
/// Tunnel connection to the Pocket Relay server for sending [`TunnelMessage`]s
130130
/// through the server to reach a specific peer
@@ -149,15 +149,15 @@ enum TunnelWriteState {
149149
Write(Option<TunnelMessage>),
150150
/// Poll flushing the bytes written to [`Tunnel::io`]
151151
Flush,
152-
/// The tunnnel has stopped and should not continue
152+
/// The tunnel has stopped and should not continue
153153
Stop,
154154
}
155155

156156
/// Holds the state for the current reading progress for a [`Tunnel`]
157157
enum TunnelReadState {
158158
/// Continue reading
159159
Continue,
160-
/// The tunnnel has stopped and should not continue
160+
/// The tunnel has stopped and should not continue
161161
Stop,
162162
}
163163

@@ -274,16 +274,16 @@ struct SocketHandle(mpsc::UnboundedSender<TunnelMessage>);
274274
/// Size of the socket read buffer 2^16 bytes
275275
///
276276
/// Can likely be reduced to 2^15 bytes or 2^13 bytes (or lower) since
277-
/// highest observed message length was 1254 bytes but testing is requried
277+
/// highest observed message length was 1254 bytes but testing is required
278278
/// before that can take place
279279
const READ_BUFFER_LENGTH: usize = 2usize.pow(16);
280280

281-
/// Socket used by a [`Tunnel`] for sending and recieving messages in
281+
/// Socket used by a [`Tunnel`] for sending and receiving messages in
282282
/// order to simulate another player on the local network
283283
struct Socket {
284284
// Index of the socket
285285
index: u8,
286-
// The underlying socket for sending and recieving
286+
// The underlying socket for sending and receiving
287287
socket: UdpSocket,
288288
/// Receiver for messages coming from the the [`Tunnel`] that need to be
289289
/// send through the socket
@@ -305,15 +305,15 @@ enum SocketWriteState {
305305
Recv,
306306
/// Waiting for the [`Socket::socket`] to write the bytes
307307
Write(Bytes),
308-
/// The tunnnel has stopped and should not continue
308+
/// The tunnel has stopped and should not continue
309309
Stop,
310310
}
311311

312312
/// Holds the state for the current reading progress for a [`Socket`]
313313
enum SocketReadState {
314314
/// Continue reading
315315
Continue,
316-
/// The tunnnel has stopped and should not continue
316+
/// The tunnel has stopped and should not continue
317317
Stop,
318318
}
319319

@@ -392,7 +392,7 @@ impl Socket {
392392
return Poll::Ready(SocketWriteState::Stop);
393393
};
394394

395-
// Didnt write entire messsage
395+
// Didn't write the entire message
396396
if count != message.len() {
397397
// Continue with a writing state at the remaining message
398398
let message = message.slice(count..);
@@ -420,7 +420,7 @@ impl Socket {
420420
return Poll::Ready(SocketReadState::Stop);
421421
}
422422

423-
// Get the recieved message
423+
// Get the received message
424424
let bytes = read_buf.filled();
425425
let message = Bytes::copy_from_slice(bytes);
426426
let message = TunnelMessage {

src/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct GitHubRelease {
1313
pub tag_name: String,
1414
/// The name of the release (Usually the same as tag_name)
1515
pub name: String,
16-
/// The datetime the release was published
16+
/// The date & time the release was published
1717
pub published_at: String,
1818
/// The release assets
1919
pub assets: Vec<GitHubReleaseAsset>,

0 commit comments

Comments
 (0)