msmith - in flumotion/trunk: .
flumotion/component/consumers/httpstreamer
flumotion-commit at lists.fluendo.com
flumotion-commit at lists.fluendo.com
Fri May 25 17:32:07 CEST 2007
Author: msmith
Date: Fri May 25 17:32:03 2007
New Revision: 5040
Modified:
flumotion/trunk/ChangeLog
flumotion/trunk/flumotion/component/consumers/httpstreamer/resources.py
Log:
* flumotion/component/consumers/httpstreamer/resources.py:
Reject clients using bandwidth limit if adding this client would
take us over the limit, not only if we're _already_ over the limit.
Fixes #217.
Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog (original)
+++ flumotion/trunk/ChangeLog Fri May 25 17:32:03 2007
@@ -1,3 +1,10 @@
+2007-05-25 Michael Smith <msmith at fluendo.com>
+
+ * flumotion/component/consumers/httpstreamer/resources.py:
+ Reject clients using bandwidth limit if adding this client would
+ take us over the limit, not only if we're _already_ over the limit.
+ Fixes #217.
+
2007-05-25 Sebastien Merle <sebastien at fluendo.com>
* flumotion/common/config.py:
Modified: flumotion/trunk/flumotion/component/consumers/httpstreamer/resources.py
==============================================================================
--- flumotion/trunk/flumotion/component/consumers/httpstreamer/resources.py (original)
+++ flumotion/trunk/flumotion/component/consumers/httpstreamer/resources.py Fri May 25 17:32:03 2007
@@ -264,7 +264,8 @@
if self.maxclients >= 0 and len(self._requests) >= self.maxclients:
return True
elif self.maxbandwidth >= 0:
- if (len(self._requests) * self.streamer.getCurrentBitrate() >=
+ # Reject if adding one more client would take us over the limit.
+ if (len(self._requests + 1) * self.streamer.getCurrentBitrate() >=
self.maxbandwidth):
return True
return False
More information about the flumotion-commit
mailing list