ID:               15209
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Verified
 Bug Type:         Scripting Engine problem
 Operating System: RH Linux 7.2
 PHP Version:      4.3.0-dev
 New Comment:

The following script will cause IE to stop loading the page when
zlib.output_compression is used.  This was not true before the changes
to register_shutdown_function as the output was not sent.

You can see a test at http://dealnews.com/zlibshutdown.php.  Mozilla
gracefully handles the mixed output by truncating the non-compressed
data.

================================
<?php

register_shutdown_function("shutdown_test");

?>

<html>
<head>
<title></title>
</head>
<body bgcolor="#ffffff" leftmargin="8" topmargin="8" marginheight="8"
marginwidth="8">
This is in the HTML body.

<?php

function shutdown_test()
{
    echo "This is the shutdown function.";
}

?>

</body>
</html>


Previous Comments:
------------------------------------------------------------------------

[2002-12-12 11:37:31] [EMAIL PROTECTED]

I gave up on my patch.  Too much work, not enought time, and
ultimately, I couldn't find a place in PHP land where PHP was still
running and Apache had closed the connection to put my hooks in.  There
may be a way to tell Apache to close the connection through SAPI, but I
am not aware of it.  (I'm not an apache hacker).  Someone posted a way
to fork a process to the background, but it isn't a PHP land solution.

>From Carsten Gehling:
Maybe this is what you need?

http://www.naken.cc/mikehup.php

I use this on a CMS site, where the users upload imagefiles with ftp.
After
that, they use a php webinterface to start an importscript (written in
Perl). By doing this command in php:

system("/usr/local/bin/mikehup /usr/bin/perl
/www/servers/netlag/cronscripts/import_billede.pl &");

The importscript is started and executes in the background while the
php-script finishes execution.

Hope that helps

- Carsten

------------------------------------------------------------------------

[2002-12-12 10:06:43] [EMAIL PROTECTED]

I copy my mail sent to the dev list here too, to make it more
noticable:

I know there was some hot discussion about this topic but I really need
to
get
this bug fixed. Even I'll make a patch with my zero knowledge of c if
no one
would like to make it, but please try to find a reasonable sollution
that
fits (almost) everyone's need.

I thought of one. I think a new function with the name
register_apache_shutdown_function (or somethink like this) might be
good.
It's name would say that it only works in apache, it could be
documented
that
it's the *only* function that closes the connection before the
registered
functions are handled. Or maybe a parameter could tell if the
connection
should be closed before the first registered function is started.

I'll hope there's some way to solve this problem, because it's not easy
to
tell every customer to use our patch (or use 4.0.6) before they are
staring
to use our programs that rely on this forgotten feature.
Thanks,
Arpi

------------------------------------------------------------------------

[2002-12-11 08:30:38] [EMAIL PROTECTED]

Changing to 'Verified', since there is some disagreement on how this
function should operate.

------------------------------------------------------------------------

[2002-10-12 10:21:46] [EMAIL PROTECTED]

Marking as critical since this worked at some point.
And there was also posting by [EMAIL PROTECTED] with a possible
fix on [EMAIL PROTECTED]



------------------------------------------------------------------------

[2002-10-04 07:44:12] [EMAIL PROTECTED]

I grabbed a snapshot today (php4-200210040300).  I jtate's script, and
still got the erroneous (IMO) behavior.  My connection to the server
did not close until the shutdown function completed.  

Looking at the suspect section of sapi_apache.c, I do not see any
changes.  Not that I expected to see my patch verbatim, but I would
expect something in that vicinity to change.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/15209

-- 
Edit this bug report at http://bugs.php.net/?id=15209&edit=1

Reply via email to