We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae055ce commit c88ba9eCopy full SHA for c88ba9e
couchdb/http.py
@@ -179,19 +179,15 @@ def iterchunks(self):
179
self._release_conn()
180
break
181
chunk = self.resp.fp.read(chunksz)
182
-
183
for ln in chunk.splitlines(True):
184
end = (ln == b'\n') and not buffer # end of response
185
186
- if ln and not end:
187
- if ln.endswith(b'\n'):
188
- # end of a document
189
- yield buffer + ln
190
- buffer = b''
191
- else:
192
- # a break inside a document --> add to buffer and reuse
193
- # later
194
- buffer += ln
+ if not ln or end:
+ break
+ buffer += ln
+ if ln.endswith(b'\n'):
+ yield buffer
+ buffer = b''
195
196
self.resp.fp.read(2) #crlf
197
0 commit comments