Jani assigned bug 32424 to me: http://bugs.php.net/bug.php?id=32424&edit=1
I think I have the solution for that problem, but I do not know how to fix
it because it is not NSAPI specific and I do not know exactly whats going
on in output.c.
The problem:
In a normal PHP request with headers to the user it works in that way (sapi
functions called):
- sapi_nsapi_header_handler() is called for each header
- sapi_nsapi_send_headers() is called when output to client begins and
headers should be sent (NSAPI does nothing with headers here because the
webserver itsself send the header set before - but NSAPI calls the function
in webserver api to start output to client and sets the status code) - sapi_nsapi_ub_write() is called to write output
When output buffers are used and no output is sent to browser so far -
calling ob_flush flushes its internal buffers. But in all SAPI code this
flush function is always called before php_header() (in my nsapi_virtual
code, too) what calls sapi_nsapi_send_headers() - so the webserver api to
start the output is not called - iPlanet sends nothing to the client.
The problem with nsapi is the call to the webserver api to start output,
other servers like apache do not have such problems because they do not
start output explicitely:
There are two solutions:
a) Check in sapi_nsapi_ub_write() if output was initialized before (could
be done by me - but its only bad hack)
b) Fix the SAPI to correctly keep the order of SAPI calls when flushing
buffers etc.
What do you mean?
Uwe Schindler
thetaphi@php.net - http://www.php.net
NSAPI SAPI developer
Erlangen, Germany