multi-user, do not cache open mbox

This commit is contained in:
Friendika 2011-04-18 15:16:51 -07:00
parent 741a262f1b
commit 1e967eddb7
2 changed files with 22 additions and 24 deletions

View file

@ -2,7 +2,7 @@
set_time_limit(0); set_time_limit(0);
define ( 'FRIENDIKA_VERSION', '2.1.952' ); define ( 'FRIENDIKA_VERSION', '2.1.953' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1053 ); define ( 'DB_UPDATE_VERSION', 1053 );

View file

@ -16,7 +16,6 @@ function poller_run($argv, $argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
$mbox = null;
require_once('session.php'); require_once('session.php');
require_once('datetime.php'); require_once('datetime.php');
@ -288,7 +287,7 @@ function poller_run($argv, $argc){
$xml = fetch_url($contact['poll']); $xml = fetch_url($contact['poll']);
} }
elseif($contact['network'] === NETWORK_MAIL) { elseif($contact['network'] === NETWORK_MAIL) {
if(! $mbox) { $mbox = null;
$x = q("SELECT `prvkey` FROM `user` WHERE `uid` = %d LIMIT 1", $x = q("SELECT `prvkey` FROM `user` WHERE `uid` = %d LIMIT 1",
intval($importer_uid) intval($importer_uid)
); );
@ -309,7 +308,6 @@ function poller_run($argv, $argc){
); );
} }
} }
}
if($mbox) { if($mbox) {
$msgs = email_poll($mbox,$contact['addr']); $msgs = email_poll($mbox,$contact['addr']);
@ -383,6 +381,8 @@ function poller_run($argv, $argc){
); );
} }
} }
imap_close($mbox);
} }
} }
elseif($contact['network'] === NETWORK_FACEBOOK) { elseif($contact['network'] === NETWORK_FACEBOOK) {
@ -435,8 +435,6 @@ function poller_run($argv, $argc){
} }
} }
if($mbox && function_exists('imap_close'))
imap_close($mbox);
return; return;
} }