Explorar o código

Handle the null write case

Philip Gladstone %!s(int64=8) %!d(string=hai) anos
pai
achega
f852959fa5
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      httpserver.lua

+ 3 - 3
httpserver.lua

@@ -18,9 +18,9 @@ return function (port)
 
          local function startServing(fileServeFunction, connection, req, args) 
             local bufferedConnection = {}
-            connectionThread = coroutine.create(function(fileServeFunction, connection, req, args)
-               fileServeFunction(connection, req, args)
-               if not connection:flush() then
+            connectionThread = coroutine.create(function(fileServeFunction, bconnection, req, args)
+               fileServeFunction(bconnection, req, args)
+               if not bconnection:flush() then
 	         connection:close()
                  connectionThread = nil
  	       end