Software /
code /
prosody
Comparison
net/http/server.lua @ 13341:407174990ab0
net.http.server: Complete async waiter for non-persistent connections
Otherwise requests with Connection: close would be stuck in the async
wait that starts after the handle_request() call.
Together with the new async debugging, this makes the async thread stay
in the set of waiting runners forever, where previously it would simply
be garbage collected.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Nov 2023 00:31:08 +0100 |
parent | 13261:7c62370dee9a |
child | 13380:d53dd83a9944 |
comparison
equal
deleted
inserted
replaced
13340:92b7ccc76c3a | 13341:407174990ab0 |
---|---|
405 response.conn._http_open_response = nil; | 405 response.conn._http_open_response = nil; |
406 if response.on_destroy then | 406 if response.on_destroy then |
407 response:on_destroy(); | 407 response:on_destroy(); |
408 response.on_destroy = nil; | 408 response.on_destroy = nil; |
409 end | 409 end |
410 if response.persistent then | 410 response:finish_cb(); |
411 response:finish_cb(); | 411 if not response.persistent then |
412 else | |
413 response.conn:close(); | 412 response.conn:close(); |
414 end | 413 end |
415 end | 414 end |
416 function _M.add_handler(event, handler, priority) | 415 function _M.add_handler(event, handler, priority) |
417 events.add_handler(event, handler, priority); | 416 events.add_handler(event, handler, priority); |