Skip to content

Commit 67e3061

Browse files
authored
net: fix typos (#18164)
1 parent 790afbc commit 67e3061

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

vlib/net/aasocket.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn C.ntohl(net u32) u32
5353
fn C.ntohs(net u16) u16
5454

5555
// fn C.bind(sockfd int, addr &C.sockaddr, addrlen C.socklen_t) int
56-
// use voidptr for arg 2 becasue sockaddr is a generic descriptor for any kind of socket operation,
56+
// use voidptr for arg 2 because sockaddr is a generic descriptor for any kind of socket operation,
5757
// it can also take sockaddr_in depending on the type of socket used in arg 1
5858
fn C.bind(sockfd int, addr &Addr, addrlen u32) int
5959

vlib/net/ftp/ftp.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn (mut zftp FTP) pasv() !&DTP {
201201
println('pass: ${data}')
202202
}
203203
if code != ftp.passive_mode {
204-
return error('pasive mode not allowed')
204+
return error('passive mode not allowed')
205205
}
206206
dtp := new_dtp(data)!
207207
return dtp

vlib/net/ftp/ftp_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import net.ftp
22

3-
fn test_ftp_cleint() {
3+
fn test_ftp_client() {
44
$if !network ? {
55
return
66
}

vlib/net/http/request.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn (mut req Request) add_custom_header(key string, val string) ! {
5252
return req.header.add_custom(key, val)
5353
}
5454

55-
// do will send the HTTP request and returns `http.Response` as soon as the response is recevied
55+
// do will send the HTTP request and returns `http.Response` as soon as the response is received
5656
pub fn (req &Request) do() !Response {
5757
mut url := urllib.parse(req.url) or { return error('http.Request.do: invalid url ${req.url}') }
5858
mut rurl := url

vlib/net/http/server.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn (mut s Server) stop() {
7676
s.state = .stopped
7777
}
7878

79-
// close immediatly closes the port and signals the server that it has been closed.
79+
// close immediately closes the port and signals the server that it has been closed.
8080
[inline]
8181
pub fn (mut s Server) close() {
8282
s.state = .closed

vlib/net/openssl/c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module openssl
22

3-
// On Linux, prefer a localy built openssl, because it is
3+
// On Linux, prefer a locally built openssl, because it is
44
// much more likely for it to be newer, than the system
55
// openssl from libssl-dev. If there is no local openssl,
66
// the next #pkgconfig flag is harmless, since it will still

vlib/net/smtp/smtp.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn (mut c Client) expect_reply(expected ReplyCode) ! {
162162
return error('Received unexpected status code ${status}, expecting ${expected}')
163163
}
164164
} else {
165-
return error('Recieved unexpected SMTP data: ${str}')
165+
return error('Received unexpected SMTP data: ${str}')
166166
}
167167
}
168168

vlib/net/socket_options.c.v

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module net
22

33
pub enum SocketOption {
4-
// TODO: SO_ACCEPT_CONN is not here because windows doesnt support it
4+
// TODO: SO_ACCEPT_CONN is not here because windows doesn't support it
55
// and there is no easy way to define it
66
broadcast = C.SO_BROADCAST
77
debug = C.SO_DEBUG
@@ -11,9 +11,9 @@ pub enum SocketOption {
1111
linger = C.SO_LINGER
1212
oob_inline = C.SO_OOBINLINE
1313
reuse_addr = C.SO_REUSEADDR
14-
recieve_buf_size = C.SO_RCVBUF
15-
recieve_low_size = C.SO_RCVLOWAT
16-
recieve_timeout = C.SO_RCVTIMEO
14+
receive_buf_size = C.SO_RCVBUF
15+
receive_low_size = C.SO_RCVLOWAT
16+
receive_timeout = C.SO_RCVTIMEO
1717
send_buf_size = C.SO_SNDBUF
1818
send_low_size = C.SO_SNDLOWAT
1919
send_timeout = C.SO_SNDTIMEO
@@ -24,9 +24,9 @@ pub enum SocketOption {
2424
const (
2525
opts_bool = [SocketOption.broadcast, .debug, .dont_route, .error, .keep_alive, .oob_inline]
2626
opts_int = [
27-
.recieve_buf_size,
28-
.recieve_low_size,
29-
.recieve_timeout,
27+
.receive_buf_size,
28+
.receive_low_size,
29+
.receive_timeout,
3030
.send_buf_size,
3131
.send_low_size,
3232
.send_timeout,
@@ -39,9 +39,9 @@ const (
3939
.keep_alive,
4040
.linger,
4141
.oob_inline,
42-
.recieve_buf_size,
43-
.recieve_low_size,
44-
.recieve_timeout,
42+
.receive_buf_size,
43+
.receive_low_size,
44+
.receive_timeout,
4545
.send_buf_size,
4646
.send_low_size,
4747
.send_timeout,

vlib/net/urllib/urllib.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ fn get_scheme(rawurl string) !string {
415415
return split[0]
416416
}
417417

418-
// split slices s into two substrings separated by the first occurence of
418+
// split slices s into two substrings separated by the first occurrence of
419419
// sep. If cutc is true then sep is included with the second substring.
420420
// If sep does not occur in s then s and the empty string is returned.
421421
fn split(s string, sep u8, cutc bool) (string, string) {

vlib/net/websocket/message.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn (mut ws Client) read_payload(frame &Frame) ![]u8 {
112112
fn (mut ws Client) validate_utf_8(opcode OPCode, payload []u8) ! {
113113
if opcode in [.text_frame, .close] && !utf8.validate(payload.data, payload.len) {
114114
ws.logger.error('malformed utf8 payload, payload len: (${payload.len})')
115-
ws.send_error_event('Recieved malformed utf8.')
115+
ws.send_error_event('Received malformed utf8.')
116116
ws.close(1007, 'malformed utf8 payload')!
117117
return error('malformed utf8 payload')
118118
}
@@ -180,7 +180,7 @@ pub fn (mut ws Client) read_next_message() !Message {
180180
return error('none')
181181
}
182182

183-
// payload_from_fragments returs the whole paylaod from fragmented message
183+
// payload_from_fragments returns the whole paylaod from fragmented message
184184
fn (ws Client) payload_from_fragments(fin_payload []u8) ![]u8 {
185185
mut total_size := 0
186186
for f in ws.fragments {
@@ -231,7 +231,7 @@ pub fn (mut ws Client) parse_frame_header() !Frame {
231231
frame.opcode = unsafe { OPCode(int(buffer[0] & 0x7F)) }
232232
frame.has_mask = (buffer[1] & 0x80) == 0x80
233233
frame.payload_len = buffer[1] & 0x7F
234-
// if has mask set the byte postition where mask ends
234+
// if the frame has a mask, set the byte position where the mask ends
235235
if frame.has_mask {
236236
mask_end_byte = if frame.payload_len < 126 {
237237
websocket.header_len_offset + 4

0 commit comments

Comments
 (0)