* libs/httpd: Fixed a memleak
authorSteven Barth <steven@midlink.org>
Tue, 1 Jul 2008 18:05:48 +0000 (18:05 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 1 Jul 2008 18:05:48 +0000 (18:05 +0000)
libs/httpd/luasrc/httpd.lua

index 8b54f0e645810671793c6e550a33d70d5ea4efa3..9263dcc6d8e59cd7f74fae7bc511ed1029e0b39c 100644 (file)
@@ -87,7 +87,6 @@ end
 
 function step()
        local idle = true
-               
        if not THREAD_LIMIT or threadc < THREAD_LIMIT then
                local now = os.time()
                for i, server in ipairs(reading) do
@@ -106,6 +105,8 @@ function step()
                if coroutine.status(thread) == "dead" then
                        threads[client] = nil
                        threadc = threadc - 1
+                       threadm[client] = nil
+                       threadi[client] = nil
                elseif threadm[client] and threadm[client] + THREAD_TIMEOUT < now then
                        threads[client] = nil
                        threadc = threadc - 1   
@@ -119,4 +120,4 @@ function step()
        if idle then
                socket.sleep(THREAD_IDLEWAIT)
        end
-end
\ No newline at end of file
+end