#21764 [NEW]: imap_close does not close a a stream

From: Date: Mon, 20 Jan 2003 08:45:07 +0000
Subject: #21764 [NEW]: imap_close does not close a a stream
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30628@lists.php.net to get a copy of this message
From: mikael.suvi@trigger.ee Operating system: Linux 2.4.18-SMP PHP version: 4.2.3 PHP Bug Type: IMAP related Bug description: imap_close does not close a a stream 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 bug report at http://bugs.php.net/?id=21764&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21764&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21764&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21764&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21764&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21764&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21764&r=support Expected behavior: http://bugs.php.net/fix.php?id=21764&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21764&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21764&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21764&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21764&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21764&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21764&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21764&r=gnused

« previous php.bugs (#30628) next »