aboutsummaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/net.c b/src/net.c
index fc68a91..4bb20d4 100644
--- a/src/net.c
+++ b/src/net.c
@@ -939,8 +939,10 @@ net_end:
}
parray_clear(table, STR);
}
- shutdown(client_fd, 2);
- close(client_fd);
+ if(client_fd != -1){
+ shutdown(client_fd, 2);
+ closesocket(client_fd);
+ }
free(args);
free(buffer);
lua_close(L);
@@ -953,6 +955,13 @@ net_end:
return NULL;
}
+int clean_lullaby_net(lua_State* L){
+ if(mime_type != NULL){
+ map_clear(mime_type, FREE);
+ }
+ return 0;
+}
+
int start_serv(lua_State* L, int port){
parse_mimetypes();
//need these on windows for sockets (stupid)