Python tornado.iostream.UnsatisfiableReadError() Examples
The following are 14
code examples of tornado.iostream.UnsatisfiableReadError().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
tornado.iostream
, or try the search function
.
Example #1
Source File: http1connection.py From tornado-zh with MIT License | 6 votes |
def _server_request_loop(self, delegate): try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = yield conn.read_response(request_delegate) except (iostream.StreamClosedError, iostream.UnsatisfiableReadError): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return yield gen.moment finally: delegate.on_close(self)
Example #2
Source File: http1connection.py From tornado-zh with MIT License | 6 votes |
def _server_request_loop(self, delegate): try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = yield conn.read_response(request_delegate) except (iostream.StreamClosedError, iostream.UnsatisfiableReadError): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return yield gen.moment finally: delegate.on_close(self)
Example #3
Source File: http1connection.py From teleport with Apache License 2.0 | 6 votes |
def _server_request_loop(self, delegate): try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = yield conn.read_response(request_delegate) except (iostream.StreamClosedError, iostream.UnsatisfiableReadError): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return yield gen.moment finally: delegate.on_close(self)
Example #4
Source File: http1connection.py From pySINDy with MIT License | 6 votes |
def _server_request_loop(self, delegate): try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = yield conn.read_response(request_delegate) except (iostream.StreamClosedError, iostream.UnsatisfiableReadError): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return yield gen.moment finally: delegate.on_close(self)
Example #5
Source File: server.py From tornado_http2 with Apache License 2.0 | 6 votes |
def _read_first_line(self, stream, address): try: header_future = stream.read_until_regex(b'\r?\n\r?\n', max_bytes=self.conn_params.max_header_size) if self.conn_params.header_timeout is None: header_data = yield header_future else: try: header_data = yield gen.with_timeout( stream.io_loop.time() + self.conn_params.header_timeout, header_future, quiet_exceptions=StreamClosedError) except gen.TimeoutError: stream.close() return # TODO: make this less hacky stream._read_buffer[:0] = header_data stream._read_buffer_size += len(header_data) if header_data == b'PRI * HTTP/2.0\r\n\r\n': self._start_http2(stream, address) else: super(CleartextHTTP2Server, self)._start_http1(stream, address) except (StreamClosedError, UnsatisfiableReadError): pass
Example #6
Source File: http1connection.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def _server_request_loop(self, delegate): try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = yield conn.read_response(request_delegate) except (iostream.StreamClosedError, iostream.UnsatisfiableReadError): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return yield gen.moment finally: delegate.on_close(self)
Example #7
Source File: simple_httpclient_test.py From opendevops with GNU General Public License v3.0 | 5 votes |
def test_large_headers(self): with ExpectLog(gen_log, "Unsatisfiable read"): with self.assertRaises(UnsatisfiableReadError): self.fetch("/large", raise_error=True)
Example #8
Source File: http1connection.py From opendevops with GNU General Public License v3.0 | 5 votes |
def _server_request_loop( self, delegate: httputil.HTTPServerConnectionDelegate ) -> None: try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = await conn.read_response(request_delegate) except ( iostream.StreamClosedError, iostream.UnsatisfiableReadError, asyncio.CancelledError, ): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return await asyncio.sleep(0) finally: delegate.on_close(self)
Example #9
Source File: simple_httpclient_test.py From teleport with Apache License 2.0 | 5 votes |
def test_large_headers(self): with ExpectLog(gen_log, "Unsatisfiable read"): with self.assertRaises(UnsatisfiableReadError): self.fetch('/large', raise_error=True)
Example #10
Source File: http1connection.py From teleport with Apache License 2.0 | 5 votes |
def _server_request_loop( self, delegate: httputil.HTTPServerConnectionDelegate ) -> None: try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = await conn.read_response(request_delegate) except ( iostream.StreamClosedError, iostream.UnsatisfiableReadError, asyncio.CancelledError, ): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return await asyncio.sleep(0) finally: delegate.on_close(self)
Example #11
Source File: http1connection.py From teleport with Apache License 2.0 | 5 votes |
def _server_request_loop( self, delegate: httputil.HTTPServerConnectionDelegate ) -> None: try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = await conn.read_response(request_delegate) except ( iostream.StreamClosedError, iostream.UnsatisfiableReadError, asyncio.CancelledError, ): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return await asyncio.sleep(0) finally: delegate.on_close(self)
Example #12
Source File: simple_httpclient_test.py From pySINDy with MIT License | 5 votes |
def test_large_headers(self): with ExpectLog(gen_log, "Unsatisfiable read"): with self.assertRaises(UnsatisfiableReadError): self.fetch('/large', raise_error=True)
Example #13
Source File: simple_httpclient_test.py From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International | 5 votes |
def test_large_headers(self): with ExpectLog(gen_log, "Unsatisfiable read"): with self.assertRaises(UnsatisfiableReadError): self.fetch("/large", raise_error=True)
Example #14
Source File: http1connection.py From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International | 5 votes |
def _server_request_loop( self, delegate: httputil.HTTPServerConnectionDelegate ) -> None: try: while True: conn = HTTP1Connection(self.stream, False, self.params, self.context) request_delegate = delegate.start_request(self, conn) try: ret = await conn.read_response(request_delegate) except ( iostream.StreamClosedError, iostream.UnsatisfiableReadError, asyncio.CancelledError, ): return except _QuietException: # This exception was already logged. conn.close() return except Exception: gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: return await asyncio.sleep(0) finally: delegate.on_close(self)