|
|
@ -161,7 +161,8 @@ class ServerManager(util.LoggedClass): |
|
|
|
excess = priority - self.BANDS |
|
|
|
if excess > 0: |
|
|
|
secs = excess |
|
|
|
session.log_info('delaying response {:d}s'.format(secs)) |
|
|
|
session.log_info('delaying response to low-priority session {:d}s' |
|
|
|
.format(secs)) |
|
|
|
if secs: |
|
|
|
self.delayed_sessions.append((time.time() + secs, item)) |
|
|
|
else: |
|
|
@ -334,8 +335,9 @@ class ServerManager(util.LoggedClass): |
|
|
|
group = self.groups[int(session.start - self.start) // 900] |
|
|
|
group.add(session) |
|
|
|
self.sessions[session] = group |
|
|
|
session.log_info('connection from {}, {:,d} total' |
|
|
|
.format(session.peername(), len(self.sessions))) |
|
|
|
session.log_info('{} from {}, {:,d} total' |
|
|
|
.format(session.kind, session.peername(), |
|
|
|
len(self.sessions))) |
|
|
|
if (len(self.sessions) >= self.max_sessions |
|
|
|
and self.state == self.LISTENING): |
|
|
|
self.state = self.PAUSED |
|
|
|