Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http/server: close connection on unhandled internal errors #148

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion http/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,16 @@ local function handle_socket(self, socket)
while true do
local timeout = deadline and deadline-monotime() or self.intra_stream_timeout
local stream
stream, err, errno = conn:get_next_incoming_stream(timeout)
local stream_or_err
local finished
finished, stream_or_err, err, errno = xpcall(conn.get_next_incoming_stream, debug.traceback, conn, timeout)
if not finished then -- uncaught internal error, terminate connection
err = stream_or_err
errno = ce.EFAULT
stream = nil
else
stream = stream_or_err
end
if stream == nil then
if (err ~= nil -- client closed connection
and errno ~= ce.ECONNRESET
Expand Down