This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: service multiple command requests per HTTP request
ClosedPublic

Authored by indygreg on Mar 14 2018, 9:10 PM.

Details

Summary

Now that our new frame-based protocol server can understand how
to ingest multiple, possibly interleaved, command requests, let's
hook it up to the HTTP server.

The code on the HTTP side of things is still a bit hacky. We need
a bit of work around error handling, content types, etc. But it's
a start.

Among the added tests, we demonstrate that a client can send frames
for multiple commands iterleaved with each other and that a later
issued command can respond before the first one has finished
sending. This makes our multi-request model technically superior
to the previous "batch" command.

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.Mar 14 2018, 9:10 PM
indygreg updated this revision to Diff 7147.Mar 19 2018, 7:59 PM
durin42 added inline comments.
mercurial/wireprotoserver.py
508

worth not using assert here? I don't think this is attacker-controlled?

durin42 accepted this revision.Mar 21 2018, 9:33 PM
This revision is now accepted and ready to land.Mar 21 2018, 9:33 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Mar 25 2018, 12:38 AM
yuja added inline comments.
mercurial/wireprotoserver.py
557

Nit: return False instead of returning None?