| 3230 | self.pipe_queue().put(chunk) |
| 3231 | |
| 3232 | def read(self): |
| 3233 | # if we're PY3, we're reading bytes, otherwise we're reading |
| 3234 | # str |
| 3235 | try: |
| 3236 | chunk = no_interrupt(os.read, self.stream, self.bufsize) |
| 3237 | except OSError as e: |
| 3238 | self.log.debug("got errno %d, done reading", e.errno) |
| 3239 | return True |
| 3240 | if not chunk: |
| 3241 | self.log.debug("got no chunk, done reading") |
| 3242 | return True |
| 3243 | |
| 3244 | self.log.debug("got chunk size %d: %r", len(chunk), chunk[:30]) |
| 3245 | for chunk in self.stream_bufferer.process(chunk): |
| 3246 | self.write_chunk(chunk) |
| 3247 | |
| 3248 | |
| 3249 | class StreamBufferer: |