@@ -23,27 +23,25 @@ const tiny_bad_request_response = 'HTTP/1.1 400 Bad Request\r\nContent-Length: 0
2323const status_444_response = 'HTTP/1.1 444 No Response\r\n Content-Length: 0\r\n Connection: close\r\n\r\n ' .bytes ()
2424const status_413_response = 'HTTP/1.1 413 Payload Too Large\r\n Content-Length: 0\r\n Connection: 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
4846pub struct Slice {
4947pub :
@@ -106,7 +104,7 @@ pub fn new_server(config ServerConfig) !&Server {
106104fn 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 {
0 commit comments