fix RPC error replies #4440

pull kazcw wants to merge 1 commits into bitcoin:master from kazcw:fix-rpc-errors changing 3 files +29 −23
  1. kazcw commented at 2:07 AM on June 29, 2014: contributor

    After pull #4288, RPC messages indicating errors have a Content-Length unrelated to their actual contents, rendering bitcoin-cli and curl unable to decode the reply.

    This patch sets the Content-Length field based on the actual content returned.

    Additionally, pull #4288 clobbered the error descriptions provided in ErrorReply, which bitcoin-cli relies upon; this patch moves #4288's new http-error descriptions to an HTTPError method, allowing HTTPReply to pass content on unchanged.

    Example of the bug:

    bitcoin-cli sendrawtransaction 00 error: couldn't parse reply from server

    Before #4288 / restored by this patch:

    bitcoin-cli sendrawtransaction 00 error: {"code":-22,"message":"TX decode failed"}

  2. fix RPC error replies
    After pull #4288, RPC messages indicating errors have a Content-Length unrelated
    to their actual contents, rendering bitcoin-cli and curl unable to decode the
    reply.
    
    This patch sets the Content-Length field based on the actual content returned.
    
    Additionally, pull #4288 clobbered the error descriptions provided in
    ErrorReply, which bitcoin-cli relies upon; this patch moves #4288 http-error
    descriptions to an HTTPError method, allowing HTTPReply to pass content on
    unchanged.
    16f33f163d
  3. BitcoinPullTester commented at 2:40 AM on June 29, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4440_16f33f163d4e2c10320a96a22bbab71c9a0df195/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  4. laanwj commented at 6:28 AM on June 29, 2014: member

    Tested ACK

  5. jgarzik commented at 2:01 PM on June 29, 2014: contributor

    Odd. Could have sworn the error case was tested. Maybe that was pre-rebase.

    ACK

  6. laanwj merged this on Jun 30, 2014
  7. laanwj closed this on Jun 30, 2014

  8. laanwj referenced this in commit eba8c44fdd on Jun 30, 2014
  9. kazcw deleted the branch on Jun 30, 2014
  10. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me