Skip to content

Commit 14e6cc1

Browse files
committed
ops
1 parent 876bb38 commit 14e6cc1

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

vlib/fasthttp/fasthttp_default.v

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,25 @@ const tiny_bad_request_response = 'HTTP/1.1 400 Bad Request\r\nContent-Length: 0
2323
const status_444_response = 'HTTP/1.1 444 No Response\r\nContent-Length: 0\r\nConnection: close\r\n\r\n'.bytes()
2424
const status_413_response = 'HTTP/1.1 413 Payload Too Large\r\nContent-Length: 0\r\nConnection: close\r\n\r\n'.bytes()
2525

26-
$if !windows {
27-
fn C.socket(domain net.AddrFamily, typ net.SocketType, protocol int) int
26+
fn C.socket(domain net.AddrFamily, typ net.SocketType, protocol int) int
2827

29-
fn C.bind(sockfd int, addr &net.Addr, addrlen u32) int
28+
fn C.bind(sockfd int, addr &net.Addr, addrlen u32) int
3029

31-
fn C.send(__fd int, __buf voidptr, __n usize, __flags int) int
30+
fn C.send(__fd int, __buf voidptr, __n usize, __flags int) int
3231

33-
fn C.recv(__fd int, __buf voidptr, __n usize, __flags int) int
32+
fn C.recv(__fd int, __buf voidptr, __n usize, __flags int) int
3433

35-
fn C.setsockopt(__fd int, __level int, __optname int, __optval voidptr, __optlen u32) int
34+
fn C.setsockopt(__fd int, __level int, __optname int, __optval voidptr, __optlen u32) int
3635

37-
fn C.listen(__fd int, __n int) int
36+
fn C.listen(__fd int, __n int) int
3837

39-
fn C.perror(s &u8)
38+
fn C.perror(s &u8)
4039

41-
fn C.close(fd int) int
40+
fn C.close(fd int) int
4241

43-
fn C.htons(__hostshort u16) u16
42+
fn C.htons(__hostshort u16) u16
4443

45-
fn C.fcntl(fd int, cmd int, arg int) int
46-
}
44+
fn C.fcntl(fd int, cmd int, arg int) int
4745

4846
pub struct Slice {
4947
pub:
@@ -106,7 +104,7 @@ pub fn new_server(config ServerConfig) !&Server {
106104
fn set_blocking(fd int, blocking bool) {
107105
$if windows {
108106
t := if blocking { u32(0) } else { u32(1) }
109-
C.ioctlsocket(fd, fionbio, &t)
107+
C.ioctlsocket(fd, C.FIONBIO, &t)
110108
} $else {
111109
flags := C.fcntl(fd, C.F_GETFL, 0)
112110
if flags == -1 {

vlib/fasthttp/fasthttp_windows.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module fasthttp
22

3+
#flag -lws2_32
34
#include <winsock2.h>
45
#include <ws2tcpip.h>

0 commit comments

Comments
 (0)