Mercurial > public > mercurial-scm > hg
diff mercurial/help/internals/wireprotocol.txt @ 37055:61393f888dfe
wireproto: define and implement responses in framing protocol
Previously, we only had client-side frame types defined. This commit
defines and implements basic support for server-side frame types.
We introduce two frame types - one for representing the raw bytes
result of a command and another for representing error results.
The types are quite primitive and behavior will expand over time.
But you have to start somewhere.
Our server reactor gains methods to react to an intent to send a
response. Again, following the "sans I/O" pattern, the reactor
doesn't actually send the data. Instead, it gives the caller a
generator to frames that it can send out over the wire.
Differential Revision: https://phab.mercurial-scm.org/D2858
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 14 Mar 2018 13:57:52 -0700 |
parents | 40206e227412 |
children | 2ec1fb9de638 |
line wrap: on
line diff
--- a/mercurial/help/internals/wireprotocol.txt Wed Mar 14 13:32:31 2018 -0700 +++ b/mercurial/help/internals/wireprotocol.txt Wed Mar 14 13:57:52 2018 -0700 @@ -591,6 +591,40 @@ server. The command has been fully issued and no new data for this command will be sent. The next frame will belong to a new command. +Bytes Response Data (``0x04``) +------------------------------ + +This frame contains raw bytes response data to an issued command. + +The following flag values are defined for this type: + +0x01 + Data continuation. When set, an additional frame containing raw + response data will follow. +0x02 + End of data. When sent, the response data has been fully sent and + no additional frames for this response will be sent. + +The ``0x01`` flag is mutually exclusive with the ``0x02`` flag. + +Error Response (``0x05``) +------------------------- + +An error occurred when processing a request. This could indicate +a protocol-level failure or an application level failure depending +on the flags for this message type. + +The payload for this type is an error message that should be +displayed to the user. + +The following flag values are defined for this type: + +0x01 + The error occurred at the transport/protocol level. If set, the + connection should be closed. +0x02 + The error occurred at the application level. e.g. invalid command. + Issuing Commands ----------------