From af6fdbb67e9e2992e0503a4ad93ae1fd3b4ef88c Mon Sep 17 00:00:00 2001 From: Paul Arthur Date: Tue, 15 Jan 2013 23:15:49 -0500 Subject: Change the gc on stream sessions It's a little suspect to automatically delete them just because another was used. Waiting for them to expire will get rid of them plenty quick, with less chance for weird issues. --- lib/class/stream.class.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 293e0f88..706dd0f5 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -104,12 +104,8 @@ class Stream { * gc_session * This function performes the garbage collection stuff, run on extend * and on now playing refresh. - * There is an array of agents that we will never GC because of their - * nature, MPD being the best example. */ - public static function gc_session($ip='',$agent='',$uid='',$sid='') { - - $append_array = array('MPD'); + public static function gc_session() { $time = time(); $sql = "DELETE FROM `session_stream` WHERE `expire` < '$time'"; @@ -117,19 +113,6 @@ class Stream { Stream_Playlist::clean(); - foreach ($append_array as $append_agent) { - if (strpos(strtoupper($agent), $append_agent) !== false) { - // We're done here jump ship! - return true; - } - } // end foreach - - // We need all of this to run this query - if ($ip AND $agent AND $uid AND $sid) { - $sql = "DELETE FROM `session_stream` WHERE `ip`='$ip' AND `agent`='$agent' AND `user`='$uid' AND `id` != '$sid'"; - $db_results = Dba::write($sql); - } - } // gc_session /** @@ -149,7 +132,7 @@ class Stream { "WHERE `id`='$sid'"; $db_results = Dba::write($sql); - self::gc_session($ip,$agent,$uid,$sid); + self::gc_session(); return true; -- cgit