Edit report at https://bugs.php.net/bug.php?id=60586&edit=1

 ID:                 60586
 Comment by:         lars_teuber at gmx dot de
 Reported by:        sauvant at aspera dot com
 Summary:            ignore_user_abort=true has no effect on IIS with
                     FastCGI
 Status:             Feedback
 Type:               Bug
 Package:            IIS related
 Operating System:   Windows Server 2008 R2
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Please find reproduce script below. The script stops whenever there is output 
send to a browser that is no longer listening. It will continue to run until 
you send anything. Best regards, Lars.

<?php
# reproduce for https://bugs.php.net/bug.php?id=60586
ignore_user_abort(true);
$path = sys_get_temp_dir() . '\\ignore_user_abort_' . date('Ymd_His', time());
echo $path;
flush();

$seconds = 30;
$time = time();
$i = 0;
while (time() - $time < $seconds) {
    echo '. ';
    flush();
    $i++;
}

write_file($path, 'finished (' . $i . ' iterations)');

function write_file($path, $message)
{
    $handle = fopen($path, 'wb');
    if (!$handle) {
        throw new Exception('fopen() failed');
    }
    if (fwrite($handle, $message) === false) {
        fclose($handle);
        throw new Exception('fwrite() failed');
    }
    if (!fclose($handle)) {
        throw new Exception('fclose() failed');
    }
}
?>


Previous Comments:
------------------------------------------------------------------------
[2012-06-25 05:29:50] larue...@php.net

btw: I can not reproduce this with nginx

------------------------------------------------------------------------
[2012-06-25 05:27:08] larue...@php.net

How did you identify it doesn't work?

I mean, could you give us a more specific description?

------------------------------------------------------------------------
[2012-06-25 02:51:31] futbolsalas15 at gmail dot com

I have the same issue, but in nginx server

------------------------------------------------------------------------
[2011-12-21 15:07:23] sauvant at aspera dot com

Description:
------------
ignore_user_abort=true does not to work in an IIS FastCGI environment: The 
process is stopped when sending output after the browser was closed.

Expected result:
----------------
The process should continue to run, even with the browser window being closed 
and the script sending output.

Actual result:
--------------
The process stops.


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



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

Reply via email to