This is an archive of the discontinued Mercurial Phabricator instance.

keepalive: be more careful about self._rbuf when calling super impls
ClosedPublic

Authored by durin42 on Sep 24 2018, 10:55 PM.

Details

Summary

In Python 3, HTTPResponse implements read() in terms of readinto(),
which was calling back into our readinto(), which duplicates
self._rbuf if it's not empty. Before calling into super's read(),
ensure self._rbuf is empty.

Inheritance is bad, and undocumented self-use of your public API is
one of many reasons.

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

durin42 created this revision.Sep 24 2018, 10:55 PM
This revision was automatically updated to reflect the committed changes.