Skip to content
Myr

Merge #491

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 613816d · Browse files · 3 files+4 added−35 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−35 removed

  • other:+4 added−35 removed

3 files+4 added−35 removed

modified:requests/models.py+1 added-33 removed
681 unmodified lines
682 break683 yield chunk684 self._content_consumed = True685686 def generate_chunked():687 resp = self.raw._original_response688 fp = resp.fp689 if resp.chunk_left is not None:690 pending_bytes = resp.chunk_left691 while pending_bytes:692 chunk = fp.read(min(chunk_size, pending_bytes))693 pending_bytes -= len(chunk)694 yield chunk695 fp.read(2) # throw away crlf696 while 1:697 #XXX correct line size? (httplib has 64kb, seems insane)698 pending_bytes = fp.readline(40).strip()699 if not len(pending_bytes):700 # No content, like a HEAD request. Break out.701 break702 pending_bytes = int(pending_bytes, 16)703 if pending_bytes == 0:704 break705 while pending_bytes:706 chunk = fp.read(min(chunk_size, pending_bytes))707 pending_bytes -= len(chunk)708 yield chunk709 fp.read(2) # throw away crlf710 self._content_consumed = True711 fp.close()686 gen = stream_untransfer(generate(), self)687713 if getattr(getattr(self.raw, '_original_response', None), 'chunked', False):714 gen = generate_chunked()715 else:716 gen = generate()717718 gen = stream_untransfer(gen, self)719688 if decode_unicode:689 gen = stream_decode_response_unicode(gen, self)690691 return gen
111 unmodified lines
modified:AUTHORS.rst+2 added-1 removed
87 unmodified lines
88- Chris Dary89- Danver Braganza <danverbraganza@gmail.com>90- Max Countryman91- Nick Chadwick92- Jonathan Drosdeck92- Jonathan Drosdeck93- Jiri Machalek
modified:HISTORY.rst+1 added-1 removed
3 unmodified lines
40.11.0 (2012-03-14)5+++++++++++++++++++67* Private SSL Certificate support8*8* Remove select.poll from Gevent monkeypatching9100.10.8 (2012-03-09)11+++++++++++++++++++12
411 unmodified lines