Part of bzrlib.smart.message View In Hierarchy
Method | __init__ | Undocumented |
Method | setProtoAndMediumRequest | Undocumented |
Method | byte_part_received | Called when a 'byte' part is received. |
Method | bytes_part_received | Called when a 'bytes' part is received. |
Method | structure_part_received | Called when a 'structure' part is received. |
Method | protocol_error | Called when there is a protocol decoding error. |
Method | read_response_tuple | Read a response tuple from the wire. |
Method | read_body_bytes | Read bytes from the body, decoding into a byte stream. |
Method | read_streamed_body | Returns an iterable that reads and returns a series of body chunks. |
Method | cancel_read_body | Stop expecting a body for this response. |
Method | _wait_for_response_args | Undocumented |
Method | _wait_for_response_end | Undocumented |
Method | _read_more | Undocumented |
Inherited from MessageHandler:
Method | headers_received | Called when message headers are received. |
Method | end_received | Called when the end of the message is received. |
Note that a 'byte' part is a message part consisting of exactly one byte.
A 'bytes' message part can contain any number of bytes. It should not be confused with a 'byte' part, which is always a single byte.
Parameters | structure | some structured data, which will be some combination of list, dict, int, and str objects. |
The default implementation just re-raises the exception.
We read all bytes at once to ensure we've checked the trailer for errors, and then feed the buffer back as read_body_bytes is called.
Like the builtin file.read in Python, a count of -1 (the default) means read the entire body.
If expect_body was passed to read_response_tuple, this cancels that expectation (and thus finishes reading the response, allowing a new request to be issued). This is useful if a response turns out to be an error rather than a normal result with a body.