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)