@@ -19,10 +19,10 @@ def __init__(self, reader):
19
19
20
20
def read (self , sz = 4 * 1024 * 1024 ):
21
21
if self .chunk_size == 0 :
22
- l = yield from self .content .readline ()
22
+ line = yield from self .content .readline ()
23
23
# 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 )
26
26
# print("chunk size:", self.chunk_size)
27
27
if self .chunk_size == 0 :
28
28
# End of message
@@ -56,9 +56,10 @@ def request_raw(method, url):
56
56
if proto != "http:" :
57
57
raise ValueError ("Unsupported protocol: " + proto )
58
58
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.
62
63
query = "%s /%s HTTP/1.0\r \n Host: %s\r \n Connection: close\r \n User-Agent: compat\r \n \r \n " % (
63
64
method ,
64
65
path ,
@@ -71,7 +72,6 @@ def request_raw(method, url):
71
72
72
73
def request (method , url ):
73
74
redir_cnt = 0
74
- redir_url = None
75
75
while redir_cnt < 2 :
76
76
reader = yield from request_raw (method , url )
77
77
headers = []
0 commit comments