import syslog
-import traceback
-
clients = { }
#---------- "router" ----------
self._rq.append(request)
self._check_outbound()
+ def _req_write(self, req, d):
+ self._log(DBG.HTTP, 'req_write ', idof=req, d=d)
+ req.write(d)
+
def _check_outbound(self):
log_debug(DBG.HTTP_CTRL, 'CHKO')
while True:
self._log(DBG.HTTP_CTRL, 'CHKO processing', idof=request)
# request, and also some non-expired packets
self._pq.process((lambda: request.sentLength),
- request.write,
+ (lambda d: self._req_write(request, d)),
self.max_batch_down)
assert(request.sentLength)
log_http(desca, 'processing', idof=id(request), d=d)
+ d = mime_translate(d)
+
cl.process_arriving_data(d)
cl.new_request(request)
try: process_request(request, desca)
except Exception as e:
emsg = traceback.format_exc()
- log_http(desca, 'EXCEPTION ' + emsg)
+ log_http(desca, 'RETURNING EXCEPTION ' + emsg)
request.setHeader('Content-Type','text/plain; charset="utf-8"')
request.setResponseCode(400)
return (emsg + ' # ' + repr(desca) + '\r\n').encode('utf-8')
common_startup()
process_cfg()
-start_ipif(c.ipif_command, route)
+start_ipif(c.ipif_command, (lambda p,s,d: route(p,"[ipif]",s,d)))
start_http()
common_run()