This is an archive of the discontinued Mercurial Phabricator instance.

wireprotov2: server support for sending content redirects
ClosedPublic

Authored by indygreg on Sep 26 2018, 9:09 PM.

Details

Summary

A "content redirect" can be sent in place of inline response content.

In terms of code, we model a content redirect as a special type of
response object holding the attributes describing that redirect.

Sending a content redirect thus becomes as simple as the object
emission layer sending an instance of that type. A cacher using
externally-addressable content storage could replace the outgoing
object stream with an object advertising its location.

The bulk of the code in this commit is teaching the output layer
which handles the object stream to recognize alternate location
objects. The rules are that if an alternate location object is
present, it must be the first and only object in the object stream.
Otherwise the server emits an error.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.