|
244 |
return True |
244 |
return True |
245 |
CORE.info('UMCP_Dispatcher: check_queue: new request: 0x%x' % (id(queuerequest),)) |
245 |
CORE.info('UMCP_Dispatcher: check_queue: new request: 0x%x' % (id(queuerequest),)) |
246 |
|
246 |
|
247 |
if not isinstance(queuerequest.sessionid, basestring) and queuerequest.sessionid is not None: |
247 |
if not isinstance(queuerequest.sessionid, (basestring, type(None))): |
248 |
CORE.process('UMCP_Dispatcher: check_queue: got invalid sessionid: %r' % (queuerequest.sessionid,)) |
248 |
CORE.process('UMCP_Dispatcher: check_queue: got invalid sessionid: %r' % (queuerequest.sessionid,)) |
249 |
if not isinstance(queuerequest.request, umcp.Request): |
249 |
if not isinstance(queuerequest.request, umcp.Request): |
250 |
CORE.process('UMCP_Dispatcher: check_queue: got invalid UMCP request: %r' % (queuerequest.request,)) |
250 |
CORE.process('UMCP_Dispatcher: check_queue: got invalid UMCP request: %r' % (queuerequest.request,)) |
|
276 |
# add a small offset to the timeout in order to avoid a mismatch between frontend and backend |
276 |
# add a small offset to the timeout in order to avoid a mismatch between frontend and backend |
277 |
try: |
277 |
try: |
278 |
client = SessionClient(timeout = _session_timeout + 5, ip = queuerequest.ip, cookie = queuerequest.cookie) |
278 |
client = SessionClient(timeout = _session_timeout + 5, ip = queuerequest.ip, cookie = queuerequest.cookie) |
279 |
except Exception, e: |
279 |
except umcp.NoSocketError as exc: |
280 |
CORE.process( 'Failed to create UMC connection: %s' % str(e)) |
280 |
CORE.process( 'Failed to create UMC connection: %s' % (exc,)) |
281 |
response = umcp.Response( queuerequest.request ) |
281 |
response = umcp.Response( queuerequest.request ) |
282 |
response.status = httplib.UNAUTHORIZED # set status to unauthorized |
282 |
response.status = httplib.SERVICE_UNAVAILABLE |
283 |
queuerequest.response_queue.put( response ) |
283 |
queuerequest.response_queue.put( response ) |
284 |
continue |
284 |
continue |
285 |
|
285 |
|