Closed Al-Muhandis closed 5 years ago
This error also occurs if you make a redirect inside the request processing... For clarity: I understand the meaning of this error, but I do not know what to do with it :)
Hello @Al-Muhandis, I would like to reproduce this problem in my machine. Could you provide a minimal example (the Pascal project + HTML + JS code) to reproduce the error? Sorry for requesting it, but after some tries I can't get this error (I've tried using Postman). :disappointed:
Hello! I will try to provide a minimal example!
Hello! I will try to provide a minimal example!
Thank you. I'll try to solve the problem as soon as I reproduce it. :-)
I made an example when Ajax request is executed when clicking on the link <a>
. The long processing of the Ajax request is simulated by sleep(1000)
, but the error occurs even at lower time too. [In reality, I don't use sleep but use to demonstrate this error]
Interestingly, the type of error depends on the browser. For example, if firefox, then
Exception at 0162D260: EBrookHTTPServer:
Failed to send data in request for `/post/'.
.
If use MS Edge then
.
Exception at 0A0400A8: EBrookHTTPServer:
Connection was closed while sending response headers.
Hello @Al-Muhandis , problem confirmed. Thanks for sending the example!
Fixed in trunk. Thanks for reporting!
P.S.: it requires the latest Sagui library 2.0.
Hi @silvioprog ! BrookFramework 4.0 with sagui (legacy), http standalone server. It is a question. How to handle this error?
I often have such errors on one of my projects with webhook. Today I noticed another more simple example with this errors and it is tested on local computer and debian web server: For example, if you attach Ajax request (for click counting) to an anchor (
<a></a>
) click event, then there will be a similar error. That is, if the script make a delay before the direct jump to a new page, the error does not occur, but then the browser will try to read the Ajax response (although in my particular case it is not necessary), if the delay is removed, then the server has a similar error.Simply I assume that a similar error occurs when the client does not read the server response for some reason. This situation may arise. How to process this request correctly? Could there be a memoryleak for this reason?