[PATCH 0 of 1] RFC: SSH transport protocol upgrade

Sune Foldager cryo at cyanite.org
Sat Mar 13 09:06:26 CST 2010


Greetings hg hackers :)

As has been discussed on the list before, I have some protocol patches
in my queue which I would like to discuss and push. I'll recap the
purpose and motivation for these patches below, and would like to
start out by focusing on the SSH protocol changes, which are smaller
than the HTTP ones.

In the following I am only talking about the transport layer of the
protocol, i.e. how commands and arguments are encoded and handled, and
how data is streamed. The command set, and the features of each
command belong to another layer which I will not discuss. The
descripion below is brief, since there has been discussions about this
on the list earlier.


PROBLEM (recap)

SSH lacks the "variable argument count" feature that HTTP has. This
makes it hard (impossible) to extend existing commands with optional
features. The patch in this series adds that by introducing "transport
protocol version 2". Also, transport-layer command options are
introduced (but not currently used; their purpose here is to unify the
feature set with HTTP).

HTTP lacks the "out of band output" feature that SSH has. This makes
it hard (impossible) to give feedback from hooks when perfoming pulls.
HTTP also has a problem with too long request URIs. I have a patch
that addresses the first problem by introducing "transport protocol
version 2", like with SSH. I'll send a separate mail discussing the
second problem.


IMPLEMENTATION

The SSH patch is, of course, fully compatible and uses a capability to
identify the new transport protocol version. The client indicates its
wish to use the new protocol by sending command in the new format,
which is easy to distinguish from the old one by the server. The
response format is unchanged.


RELATION TO HTTP

The SSH and HTTP patches are not directly connected, although they use
the same capability name for identifying the protocol version. This is
not a problem, though, since each protocol sends its own capability
string and no one actually uses these features yet. They will be put
to use by things like lwcopy, parent-delta, new discovery etc.

/Sune


More information about the Mercurial-devel mailing list