• Joe Lee's avatar
    Make HttpClient adapter preserve exception behavior · ea4dc7f0
    Joe Lee authored
    Ideally, the HttpClient/HttpServer adapters should maintain the invariant that
    the behavior of a given client is the same as the behavior of
    newHttpClient(newHttpService(client)).  Prior to this change, the HttpClient
    wrapper lazily called request(), so a client whose request() eagerly threw an
    exception could produce a different exception when called directly versus when
    wrapped -- the laziness allowed additional code to run.  This was particularly
    evident when making a request with a body, since code using a wrapped client
    would be able to set up a subsequent BlockedWrite, eventually resulting in a
    "read end of pipe was aborted" exception instead of the actual exception.
    
    This change makes HttpClientAdapter::request() execute the wrapped request()
    eagerly.
    
    (Note that it partially undoes 90d48343... Hopefully, it preserves the desired
    behavior added there.)
    ea4dc7f0
Name
Last commit
Last update
c++ Loading commit data...
doc Loading commit data...
highlighting Loading commit data...
security-advisories Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
RELEASE-PROCESS.md Loading commit data...
appveyor.yml Loading commit data...
mega-test-kenton-home.cfg Loading commit data...
mega-test-kenton-work.cfg Loading commit data...
mega-test-quick.cfg Loading commit data...
mega-test.py Loading commit data...
release.sh Loading commit data...
style-guide.md Loading commit data...
super-test.sh Loading commit data...