Explorar el Código

Add check for client disconnected after curl

nagadomi hace 8 años
padre
commit
458bea7ca4
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      web.lua

+ 6 - 0
web.lua

@@ -308,6 +308,12 @@ function APIHandler:post()
    local style = self:get_argument("style", "art")
    local download = (self:get_argument("download", "")):len()
 
+   if client_disconnected(self) then
+      self:set_status(400)
+      self:write("client disconnected")
+      return
+   end
+
    if tta_level == 0 then
       tta_level = auto_tta_level(x, scale)
    end