self._log(DBG.HTTP_CTRL, '__init__')
def dataReceived(self, data):
- self._log(DBG.HTTP_CTRL, 'dataReceived', d=data)
+ self._log(DBG.HTTP, 'dataReceived', d=data)
try:
self._ssd.inputdata(data)
except Exception as e:
self.latefailure()
return
try:
+ self._log(DBG.HTTP, 'ResponseDone')
self._ssd.flush()
req_fin(self._req)
except Exception as e:
self._latefailure(traceback.format_exc())
def _latefailure(self, reason):
- self._log(DBG.HTTP_CTRL, '_asyncFailure ' + str(reason))
+ self._log(DBG.HTTP_CTRL, '_latefailure ' + str(reason))
req_err(self._req, reason)
class ErrorResponseConsumer(twisted.internet.protocol.Protocol):
import hippotat.slip as slip
class DBG(twisted.python.constants.Names):
+ INIT = NamedConstant()
ROUTE = NamedConstant()
DROP = NamedConstant()
FLOW = NamedConstant()
HTTP = NamedConstant()
- HTTP_CTRL = NamedConstant()
- INIT = NamedConstant()
+ TWISTED = NamedConstant()
QUEUE = NamedConstant()
+ HTTP_CTRL = NamedConstant()
QUEUE_CTRL = NamedConstant()
HTTP_FULL = NamedConstant()
- SLIP_FULL = NamedConstant()
CTRL_DUMP = NamedConstant()
+ SLIP_FULL = NamedConstant()
_hex_codec = codecs.getencoder('hex_codec')
log = twisted.logger.Logger()
def log_debug(dflag, msg, idof=None, d=None):
+ if dflag > DBG.HTTP: return
#print('---------------->',repr((dflag, msg, idof, d)), file=sys.stderr)
if idof is not None:
msg = '[%#x] %s' % (id(idof), msg)