This is an archive of the discontinued Mercurial Phabricator instance.

wireprotoserver: move protocol parsing and dispatch out of hgweb
ClosedPublic

Authored by indygreg on Feb 2 2018, 8:50 PM.

Details

Summary

Previously, hgweb_mod had code for detecting if the request
was for the wire protocol. It would then (eventually) call
wireprotoserver.callhttp() to dispatch the request handling.

Detection of wire protocol requests is not trivial. There's
currently a big gotcha in the handling of the "cmd" request
parameter, for example.

Furthermore, in the near future we will have a second HTTP
protocol handler. Its mechanism for calling commands will be
a bit different. And we don't want the low-level logic for
detecting protocol commands to live in hgweb.

We establish a new function in wireprotoserver for detecting
an HTTP protocol request and for giving the caller an easy-to-use
mechanism for dispatching requests to it.

Some wire protocol specific functionality still lives in hgweb.
This will be addressed in subsequent commits.

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.

Event Timeline

indygreg created this revision.Feb 2 2018, 8:50 PM
indygreg updated this revision to Diff 5259.Feb 6 2018, 4:04 PM
durin42 accepted this revision.Feb 7 2018, 5:18 PM
This revision is now accepted and ready to land.Feb 7 2018, 5:18 PM
This revision was automatically updated to reflect the committed changes.