Closed nitriques closed 10 years ago
Hi @nitriques,
Typo: Abroted
should be Aborted
.
Yeah I can spell that word correctly. ILooks like I commited the file before doing save. Damn. Thanks for reporting it.
I can relate. It took me three commits to change one sentence last night.
It's fixed :) Even my branch name was off at the start!
I can relate. It took me three commits to change one sentence last night.
:smile:
seems like connection_aborted() does not works. :(
It's not because the function returns 0
or 1
as opposed to a boolean, is it? I saw a comment at the PHP manual which suggested that your usage should work, though.
I did some logging server side and the value is ALWAYS zero, regarding if the connection was dropped or not. Even tried combinations of flush, ob_flush, ob_end and other variant without luck. I even did some test using static files and even apache does not cancel the request, reads the file from disk and sends it to the user. It really sucks.
This was bugging me for a long time and I have a website where this fix is absolutely crucial.
We use jit image in a way that would flood most server: We load tons of images at the same time, and most of them are canceled by the browser but php would still try do all the work, even though it does not need to.
So the fix is pretty simple, it checks regularly if the connection is open. If not, it will simply die.
I tested it a lot and it works really great. Instead of flooding the server and taking all the available RAM, the process just quits as soon as the connection is dropped.