X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=blobdiff_plain;f=client;h=e5d4e0005092b3e7ebf842788c17d44145bfa7c4;hp=83dfd66d02cc7ca0d92d3459fbba95ecf05d51e6;hb=abb06ac1919fe89cc544b36b7b818af8e9cbd27d;hpb=c13ee6e6ebf8336c44baacae7d8ee7a501b37f90 diff --git a/client b/client index 83dfd66..e5d4e00 100755 --- a/client +++ b/client @@ -37,8 +37,9 @@ def process_cfg(): c.routes = cfg.get('virtual','routes') c.max_queue_time = cfg.getint(client_cs, 'max_queue_time') c.max_batch_up = cfg.getint(client_cs, 'max_batch_up') - c.http_timeout = cfg.getint(client_cs, 'http_timeout') c.http_retry = cfg.getint(client_cs, 'http_retry') + c.http_timeout = (cfg.getint(client_cs, 'http_timeout') + + cfg.getint(client_cs, 'http_timeout_grace')) process_cfg_ipif(client_cs, (('local', 'client'), @@ -80,7 +81,7 @@ class ResponseConsumer(GeneralResponseConsumer): 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: @@ -92,6 +93,7 @@ class ResponseConsumer(GeneralResponseConsumer): self.latefailure() return try: + self._log(DBG.HTTP, 'ResponseDone') self._ssd.flush() req_fin(self._req) except Exception as e: @@ -101,7 +103,7 @@ class ResponseConsumer(GeneralResponseConsumer): 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): @@ -192,6 +194,7 @@ def check_outbound(): str(c.client) .encode('ascii') + crlf + password + crlf + str(c.target_outstanding) .encode('ascii') + crlf + + str(c.http_timeout) .encode('ascii') + crlf + (( b'--b' + crlf + b'Content-Type: application/octet-stream' + crlf + @@ -227,8 +230,7 @@ def check_outbound(): log_outstanding() -common_startup() -process_cfg() +common_startup(process_cfg) start_client() start_ipif(c.ipif_command, outbound) check_outbound()