@@ -19,10 +19,10 @@ def __init__(self, reader):
1919
2020 def read (self , sz = 4 * 1024 * 1024 ):
2121 if self .chunk_size == 0 :
22- l = yield from self .content .readline ()
22+ line = yield from self .content .readline ()
2323 # print("chunk line:", l)
24- l = l .split (b";" , 1 )[0 ]
25- self .chunk_size = int (l , 16 )
24+ line = line .split (b";" , 1 )[0 ]
25+ self .chunk_size = int (line , 16 )
2626 # print("chunk size:", self.chunk_size)
2727 if self .chunk_size == 0 :
2828 # End of message
@@ -56,9 +56,10 @@ def request_raw(method, url):
5656 if proto != "http:" :
5757 raise ValueError ("Unsupported protocol: " + proto )
5858 reader , writer = yield from asyncio .open_connection (host , port )
59- # Use protocol 1.0, because 1.1 always allows to use chunked transfer-encoding
60- # But explicitly set Connection: close, even though this should be default for 1.0,
61- # because some servers misbehave w/o it.
59+ # Use protocol 1.0, because 1.1 always allows to use chunked
60+ # transfer-encoding But explicitly set Connection: close, even
61+ # though this should be default for 1.0, because some servers
62+ # misbehave w/o it.
6263 query = "%s /%s HTTP/1.0\r \n Host: %s\r \n Connection: close\r \n User-Agent: compat\r \n \r \n " % (
6364 method ,
6465 path ,
@@ -71,7 +72,6 @@ def request_raw(method, url):
7172
7273def request (method , url ):
7374 redir_cnt = 0
74- redir_url = None
7575 while redir_cnt < 2 :
7676 reader = yield from request_raw (method , url )
7777 headers = []
0 commit comments