cli: Replace libevent usage with simple http client #34342

pull fjahr wants to merge 3 commits into bitcoin:master from fjahr:2026-01-cli-noev changing 8 files +758 −117
  1. fjahr commented at 1:27 pm on January 19, 2026: contributor

    Part of the effort to remove the libevent dependency altogether, see #31194

    Draft for now since it depends on a few other PRs in varying ways:

    • Uses LineReader from #34242 (first commit is cherry-picked from there)
    • Uses similar approach to #34158 and this has seen limited review so far
    • Could potentially reuse HTTPHeaders class from #32061 (TODO in code)

    So, please review the PRs above first since the code here might change depending on review feedback there :)

    The change itself replaces the libevent-based HTTP client with a simple synchronous implementation which uses the Sock class directly.

  2. DrahtBot added the label Scripts and tools on Jan 19, 2026
  3. DrahtBot commented at 1:28 pm on January 19, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34342.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34242 (Prepare string and net utils for future HTTP operations by pinheadmz)
    • #34158 (torcontrol: Remove libevent usage by fjahr)
    • #32297 (bitcoin-cli: Add -ipcconnect option by ryanofsky)
    • #32061 (Replace libevent with our own HTTP and socket-handling implementation by pinheadmz)
    • #31260 (scripted-diff: Type-safe settings retrieval by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • [socket(service.GetSAFamily(), SOCK_STREAM, IPPROTO_TCP)] in src/bitcoin-cli.cpp
    • [sock.Send(data + total_sent, remaining, MSG_NOSIGNAL)] in src/bitcoin-cli.cpp

    2026-01-20

  4. DrahtBot added the label CI failed on Jan 19, 2026
  5. DrahtBot commented at 3:30 pm on January 19, 2026: contributor

    🚧 At least one of the CI tasks failed. Task tidy: https://github.com/bitcoin/bitcoin/actions/runs/21139253857/job/60789761512 LLM reason (✨ experimental): Clang-Tidy failure: modernize-use-starts-ends-with flags substr usage in bitcoin-cli.cpp, treated as error and causing CI to fail.

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  6. fjahr force-pushed on Jan 19, 2026
  7. string: add LineReader
    This is a helper struct to parse HTTP messages from data in buffers
    from sockets. HTTP messages begin with headers which are
    CRLF-terminated lines (\n or \r\n) followed by an arbitrary amount of
    body data. Whitespace is trimmed from the field lines but not the body.
    
    https://httpwg.org/specs/rfc9110.html#rfc.section.5
    c014350b9b
  8. common: Add unused UrlEncode function c78282e19c
  9. fjahr force-pushed on Jan 19, 2026
  10. fjahr force-pushed on Jan 20, 2026
  11. cli: Remove libevent usage
    Replace libevent-based HTTP client with a simple synchronous implementation using the Sock class directly.
    7a27975583
  12. fjahr force-pushed on Jan 20, 2026
  13. DrahtBot removed the label CI failed on Jan 20, 2026

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-01-21 00:13 UTC

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