This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: make parsedrequest part of wsgirequest

Authored by indygreg on Mar 9 2018, 8:23 PM.



This is kind of ugly. But an upcoming commit will teach parsedrequest
about the input stream. Because the input stream is global state and
can't be accessed without side-effects, we need to take actions to
ensure that multiple consumers don't read from it independently. The
easiest way to do this is for one object to hold a reference to both
items having access to the input stream so that when a copy is made,
we can remove the attribute from the other instance.

So we create our parsed request instance from the wsgirequest
constructor and hold a reference to it there. This is better than
our new type holding a reference to wsgirequest because all the
code for managing access will be temporary and we shouldn't pollute
parsedrequest with this ugly history.

Diff Detail

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

Event Timeline

indygreg created this revision.Mar 9 2018, 8:23 PM
indygreg edited the summary of this revision. (Show Details)Mar 10 2018, 3:03 PM
indygreg updated this revision to Diff 6832.
durin42 accepted this revision.Mar 12 2018, 4:57 PM
This revision is now accepted and ready to land.Mar 12 2018, 4:57 PM
This revision was automatically updated to reflect the committed changes.