diff options
author | Marvin Borner | 2020-12-03 22:26:46 +0100 |
---|---|---|
committer | Marvin Borner | 2020-12-03 22:26:46 +0100 |
commit | cd2dbb2e146562c9e37c614bb09a24f7fbf135e0 (patch) | |
tree | 12605be6b6dfe837f1a2ebefef3cfbc1ed8536e5 /libnet/inc/net.h | |
parent | d525526f52c76156c4b9ee5ee4f14ed0d06547bc (diff) |
Quite important network stuff
Diffstat (limited to 'libnet/inc/net.h')
-rw-r--r-- | libnet/inc/net.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libnet/inc/net.h b/libnet/inc/net.h index a897f1d..1b6a17d 100644 --- a/libnet/inc/net.h +++ b/libnet/inc/net.h @@ -4,7 +4,6 @@ #define NET_H #include <dns.h> -#include <http.h> #include <ip.h> #include <print.h> #include <socket.h> @@ -48,8 +47,8 @@ static inline int net_connect(struct socket *socket, u32 ip_addr, u16 dst_port, static inline int net_close(struct socket *socket) { int res = 0; - while (!(res = (int)sys1(SYS_NET_CLOSE, (int)(socket)))) - ; + while (socket->state == S_CLOSING || !(res = (int)sys1(SYS_NET_CLOSE, (int)(socket)))) + yield(); return res; } |