From 50aefee72863989e74386f851f79faf6b23f7e90 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sat, 26 Mar 2016 09:34:46 -0400 Subject: [PATCH] Correct a number of issues There were a number of careless mistakes in the feature, correct the bad usage and typos. --- confluent_server/confluent/asynchttp.py | 10 +++++----- confluent_server/confluent/httpapi.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/confluent_server/confluent/asynchttp.py b/confluent_server/confluent/asynchttp.py index 9e53e3bd..24c51a8b 100644 --- a/confluent_server/confluent/asynchttp.py +++ b/confluent_server/confluent/asynchttp.py @@ -69,7 +69,7 @@ class AsyncTermRelation(object): self.termid = termid def got_data(self, data): - self.async.add(data, self.termid) + self.async.add(self.termid, data) class AsyncSession(object): @@ -82,8 +82,8 @@ class AsyncSession(object): self.consoles = set([]) self.reaper = eventlet.spawn_after(15, self.destroy) - def add(self, rsp, requestid): - self.responses.append((rsp, requestid)) + def add(self, requestid, rsp): + self.responses.append((requestid, rsp)) if self._evt: self._evt.send() self._evt = None @@ -93,7 +93,7 @@ class AsyncSession(object): # to what object (since the callback does not provide context # for data, and here ultimately the client is responsible # for sorting out which is which. - termrel = AsyncTermRelation(['HTTP_CONFLUENTREQUESTID'], self) + termrel = AsyncTermRelation(env['HTTP_CONFLUENTREQUESTID'], self) self.termrelations.append(termrel) return termrel @@ -144,7 +144,7 @@ def run_handler(hdlr, env): def get_async(env, querydict): global _cleanthread - return _asyncsessions[querydict['asyncid']]['asyncsession'] + return _asyncsessions[env['HTTP_CONFLUENTASYNCID']]['asyncsession'] def handle_async(env, querydict, threadset): diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index a5ce66e3..9be9a515 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -423,7 +423,7 @@ def resourcehandler_backend(env, start_response): return sessid = _assign_consessionid(consession) if async: - async.add_consolesession(sessid) + async.add_console_session(sessid) start_response('200 OK', headers) yield '{"session":"%s","data":""}' % sessid return