From 293a57156ac1cbef50391bd9031e90f3a683d879 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 1 Aug 2018 20:58:21 -0400 Subject: [PATCH] log it --- txupnp/dirty_pool.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/txupnp/dirty_pool.py b/txupnp/dirty_pool.py index f287e13..200d8b1 100644 --- a/txupnp/dirty_pool.py +++ b/txupnp/dirty_pool.py @@ -1,3 +1,4 @@ +import logging from twisted.web.client import HTTPConnectionPool, _HTTP11ClientFactory from twisted.web._newclient import HTTPClientParser, BadResponseVersion, HTTP11ClientProtocol, RequestNotSent from twisted.web._newclient import TransportProxyProducer, RequestGenerationFailed @@ -6,6 +7,9 @@ from twisted.internet.defer import Deferred, fail, maybeDeferred from twisted.internet.defer import CancelledError +log = logging.getLogger() + + class DirtyHTTPParser(HTTPClientParser): def parseVersion(self, strversion): """ @@ -18,6 +22,7 @@ class DirtyHTTPParser(HTTPClientParser): major, minor = strnumber.split(b'.') major, minor = int(major), int(minor) except ValueError as e: + log.exception("got a bad http version: %s", strversion) if b'HTTP1.1' in strversion: return ("HTTP", 1, 1) raise BadResponseVersion(str(e), strversion)