#1651 prosody1@thax.hardliners.org

Reporter TobiasH
Owner Nobody
Stars ★ (1)
  • Type-Defect
  • Status-New
  • Priority-Medium
  1. TobiasH on

    What steps will reproduce the problem? - I'm not exactly sure how to best trigger this. - For some reason not understood yet this did not happen in our software stack in the past. What is the expected output? - net.http.server calls response:on_destroy only once for a given response/connection. What do you see instead? - It is sometimes called twice (could possibly be even more often, as listerner.ondisconnect seems to be possibly called multiple times. What version of the product are you using? On what operating system? Prosody 0.11.8 Linux Please provide any additional information below. 1. Here it works: https://github.com/bjc/prosody/blob/master/net/http/server.lua#L392 response.finished is checked, also response.on_destroy is set to nil 2. Here it does not work (although re-invocation via 1. is prevented): https://github.com/bjc/prosody/blob/master/net/http/server.lua#L148 This sets .finished, but, when invoked multiple times (which does happen, I'm just not sure, how to best reproduce this), will call on_destroy *each time*. Any module code (in our case, a custom mod_eventsource provider used by a custom event logging module) hooking on_destroy has no benefit from being called multiple times.

New comment

Not published. Used for spam prevention and optional update notifications.