summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <flowerysong00@yahoo.com>2013-01-15 23:15:49 -0500
committerPaul Arthur <flowerysong00@yahoo.com>2013-01-15 23:15:49 -0500
commitaf6fdbb67e9e2992e0503a4ad93ae1fd3b4ef88c (patch)
treee2e4f20129c13d7f7ede419684d0397a77075223
parentb8cd232a4fed01aefc8c6e2a529e2d5c5d819062 (diff)
downloadampache-af6fdbb67e9e2992e0503a4ad93ae1fd3b4ef88c.tar.gz
ampache-af6fdbb67e9e2992e0503a4ad93ae1fd3b4ef88c.tar.bz2
ampache-af6fdbb67e9e2992e0503a4ad93ae1fd3b4ef88c.zip
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.
-rw-r--r--lib/class/stream.class.php21
1 files 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;