http.py (1654:fc7d0578e124) http.py (1706:a1da56837554)
1import binascii
2import io
3import json
4import os
5import re
6import select
7import socket
8

--- 173 unchanged lines hidden (view full) ---

182 # For all current cases if the "read_timeout" was changed
183 # than test do not expect to get a response from server.
184 if timeout == timeout_default:
185 pytest.fail('Can\'t read response from server.')
186 break
187
188 try:
189 part = sock.recv(buff_size)
1import binascii
2import io
3import json
4import os
5import re
6import select
7import socket
8

--- 173 unchanged lines hidden (view full) ---

182 # For all current cases if the "read_timeout" was changed
183 # than test do not expect to get a response from server.
184 if timeout == timeout_default:
185 pytest.fail('Can\'t read response from server.')
186 break
187
188 try:
189 part = sock.recv(buff_size)
190
191 except KeyboardInterrupt:
192 raise
193
190 except:
191 break
192
193 data += part
194
195 if not len(part):
196 break
197

--- 39 unchanged lines hidden (view full) ---

237 if len(chunks) < 3:
238 pytest.fail('Invalid chunked body')
239
240 if chunks.pop() != b'':
241 pytest.fail('No CRLF at the end of the body')
242
243 try:
244 last_size = int(chunks[-2], 16)
194 except:
195 break
196
197 data += part
198
199 if not len(part):
200 break
201

--- 39 unchanged lines hidden (view full) ---

241 if len(chunks) < 3:
242 pytest.fail('Invalid chunked body')
243
244 if chunks.pop() != b'':
245 pytest.fail('No CRLF at the end of the body')
246
247 try:
248 last_size = int(chunks[-2], 16)
245 except:
249
250 except ValueError:
246 pytest.fail('Invalid zero size chunk')
247
248 if last_size != 0 or chunks[-1] != b'':
249 pytest.fail('Incomplete body')
250
251 body = b''
252 while len(chunks) >= 2:
253 try:
254 size = int(chunks.pop(0), 16)
251 pytest.fail('Invalid zero size chunk')
252
253 if last_size != 0 or chunks[-1] != b'':
254 pytest.fail('Incomplete body')
255
256 body = b''
257 while len(chunks) >= 2:
258 try:
259 size = int(chunks.pop(0), 16)
255 except:
260
261 except ValueError:
256 pytest.fail('Invalid chunk size %s' % str(size))
257
258 if size == 0:
259 assert len(chunks) == 1, 'last zero size'
260 break
261
262 temp_body = crlf.join(chunks)
263

--- 86 unchanged lines hidden ---
262 pytest.fail('Invalid chunk size %s' % str(size))
263
264 if size == 0:
265 assert len(chunks) == 1, 'last zero size'
266 break
267
268 temp_body = crlf.join(chunks)
269

--- 86 unchanged lines hidden ---