Mercurial > libervia-web
comparison libervia.tac @ 45:7f106052326f
server side: user is now disconnected on session end, and queue is purged
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 25 May 2011 15:45:16 +0200 |
parents | 2744dd31e8a5 |
children | c3ee630914ba |
comparison
equal
deleted
inserted
replaced
44:2744dd31e8a5 | 45:7f106052326f |
---|---|
271 sat_session = ISATSession(_session) | 271 sat_session = ISATSession(_session) |
272 if sat_session.profile: | 272 if sat_session.profile: |
273 error (_('/!\\ Session has already a profile, this should NEVER happen !')) | 273 error (_('/!\\ Session has already a profile, this should NEVER happen !')) |
274 sat_session.profile = profile | 274 sat_session.profile = profile |
275 self.sat_host.prof_connected.add(profile) | 275 self.sat_host.prof_connected.add(profile) |
276 | |
277 def onExpire(): | |
278 try: | |
279 #We purge the queue | |
280 del self.sat_host.signal_handler.queue[profile] | |
281 except KeyError: | |
282 pass | |
283 #and now we deconnect the profile | |
284 self.sat_host.bridge.disconnect(profile) | |
285 | |
286 _session.notifyOnExpire(onExpire) | |
287 | |
276 d = defer.Deferred() | 288 d = defer.Deferred() |
277 self.sat_host.bridge.getMblogNodes(profile, d.callback, d.errback) | 289 self.sat_host.bridge.getMblogNodes(profile, d.callback, d.errback) |
278 d.addCallback(self._fillMblogNodes, _session) | 290 d.addCallback(self._fillMblogNodes, _session) |
279 if finish: | 291 if finish: |
280 request.write('LOGGED') | 292 request.write('LOGGED') |
312 def __init__(self, sat_host): | 324 def __init__(self, sat_host): |
313 Resource.__init__(self) | 325 Resource.__init__(self) |
314 self.register=None | 326 self.register=None |
315 self.sat_host=sat_host | 327 self.sat_host=sat_host |
316 self.signalDeferred = {} | 328 self.signalDeferred = {} |
317 self.queue = {} #XXX: gof: don't forgot to purge queue on session end | 329 self.queue = {} |
318 | 330 |
319 def plugRegister(self, register): | 331 def plugRegister(self, register): |
320 self.register = register | 332 self.register = register |
321 | 333 |
322 def jsonrpc_getSignals(self): | 334 def jsonrpc_getSignals(self): |