Commit b7db5891cfbc336c70e8aaf0b6c233a217808ea0

Thomas de Grivel 2024-09-12T18:55:18

close socket when HTTP.Request.buf_parse returns void

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index 1526e23..8fff205 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -38,6 +38,7 @@ defmodule HTTPd do
 
   def http_client = fn (socket, events, client_ev, client) do
     if List.has?(events, :read) do
+      req = void
       req = HTTP.Request.buf_parse(client.buf_rw.r)
       if req do
         router = route_request(req)