ID:               21764
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         IMAP related
 Operating System: Linux 2.4.18-SMP
 PHP Version:      4.2.3
 New Comment:

I think this is expected though, and I dont really consider it as a
bug. Try returning the resource by reference, or not using that global.
Does it work then?


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

[2003-01-20 02:45:07] [EMAIL PROTECTED]

Script:
<?

$MailStream = 0;
function foo()
{
        global $MailStream;
        $ar = imap_open("{some.host/pop3:110}", "user", "pass");
        $MailStream = $ar;

        return $ar;
}

$arr = foo();
imap_close($arr);
sleep(4);
die();

?>

will not close my connection to mailserver when calling function
imap_close. 
In mailserver log the following lines indicate that the stream is not
closed:

Jan 20 10:28:46 mail-fe73 pop3d: LOGIN, user=suurjuht,
ip=[::ffff:xxx.xxx.xxx.xxx]
Jan 20 10:28:50 mail-fe73 pop3d: LOGOUT, user=suurjuht,
ip=[::ffff:xxx.xxx.xxx.xxx], top=0, retr=0

Notice the 4 second delay when user is logged out. In closes the
connection when script terminates.
I guess the problem is when assigning the resource value to global
variable the resources reference count is increased by one. When
calling imap_close the reference value is checked and internal
pop3_close is called only when reference count is 1.

c-client version is 2001

I think this behaviour is not good.

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


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

Reply via email to