Commit 5b29ac2a488aee9c9f7cfcd5a307366aadfb4a4d

Thomas de Grivel 2024-09-12T18:52:46

close socket when HTTP.Request.buf_parse returns void

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index 805dfa3..1526e23 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -52,6 +52,9 @@ defmodule HTTPd do
           if (real_ip) do real_ip else client.addr_str end
         end
         puts("#{response.code} #{client_addr} #{req.method} #{req.url}")
+      else
+        Event.del(client_ev)
+        Socket.close(socket)
       end
     end
   end