Skip to content

Commit

Permalink
fix(http): close socket in discard_body on error occurs.
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Sep 16, 2023
1 parent 9f85bbf commit dc41aff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ function methods:discard_body()

local _, err = sock:discard(mt.body_remain, 3.0)
if err then
sock:close()
return false, err
end

Expand Down

0 comments on commit dc41aff

Please sign in to comment.