(self, data, length)
| 249 | self.close() |
| 250 | |
| 251 | def _data_received(self, data, length): |
| 252 | if self._paused: |
| 253 | # Don't call any protocol method while reading is paused. |
| 254 | # The protocol will be called on resume_reading(). |
| 255 | assert self._pending_data_length == -1 |
| 256 | self._pending_data_length = length |
| 257 | return |
| 258 | |
| 259 | if length == 0: |
| 260 | self._eof_received() |
| 261 | return |
| 262 | |
| 263 | if isinstance(self._protocol, protocols.BufferedProtocol): |
| 264 | try: |
| 265 | protocols._feed_data_to_buffered_proto(self._protocol, data) |
| 266 | except (SystemExit, KeyboardInterrupt): |
| 267 | raise |
| 268 | except BaseException as exc: |
| 269 | self._fatal_error(exc, |
| 270 | 'Fatal error: protocol.buffer_updated() ' |
| 271 | 'call failed.') |
| 272 | return |
| 273 | else: |
| 274 | self._protocol.data_received(data) |
| 275 | |
| 276 | def _loop_reading(self, fut=None): |
| 277 | length = -1 |
no test coverage detected