Commit ec2da131 authored by Amos Latteier's avatar Amos Latteier

Adjust for changes to medusa's asyncore.socket_map.

parent 5e529dcf
...@@ -586,7 +586,7 @@ class FTPLimiter: ...@@ -586,7 +586,7 @@ class FTPLimiter:
total=0 total=0
class_total=0 class_total=0
if channel.anonymous: if channel.anonymous:
for existing_channel in asyncore.socket_map.keys(): for existing_channel in asyncore.socket_map.values():
if (hasattr(existing_channel,'server') and if (hasattr(existing_channel,'server') and
existing_channel.server is channel.server): existing_channel.server is channel.server):
total=total+1 total=total+1
...@@ -595,7 +595,7 @@ class FTPLimiter: ...@@ -595,7 +595,7 @@ class FTPLimiter:
if class_total > self.anon_limit: if class_total > self.anon_limit:
return None return None
else: else:
for existing_channel in asyncore.socket_map.keys(): for existing_channel in asyncore.socket_map.values():
if (hasattr(existing_channel,'server') and if (hasattr(existing_channel,'server') and
existing_channel.server is channel.server): existing_channel.server is channel.server):
total=total+1 total=total+1
......
...@@ -364,7 +364,7 @@ class zhttp_channel(http_channel): ...@@ -364,7 +364,7 @@ class zhttp_channel(http_channel):
def kill_zombies(self): def kill_zombies(self):
now = int (time.time()) now = int (time.time())
for channel in asyncore.socket_map.keys(): for channel in asyncore.socket_map.values():
if channel.__class__ == self.__class__: if channel.__class__ == self.__class__:
if (now - channel.creation_time) > channel.zombie_timeout: if (now - channel.creation_time) > channel.zombie_timeout:
channel.close() channel.close()
......
...@@ -586,7 +586,7 @@ class FTPLimiter: ...@@ -586,7 +586,7 @@ class FTPLimiter:
total=0 total=0
class_total=0 class_total=0
if channel.anonymous: if channel.anonymous:
for existing_channel in asyncore.socket_map.keys(): for existing_channel in asyncore.socket_map.values():
if (hasattr(existing_channel,'server') and if (hasattr(existing_channel,'server') and
existing_channel.server is channel.server): existing_channel.server is channel.server):
total=total+1 total=total+1
...@@ -595,7 +595,7 @@ class FTPLimiter: ...@@ -595,7 +595,7 @@ class FTPLimiter:
if class_total > self.anon_limit: if class_total > self.anon_limit:
return None return None
else: else:
for existing_channel in asyncore.socket_map.keys(): for existing_channel in asyncore.socket_map.values():
if (hasattr(existing_channel,'server') and if (hasattr(existing_channel,'server') and
existing_channel.server is channel.server): existing_channel.server is channel.server):
total=total+1 total=total+1
......
...@@ -364,7 +364,7 @@ class zhttp_channel(http_channel): ...@@ -364,7 +364,7 @@ class zhttp_channel(http_channel):
def kill_zombies(self): def kill_zombies(self):
now = int (time.time()) now = int (time.time())
for channel in asyncore.socket_map.keys(): for channel in asyncore.socket_map.values():
if channel.__class__ == self.__class__: if channel.__class__ == self.__class__:
if (now - channel.creation_time) > channel.zombie_timeout: if (now - channel.creation_time) > channel.zombie_timeout:
channel.close() channel.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment