aboutsummaryrefslogtreecommitdiff
path: root/libnet/inc/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'libnet/inc/net.h')
-rw-r--r--libnet/inc/net.h5
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;
}