Julien Allali wrote:
Then, the second call is blocked until the first call is entirely done.
Now, If I explicitly ask the browser for closing the connection:
<snip>
all work fine.
I believe the reason for this is specifically because of the connection
to one apache process. Since apache prefork just uses one
single-threaded (forked) process to handle each connection, when you
issue a connection: keep-alive header, that one process is busy handling
the first request, so the second request just sits and waits for the
first to complete. If you issue a connection: close header, it works
simply because your first request hits one apache process (which will be
busy for some time), and your second request hits an entirely different
apache process.
For other apache threading models, replace "process" above with
"thread". Same idea.
To my question is really simple:
How could I tell to php to notify apache that the response is done so
it will treat the second response hence if the first call is not
finished?
It's one process (or thread). AFAIK, it can't do that. You're asking one
thread of execution to understand (automagically) that it has to pause
execution, handle the next request, then resume the first.
Using "connection: close" does almost exactly what you need, with the
unfortunate side effect of having to re-establish a connection...Why not
just stick with that? Alternately, you might be able to spawn off
another command-line PHP process by calling system() or similar.
*I think there is no php functions/way to do so, so isn't it a bug?
(missing important
feature).
IMO, it's expected behavior.
jon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php