Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
With the new HTTP server (#35182), if a client sends a complete request and then half-closes its write side (shutdown(SHUT_WR), i.e. sends FIN), the server closes the connection without writing a response. The request is still executed.
Some tools (nc -N, socat) rely on it. Was the change intentional?
This was found while testing v32.0rc
Expected behaviour
The server should write the response and then close, as v31 (libevent) did.
Steps to reproduce
bitcoind -regtest -daemon
python3 -c '
import socket, sys
s = socket.create_connection(("127.0.0.1", 18443))
s.sendall(b"GET / HTTP/1.1\r\nHost: x\r\n\r\n")
s.shutdown(socket.SHUT_WR)
while (d := s.recv(4096)): sys.stdout.buffer.write(d)
'
This on v32rc gives no output.
On v31 it does:
Bitcoin Core starting
HTTP/1.1 405 Method Not Allowed
Date: Wed, 07 Oct 2026 18:57:26 GMT
Content-Length: 41
Content-Type: text/html; charset=ISO-8859-1
JSONRPC server handles only POST requestsâ
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
9dfde64cc3262329051fd05fffe40eecc786a99f
Operating system and version
Arch Linux, kernel 7.1.8-arch1-3
Machine specifications
No response