diff options
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r-- | lib/class/stream.class.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 7d9092fc..71fd4626 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -153,12 +153,22 @@ 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'); + $time = time(); $sql = "DELETE FROM `session_stream` WHERE `expire` < '$time'"; $db_results = Dba::query($sql); + + foreach ($append_array as $append_agent) { + if (strstr(strtoupper($agent),$append_agent)) { + // 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) { |