Browse Source

Add check for client disconnected after curl

nagadomi 8 năm trước cách đây
mục cha
commit
458bea7ca4
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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