(self, sz)
| 126 | _setup_fd(self._fd) |
| 127 | |
| 128 | def _read_chunk(self, sz): |
| 129 | chunk = None |
| 130 | try: |
| 131 | chunk = os.read(self._fd, sz) |
| 132 | self._bd.add(chunk) |
| 133 | except EnvironmentError as e: |
| 134 | if e.errno in [errno.EAGAIN, errno.EWOULDBLOCK]: |
| 135 | assert chunk is None |
| 136 | gevent.socket.wait_read(self._fd) |
| 137 | else: |
| 138 | raise |
| 139 | |
| 140 | self.got_eof = (chunk == b'') |
| 141 | |
| 142 | def read(self, size=None): |
| 143 | # Handle case of "read all". |