fanquake
commented at 12:35 pm on January 26, 2026:
member
This builds on all the work being done by pinheadmz and fjahr (#32061, #34342, #34158), to demo a libevent-less bitcoind.
One thing we could decide to change, or not, is the libevent logging catergory. Other than that, any remaining references to libevent, should be in documentation/code comments.
DrahtBot
commented at 12:35 pm on January 26, 2026:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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 typos and grammar issues:
Unrecoverbale -> Unrecoverable [spelling error in comment could momentarily confuse readers]
an unique -> a unique [incorrect article before a consonant-starting word; use “a” instead of “an”]
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):
LookupHost(m_host, 256, true) in src/bitcoin-cli.cpp
Lookup(i->first, i->second, false) in src/httpserver.cpp
Lookup(“0.0.0.0”, 0, false).value() in src/test/httpserver_tests.cpp
2026-02-10 11:11:15
fanquake force-pushed
on Jan 26, 2026
DrahtBot added the label
CI failed
on Jan 26, 2026
pinheadmz
commented at 4:05 pm on January 26, 2026:
member
nit: Pull request description should be replaced by the lyrics of Taylor Swift’s “We Are Never Ever Getting Back Together” before merging.
fanquake force-pushed
on Jan 28, 2026
fanquake force-pushed
on Feb 2, 2026
fanquake force-pushed
on Feb 3, 2026
fanquake force-pushed
on Feb 9, 2026
http: enclose libevent-dependent code in a namespace
This commit is a no-op to isolate HTTP methods and objects that
depend on libevent. Following commits will add replacement objects
and methods in a new namespace for testing and review before
switching over the server.
HTTP Response message:
https://datatracker.ietf.org/doc/html/rfc1945#section-6
Status line (first line of response):
https://datatracker.ietf.org/doc/html/rfc1945#section-6.1
Status code definitions:
https://datatracker.ietf.org/doc/html/rfc1945#section-9
This commit also moves StringToBuffer to test/util/str
since it is now used in more than one test.
006baab3af
http: Implement HTTPRequest class
HTTP Request message:
https://datatracker.ietf.org/doc/html/rfc1945#section-5
Request Line aka Control Line aka first line:
https://datatracker.ietf.org/doc/html/rfc1945#section-5.1
See message_read_status() in libevent http.c for how
`MORE_DATA_EXPECTED` is handled there
cbb3544a81
http: Introduce HTTPServer class and implement binding to listening socket
Introduce a new low-level socket managing class `HTTPServer`.
BindAndStartListening() was copied from CConnMan's BindListenPort()
in net.cpp and modernized.
Unit-test it with a new class `SocketTestingSetup` which mocks
`CreateSock()` and will enable mock client I/O in future commits.
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
990ded02e5
HTTPServer: implement and test AcceptConnection()
AcceptConnection() is mostly copied from CConmann in net.cpp
and then modernized.
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
8c8bff010e
HTTPServer: generate sequential Ids for each newly accepted connection
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
e02b2be95c
http: Introduce HTTPClient classca040ee5f4
HTTPServer: start an I/O loop in a new thread and accept connections
Socket handling methods are copied from CConnMan:
`CConnman::GenerateWaitSockets()`
`CConnman::SocketHandlerListening()`
`CConnman::ThreadSocketHandler()` and `CConnman::SocketHandler()` are combined into ThreadSocketHandler()`.
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
2319814c29
HTTPServer: read requests from connected clients
`SocketHandlerConnected()` adapted from CConnman
Testing this requires adding a new feature to the SocketTestingSetup,
inserting a "request" payload into the mock client that connects
to us.
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
389b77a691
HTTPserver: support "chunked" Transfer-Encodingc8047d4129
HTTPServer: compose and send replies to connected clients
Sockets-touching bits copied and adapted from `CConnman::SocketSendData()`
Testing this requires adding a new feature to the SocketTestingSetup,
returning the DynSock I/O pipes from the mock socket so the received
data can be checked.
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
92a7175415
HTTPServer: disconnect clients48adc0d6f5
Allow http workers to send data optimistically as an optimization229637c00b
HTTPServer: use a queue to pipeline requests from each connected client
See https://www.rfc-editor.org/rfc/rfc7230#section-6.3.2
> A server MAY process a sequence of pipelined requests in
parallel if they all have safe methods (Section 4.2.1 of [RFC7231]),
but it MUST send the corresponding responses in the same order that
the requests were received.
We choose NOT to process requests in parallel. They are executed in
the order recevied as well as responded to in the order received.
This prevents race conditions where old state may get sent in response
to requests that are very quick to process but were requested later on
in the queue.
7e84a226b6
define HTTP request methods at module level outside of class
This is a refactor to prepare for matching the API of HTTPRequest
definitions in both namespaces http_bitcoin and http_libevent. In
particular, to provide a consistent return type for GetRequestMethod()
in both classes.
3b36868c8c
Add helper methods to HTTPRequest to match original API
These methods are called by http_request_cb() and are present in the
original http_libevent::HTTPRequest.
d6219a8e68
refactor: split http_request_cb into libevent callback and dispatch
The original function is passed to libevent as a callback when HTTP
requests are received and processed. It wrapped the libevent request
object in a http_libevent::HTTPRequest and then handed that off to
bitcoin for basic checks and finally dispatch to worker threads.
In this commit we split the function after the
http_libevent::HTTPRequest is created, and pass that object to a new
function that maintains the logic of checking and dispatching.
This will be the merge point for http_libevent and http_bitcoin,
where HTTPRequest objects from either namespace have the same
downstream lifecycle.
7ffbf1e52c
refactor: split HTTPBindAddresses into config parse and libevent setup
The original function was already naturally split into two chunks:
First, we parse and validate the users' RPC configuration for IPs and
ports. Next we bind libevent's http server to the appropriate
endpoints.
This commit splits these chunks into two separate functions, leaving
the argument parsing in the common space of the module and moving the
libevent-specific binding into the http_libevent namespace.
A future commit will implement http_bitcoin::HTTPBindAddresses to
bind the validate list of endpoints by the new HTTP server.
3795db4f7a
HTTPServer: implement control methods to match legacy APIaa2e99db51
HTTPServer: disconnect after idle timeout (-rpcservertimeout)a542792881
http: switch servers from libevent to bitcoincfddee35f6
fuzz: switch http_libevent::HTTPRequest to http_bitcoin::HTTPRequesta92d6cfc6f
http: delete libevent!7c4c7df1f2
common: Add unused UrlEncode functionbd4a5090ae
http: Add HTTPHeader file in common
This will be shared between the http server and the bitcoin-cli http client code.
b08764fe24
cli: Remove libevent usage
Replace libevent-based HTTP client with a simple synchronous implementation using the Sock class directly.
b51d67a46a
refactor: Use constexpr in torcontrol where possible27bcebd8b7
refactor: Modernize member variable names in torcontrol1e50d7a084
refactor: Get rid of unnecessary newlines in logseed5d8f5f4
torcontrol: Remove libevent usage
Replace libevent-based approach with using the Sock class and CThreadInterrupt.
641c52334e
fuzz: Improve torcontrol fuzz test
Gets rid of the Dummy class and adds coverage of get_socks_cb.
cf965cee65
test: Add simple functional test for torcontrolaa82277159
test: Add test for partial message handling in torcontrole4755e5770
test: remove raii_event_tests14354fde42
cmake: remove libevent066fea31b3
depends: remove libeventf22ef20b7d
ci: remove libevent8cb75ada13
vcpkg: remove libeventfe104410c0
doc: remove libevent97b242c6b8
fanquake force-pushed
on Feb 10, 2026
DrahtBot added the label
Needs rebase
on Feb 11, 2026
DrahtBot
commented at 6:01 pm on February 11, 2026:
contributor
🐙 This pull request conflicts with the target branch and needs rebase.
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-02-17 12:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me