webui fails to parse any and all headers on gentoo musl/llvm host #17460

Open
opened 2026-02-22 03:51:12 -05:00 by deekerman · 10 comments
Owner

Originally created by @SuspiciousDuck on GitHub (Jan 20, 2026).

qBittorrent & operating system versions

qBittorrent: >5.0.5 including latest git
Operating System: Gentoo (musl/llvm profile)
Qt: 6.10.1
libtorrent-rasterbar: 2.0.10

What is the problem?

When using a qBittorrent version higher than 5.0.5 with a webui, all requests made to the webui endpoint fail with code 400, including empty requests. The stdout/stderr log (not qBittorrent.log) only has the following message:

RequestParser::ParseResult Http::RequestParser::doParse(const QByteArrayView) header parsing error
Bad Http request, closing socket. IP: ::1

Steps to reproduce

  1. Attempt to make any request to qBittorrent's webui, via browser, curl, whatever
  2. 400 response, and the previous "header parsing error" message in the log

Additional context

No response

Log(s) & preferences file(s)

sensitive data has been replaced with "censored", and in some areas I have omitted text.
qbittorrent.log
qBittorrent.conf

Originally created by @SuspiciousDuck on GitHub (Jan 20, 2026). ### qBittorrent & operating system versions qBittorrent: >5.0.5 including latest git Operating System: Gentoo (musl/llvm profile) Qt: 6.10.1 libtorrent-rasterbar: 2.0.10 ### What is the problem? When using a qBittorrent version higher than 5.0.5 with a webui, all requests made to the webui endpoint fail with code 400, including empty requests. The stdout/stderr log (not qBittorrent.log) only has the following message: ``` RequestParser::ParseResult Http::RequestParser::doParse(const QByteArrayView) header parsing error Bad Http request, closing socket. IP: ::1 ``` ### Steps to reproduce 1. Attempt to make any request to qBittorrent's webui, via browser, curl, whatever 2. 400 response, and the previous "header parsing error" message in the log ### Additional context _No response_ ### Log(s) & preferences file(s) sensitive data has been replaced with "censored", and in some areas I have omitted text. [qbittorrent.log](https://github.com/user-attachments/files/24755441/qbittorrent.log) [qBittorrent.conf](https://github.com/user-attachments/files/24755460/qBittorrent.txt)
Author
Owner

@vafada commented on GitHub (Jan 21, 2026):

can you paste curl logs of the actual request? including http headers.

@vafada commented on GitHub (Jan 21, 2026): can you paste `curl` logs of the actual request? including http headers.
Author
Owner

@SuspiciousDuck commented on GitHub (Jan 21, 2026):

$ curl -vvvv http://127.0.0.1:4080
08:42:35.218447 [0-x] * [MULTI] [INIT] added to multi, mid=1, running=1, total=2
08:42:35.218659 [0-x] * [MULTI] [INIT] multi_wait(fds=1, timeout=0) tinternal=0
08:42:35.218948 [0-x] * [MULTI] [INIT] -> [SETUP]
08:42:35.219127 [0-x] * [MULTI] [SETUP] -> [CONNECT]
08:42:35.219316 [0-x] * [READ] client_reset, clear readers
08:42:35.219604 [0-0] * [MULTI] [CONNECT] [CPOOL] added connection 0. The cache now contains 1 members
08:42:35.219997 [0-0] * [SETUP] added
08:42:35.220136 [0-0] * [MULTI] [CONNECT] -> [CONNECTING]
08:42:35.220394 [0-0] * [HAPPY-EYEBALLS] init ip ballers for transport 3
08:42:35.220706 [0-0] * [HAPPY-EYEBALLS] starting first attempt for ipv4 -> 0
08:42:35.221090 [0-0] *   Trying 127.0.0.1:4080...
08:42:35.221352 [0-0] * [TCP] cf_socket_open() -> 0, fd=4
08:42:35.221739 [0-0] * [TCP] local address 127.0.0.1 port 59176...
08:42:35.222084 [0-0] * [HAPPY-EYEBALLS] checked connect attempts: 1 ongoing, 0 inconclusive
08:42:35.222481 [0-0] * [SETUP] Curl_conn_connect(block=0) -> 0, done=0
08:42:35.222810 [0-0] * [TCP] adjust_pollset, !connected, POLLOUT fd=4
08:42:35.223143 [0-0] * [HAPPY-EYEBALLS] adjust_pollset -> 0, 1 socks
08:42:35.223492 [0-0] * [MULTI] [CONNECTING] multi_wait pollset[fd=4 OUT], timeouts=0
08:42:35.223925 [0-0] * [MULTI] [CONNECTING] multi_wait(fds=2, timeout=1000) tinternal=-1
08:42:35.224359 [0-0] * [TCP] connected on fd=4
08:42:35.224596 [0-0] * [HAPPY-EYEBALLS] connect attempt #0 successful
08:42:35.224975 [0-0] * [TIMER] [HAPPY_EYEBALLS] cleared
08:42:35.225269 [0-0] * [HAPPY-EYEBALLS] Connected to 127.0.0.1 (127.0.0.1) port 4080
08:42:35.225694 [0-0] * [SETUP] Curl_conn_connect(block=0) -> 0, done=1
08:42:35.226046 [0-0] * Established connection to 127.0.0.1 (127.0.0.1 port 4080) from 127.0.0.1 port 59176
08:42:35.226606 [0-0] * [MULTI] [CONNECTING] -> [PROTOCONNECT]
08:42:35.226884 [0-0] * [MULTI] [PROTOCONNECT] -> [DO]
08:42:35.227068 [0-0] * [SETUP] query ALPN
08:42:35.227219 [0-0] * using HTTP/1.x
08:42:35.227361 [0-0] * [MULTI] [DO] xfer_setup: recv_idx=0, send_idx=0
08:42:35.227664 [0-0] * [TCP] send(len=78) -> 0, 78
08:42:35.227843 [0-0] => Send header, 78 bytes (0x4e)
0000: GET / HTTP/1.1
0010: Host: 127.0.0.1:4080
0026: User-Agent: curl/8.17.0
003f: Accept: */*
004c:
08:42:35.228440 [0-0] * [MULTI] [DO] -> [DID]
08:42:35.228599 [0-0] * [MULTI] [DID] -> [PERFORMING]
08:42:35.228803 [0-0] * [TCP] recv(len=102400) -> 0, 103
08:42:35.228931 [0-0] <= Recv header, 26 bytes (0x1a)
0000: HTTP/1.1 400 Bad Request
08:42:35.229128 [0-0] * [WRITE] [OUT] wrote 26 header bytes -> 26
08:42:35.229280 [0-0] * [WRITE] [PAUSE] writing 26/26 bytes of type c -> 0
08:42:35.229474 [0-0] * [WRITE] download_write header(type=c, blen=26) -> 0
08:42:35.229671 [0-0] * [WRITE] client_write(type=c, len=26) -> 0
08:42:35.229846 [0-0] <= Recv header, 19 bytes (0x13)
0000: connection: close
08:42:35.230042 [0-0] * [WRITE] header_collect pushed(type=1, len=19) -> 0
08:42:35.230244 [0-0] * [WRITE] [OUT] wrote 19 header bytes -> 19
08:42:35.230404 [0-0] * [WRITE] [PAUSE] writing 19/19 bytes of type 4 -> 0
08:42:35.230609 [0-0] * [WRITE] download_write header(type=4, blen=19) -> 0
08:42:35.230818 [0-0] * [WRITE] client_write(type=4, len=19) -> 0
08:42:35.230993 [0-0] <= Recv header, 19 bytes (0x13)
0000: content-length: 0
08:42:35.231174 [0-0] * [WRITE] header_collect pushed(type=1, len=19) -> 0
08:42:35.231379 [0-0] * [WRITE] [OUT] wrote 19 header bytes -> 19
08:42:35.231552 [0-0] * [WRITE] [PAUSE] writing 19/19 bytes of type 4 -> 0
08:42:35.231754 [0-0] * [WRITE] download_write header(type=4, blen=19) -> 0
08:42:35.231947 [0-0] * [WRITE] client_write(type=4, len=19) -> 0
08:42:35.232118 [0-0] <= Recv header, 37 bytes (0x25)
0000: date: Wed, 21 Jan 2026 14:42:35 GMT
08:42:35.232348 [0-0] * [WRITE] header_collect pushed(type=1, len=37) -> 0
08:42:35.232558 [0-0] * [WRITE] [OUT] wrote 37 header bytes -> 37
08:42:35.232735 [0-0] * [WRITE] [PAUSE] writing 37/37 bytes of type 4 -> 0
08:42:35.232941 [0-0] * [WRITE] download_write header(type=4, blen=37) -> 0
08:42:35.233156 [0-0] * [WRITE] client_write(type=4, len=37) -> 0
08:42:35.233351 [0-0] <= Recv header, 2 bytes (0x2)
0000:
08:42:35.233467 [0-0] * [WRITE] header_collect pushed(type=1, len=2) -> 0
08:42:35.233608 [0-0] * [WRITE] [OUT] wrote 2 header bytes -> 2
08:42:35.233736 [0-0] * [WRITE] [PAUSE] writing 2/2 bytes of type 4 -> 0
08:42:35.233879 [0-0] * [WRITE] download_write header(type=4, blen=2) -> 0
08:42:35.234060 [0-0] * [WRITE] client_write(type=4, len=2) -> 0
08:42:35.234190 [0-0] * [WRITE] xfer_write_resp(len=103, eos=0) -> 0
08:42:35.234322 [0-0] * [MULTI] [PERFORMING] sendrecv_dl() no EAGAIN/pending data, mark as dirty
08:42:35.234513 [0-0] * we are done reading and this is set to close, stop send
08:42:35.234683 [0-0] * abort upload
08:42:35.234796 [0-0] * [MULTI] [PERFORMING] -> [DONE]
08:42:35.234909 [0-0] * [MULTI] [DONE] multi_done: status: 0 prem: 0 done: 0
08:42:35.235062 [0-0] * [WRITE] [OUT] done
08:42:35.235150 [0-0] * [READ] client_reset, clear readers
08:42:35.235265 [0-x] * [MULTI] [DONE] multi_done_locked, in use=0
08:42:35.235466 [0-0] * [MULTI] [DONE] multi_done, terminating conn #0 to 127.0.0.1:4080, forbid=0, close=1, premature=0, conn_multiplex=0
08:42:35.235739 [0-0] * shutting down connection #0
08:42:35.235928 [0-0] * [MULTI] [DONE] -> [COMPLETED]
08:42:35.236091 [0-0] * [MULTI] [COMPLETED] -> [MSGSENT]
08:42:35.236200 [0-0] * [MULTI] [COMPLETED] removed from multi, mid=1, running=0, total=1
RequestParser::ParseResult Http::RequestParser::doParse(const QByteArrayView) header parsing error
Bad Http request, closing socket. IP: ::ffff:127.0.0.1
@SuspiciousDuck commented on GitHub (Jan 21, 2026): ``` $ curl -vvvv http://127.0.0.1:4080 08:42:35.218447 [0-x] * [MULTI] [INIT] added to multi, mid=1, running=1, total=2 08:42:35.218659 [0-x] * [MULTI] [INIT] multi_wait(fds=1, timeout=0) tinternal=0 08:42:35.218948 [0-x] * [MULTI] [INIT] -> [SETUP] 08:42:35.219127 [0-x] * [MULTI] [SETUP] -> [CONNECT] 08:42:35.219316 [0-x] * [READ] client_reset, clear readers 08:42:35.219604 [0-0] * [MULTI] [CONNECT] [CPOOL] added connection 0. The cache now contains 1 members 08:42:35.219997 [0-0] * [SETUP] added 08:42:35.220136 [0-0] * [MULTI] [CONNECT] -> [CONNECTING] 08:42:35.220394 [0-0] * [HAPPY-EYEBALLS] init ip ballers for transport 3 08:42:35.220706 [0-0] * [HAPPY-EYEBALLS] starting first attempt for ipv4 -> 0 08:42:35.221090 [0-0] * Trying 127.0.0.1:4080... 08:42:35.221352 [0-0] * [TCP] cf_socket_open() -> 0, fd=4 08:42:35.221739 [0-0] * [TCP] local address 127.0.0.1 port 59176... 08:42:35.222084 [0-0] * [HAPPY-EYEBALLS] checked connect attempts: 1 ongoing, 0 inconclusive 08:42:35.222481 [0-0] * [SETUP] Curl_conn_connect(block=0) -> 0, done=0 08:42:35.222810 [0-0] * [TCP] adjust_pollset, !connected, POLLOUT fd=4 08:42:35.223143 [0-0] * [HAPPY-EYEBALLS] adjust_pollset -> 0, 1 socks 08:42:35.223492 [0-0] * [MULTI] [CONNECTING] multi_wait pollset[fd=4 OUT], timeouts=0 08:42:35.223925 [0-0] * [MULTI] [CONNECTING] multi_wait(fds=2, timeout=1000) tinternal=-1 08:42:35.224359 [0-0] * [TCP] connected on fd=4 08:42:35.224596 [0-0] * [HAPPY-EYEBALLS] connect attempt #0 successful 08:42:35.224975 [0-0] * [TIMER] [HAPPY_EYEBALLS] cleared 08:42:35.225269 [0-0] * [HAPPY-EYEBALLS] Connected to 127.0.0.1 (127.0.0.1) port 4080 08:42:35.225694 [0-0] * [SETUP] Curl_conn_connect(block=0) -> 0, done=1 08:42:35.226046 [0-0] * Established connection to 127.0.0.1 (127.0.0.1 port 4080) from 127.0.0.1 port 59176 08:42:35.226606 [0-0] * [MULTI] [CONNECTING] -> [PROTOCONNECT] 08:42:35.226884 [0-0] * [MULTI] [PROTOCONNECT] -> [DO] 08:42:35.227068 [0-0] * [SETUP] query ALPN 08:42:35.227219 [0-0] * using HTTP/1.x 08:42:35.227361 [0-0] * [MULTI] [DO] xfer_setup: recv_idx=0, send_idx=0 08:42:35.227664 [0-0] * [TCP] send(len=78) -> 0, 78 08:42:35.227843 [0-0] => Send header, 78 bytes (0x4e) 0000: GET / HTTP/1.1 0010: Host: 127.0.0.1:4080 0026: User-Agent: curl/8.17.0 003f: Accept: */* 004c: 08:42:35.228440 [0-0] * [MULTI] [DO] -> [DID] 08:42:35.228599 [0-0] * [MULTI] [DID] -> [PERFORMING] 08:42:35.228803 [0-0] * [TCP] recv(len=102400) -> 0, 103 08:42:35.228931 [0-0] <= Recv header, 26 bytes (0x1a) 0000: HTTP/1.1 400 Bad Request 08:42:35.229128 [0-0] * [WRITE] [OUT] wrote 26 header bytes -> 26 08:42:35.229280 [0-0] * [WRITE] [PAUSE] writing 26/26 bytes of type c -> 0 08:42:35.229474 [0-0] * [WRITE] download_write header(type=c, blen=26) -> 0 08:42:35.229671 [0-0] * [WRITE] client_write(type=c, len=26) -> 0 08:42:35.229846 [0-0] <= Recv header, 19 bytes (0x13) 0000: connection: close 08:42:35.230042 [0-0] * [WRITE] header_collect pushed(type=1, len=19) -> 0 08:42:35.230244 [0-0] * [WRITE] [OUT] wrote 19 header bytes -> 19 08:42:35.230404 [0-0] * [WRITE] [PAUSE] writing 19/19 bytes of type 4 -> 0 08:42:35.230609 [0-0] * [WRITE] download_write header(type=4, blen=19) -> 0 08:42:35.230818 [0-0] * [WRITE] client_write(type=4, len=19) -> 0 08:42:35.230993 [0-0] <= Recv header, 19 bytes (0x13) 0000: content-length: 0 08:42:35.231174 [0-0] * [WRITE] header_collect pushed(type=1, len=19) -> 0 08:42:35.231379 [0-0] * [WRITE] [OUT] wrote 19 header bytes -> 19 08:42:35.231552 [0-0] * [WRITE] [PAUSE] writing 19/19 bytes of type 4 -> 0 08:42:35.231754 [0-0] * [WRITE] download_write header(type=4, blen=19) -> 0 08:42:35.231947 [0-0] * [WRITE] client_write(type=4, len=19) -> 0 08:42:35.232118 [0-0] <= Recv header, 37 bytes (0x25) 0000: date: Wed, 21 Jan 2026 14:42:35 GMT 08:42:35.232348 [0-0] * [WRITE] header_collect pushed(type=1, len=37) -> 0 08:42:35.232558 [0-0] * [WRITE] [OUT] wrote 37 header bytes -> 37 08:42:35.232735 [0-0] * [WRITE] [PAUSE] writing 37/37 bytes of type 4 -> 0 08:42:35.232941 [0-0] * [WRITE] download_write header(type=4, blen=37) -> 0 08:42:35.233156 [0-0] * [WRITE] client_write(type=4, len=37) -> 0 08:42:35.233351 [0-0] <= Recv header, 2 bytes (0x2) 0000: 08:42:35.233467 [0-0] * [WRITE] header_collect pushed(type=1, len=2) -> 0 08:42:35.233608 [0-0] * [WRITE] [OUT] wrote 2 header bytes -> 2 08:42:35.233736 [0-0] * [WRITE] [PAUSE] writing 2/2 bytes of type 4 -> 0 08:42:35.233879 [0-0] * [WRITE] download_write header(type=4, blen=2) -> 0 08:42:35.234060 [0-0] * [WRITE] client_write(type=4, len=2) -> 0 08:42:35.234190 [0-0] * [WRITE] xfer_write_resp(len=103, eos=0) -> 0 08:42:35.234322 [0-0] * [MULTI] [PERFORMING] sendrecv_dl() no EAGAIN/pending data, mark as dirty 08:42:35.234513 [0-0] * we are done reading and this is set to close, stop send 08:42:35.234683 [0-0] * abort upload 08:42:35.234796 [0-0] * [MULTI] [PERFORMING] -> [DONE] 08:42:35.234909 [0-0] * [MULTI] [DONE] multi_done: status: 0 prem: 0 done: 0 08:42:35.235062 [0-0] * [WRITE] [OUT] done 08:42:35.235150 [0-0] * [READ] client_reset, clear readers 08:42:35.235265 [0-x] * [MULTI] [DONE] multi_done_locked, in use=0 08:42:35.235466 [0-0] * [MULTI] [DONE] multi_done, terminating conn #0 to 127.0.0.1:4080, forbid=0, close=1, premature=0, conn_multiplex=0 08:42:35.235739 [0-0] * shutting down connection #0 08:42:35.235928 [0-0] * [MULTI] [DONE] -> [COMPLETED] 08:42:35.236091 [0-0] * [MULTI] [COMPLETED] -> [MSGSENT] 08:42:35.236200 [0-0] * [MULTI] [COMPLETED] removed from multi, mid=1, running=0, total=1 ``` ``` RequestParser::ParseResult Http::RequestParser::doParse(const QByteArrayView) header parsing error Bad Http request, closing socket. IP: ::ffff:127.0.0.1 ```
Author
Owner

@vafada commented on GitHub (Jan 21, 2026):

Header look good:

08:42:35.227843 [0-0] => Send header, 78 bytes (0x4e)
0000: GET / HTTP/1.1
0010: Host: 127.0.0.1:4080
0026: User-Agent: curl/8.17.0
003f: Accept: */*
004c:

Not sure what going on then. On my local, I get a valid response (200):

$ curl -v http://localhost:8080
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< cache-control: no-store
< connection: keep-alive
< content-length: 26154
@vafada commented on GitHub (Jan 21, 2026): Header look good: ``` 08:42:35.227843 [0-0] => Send header, 78 bytes (0x4e) 0000: GET / HTTP/1.1 0010: Host: 127.0.0.1:4080 0026: User-Agent: curl/8.17.0 003f: Accept: */* 004c: ``` Not sure what going on then. On my local, I get a valid response (200): ``` $ curl -v http://localhost:8080 * Host localhost:8080 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:8080... * Connected to localhost (::1) port 8080 > GET / HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 200 OK < cache-control: no-store < connection: keep-alive < content-length: 26154 ```
Author
Owner

@LookLotsOfPeople commented on GitHub (Jan 26, 2026):

Not sure what going on then. On my local, I get a valid response (200):

$ curl -v http://localhost:8080
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< cache-control: no-store
< connection: keep-alive
< content-length: 26154

Is this tested with a LLVM/musl-based build or just a replication on a non-musl machine? I'm in the same bucket of facing this bug after upgrading from qBittorrent 5.0.5 to 5.1.2 as well as from QT 6.9.X to 6.10.1 back in November. Luckily my setup is non-essential so I've been holding off on reporting anything (either here or on the Gentoo bugs tracker) until version v5.2.0 is released (as it explicitly advertises QT 6.10 support).

Gentoo has since removed QT 6.9.X from it's main mirror repository, but if you think there might be value in it, I can try rebuilding 5.1.2 (or master) against QT 6.9.3 to see if it's a musl incompatibility with qBittorrent-nox 5.1 and QT 6.10.

@LookLotsOfPeople commented on GitHub (Jan 26, 2026): > Not sure what going on then. On my local, I get a valid response (200): > > ``` > $ curl -v http://localhost:8080 > * Host localhost:8080 was resolved. > * IPv6: ::1 > * IPv4: 127.0.0.1 > * Trying [::1]:8080... > * Connected to localhost (::1) port 8080 > > GET / HTTP/1.1 > > Host: localhost:8080 > > User-Agent: curl/8.5.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < cache-control: no-store > < connection: keep-alive > < content-length: 26154 > ``` Is this tested with a LLVM/musl-based build or just a replication on a non-musl machine? I'm in the same bucket of facing this bug after upgrading from qBittorrent 5.0.5 to 5.1.2 as well as from QT 6.9.X to 6.10.1 back in November. Luckily my setup is non-essential so I've been holding off on reporting anything (either here or on the Gentoo bugs tracker) until version v5.2.0 is released (as it explicitly advertises QT 6.10 support). Gentoo has since removed QT 6.9.X from it's main mirror repository, but if you think there might be value in it, I can try rebuilding 5.1.2 (or master) against QT 6.9.3 to see if it's a musl incompatibility with qBittorrent-nox 5.1 and QT 6.10.
Author
Owner

@vafada commented on GitHub (Jan 26, 2026):

Not sure what going on then. On my local, I get a valid response (200):

$ curl -v http://localhost:8080
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< cache-control: no-store
< connection: keep-alive
< content-length: 26154

Is this tested with a LLVM/musl-based build or just a replication on a non-musl machine? I'm in the same bucket of facing this bug after upgrading from qBittorrent 5.0.5 to 5.1.2 as well as from QT 6.9.X to 6.10.1 back in November. Luckily my setup is non-essential so I've been holding off on reporting anything (either here or on the Gentoo bugs tracker) until version v5.2.0 is released (as it explicitly advertises QT 6.10 support).

Gentoo has since removed QT 6.9.X from it's main mirror repository, but if you think there might be value in it, I can try rebuilding 5.1.2 (or master) against QT 6.9.3 to see if it's a musl incompatibility with qBittorrent-nox 5.1 and QT 6.10.

I have no idea. Just a regular Ubuntu distro "Ubuntu 24.04.2 LTS".

The OP is hitting this error:

github.com/qbittorrent/qBittorrent@b3ddcacda3/src/base/http/requestparser.cpp (L108)

And that happens if the parseStartLines returns false

github.com/qbittorrent/qBittorrent@b3ddcacda3/src/base/http/requestparser.cpp (L164-L201)

Looking at the function, it will return false

  • If the request headers are 0 lines after splitting it via CRLF
  • If the first line is invalid: edit: GET / HTTP/1.1 <-- is valid
  • If the key-value pairs after the first line is missing a value

Debug that method to find the problem

@vafada commented on GitHub (Jan 26, 2026): > > Not sure what going on then. On my local, I get a valid response (200): > > ``` > > $ curl -v http://localhost:8080 > > * Host localhost:8080 was resolved. > > * IPv6: ::1 > > * IPv4: 127.0.0.1 > > * Trying [::1]:8080... > > * Connected to localhost (::1) port 8080 > > > GET / HTTP/1.1 > > > Host: localhost:8080 > > > User-Agent: curl/8.5.0 > > > Accept: */* > > > > > < HTTP/1.1 200 OK > > < cache-control: no-store > > < connection: keep-alive > > < content-length: 26154 > > ``` > > Is this tested with a LLVM/musl-based build or just a replication on a non-musl machine? I'm in the same bucket of facing this bug after upgrading from qBittorrent 5.0.5 to 5.1.2 as well as from QT 6.9.X to 6.10.1 back in November. Luckily my setup is non-essential so I've been holding off on reporting anything (either here or on the Gentoo bugs tracker) until version v5.2.0 is released (as it explicitly advertises QT 6.10 support). > > Gentoo has since removed QT 6.9.X from it's main mirror repository, but if you think there might be value in it, I can try rebuilding 5.1.2 (or master) against QT 6.9.3 to see if it's a musl incompatibility with qBittorrent-nox 5.1 and QT 6.10. I have no idea. Just a regular Ubuntu distro "Ubuntu 24.04.2 LTS". The OP is hitting this error: https://github.com/qbittorrent/qBittorrent/blob/b3ddcacda339af06727660e9cb780d621c2efdfa/src/base/http/requestparser.cpp#L108 And that happens if the `parseStartLines` returns `false` https://github.com/qbittorrent/qBittorrent/blob/b3ddcacda339af06727660e9cb780d621c2efdfa/src/base/http/requestparser.cpp#L164-L201 Looking at the function, it will return `false` - If the request headers are 0 lines after splitting it via `CRLF` - If the first line is invalid: **edit**: `GET / HTTP/1.1` <-- _is valid_ - If the key-value pairs after the first line is missing a value Debug that method to find the problem
Author
Owner

@glassez commented on GitHub (Jan 26, 2026):

  • If the first line is invalid: GET / HTTP/1.1

Is GET / HTTP/1.1 invalid?

@glassez commented on GitHub (Jan 26, 2026): > * If the first line is invalid: `GET / HTTP/1.1` Is `GET / HTTP/1.1` invalid?
Author
Owner

@vafada commented on GitHub (Jan 26, 2026):

  • If the first line is invalid: GET / HTTP/1.1

Is GET / HTTP/1.1 invalid?

GET / HTTP/1.1 is valid

@vafada commented on GitHub (Jan 26, 2026): > > * If the first line is invalid: `GET / HTTP/1.1` > > Is `GET / HTTP/1.1` invalid? `GET / HTTP/1.1` is valid
Author
Owner

@glassez commented on GitHub (Jan 26, 2026):

  • If the first line is invalid: GET / HTTP/1.1

Is GET / HTTP/1.1 invalid?

GET / HTTP/1.1 is valid

So why do you cite it as an example of the invalid one?

@glassez commented on GitHub (Jan 26, 2026): > > > * If the first line is invalid: `GET / HTTP/1.1` > > > > > > Is `GET / HTTP/1.1` invalid? > > `GET / HTTP/1.1` is valid So why do you cite it as an example of the invalid one?
Author
Owner

@LookLotsOfPeople commented on GitHub (Jan 26, 2026):

Here's what I found after following up on your lead. EOH is evaluating to an empty string (which seems to me more as a LLVM issue than a musl issue, but I could not find how to properly resolve the issue to figure out the cause). CRLF.repeated(2) does properly evaluate during runtime, so it seems to be a compile-time issue.

Changing this line to the following (i.e., manually conducting the inline operation) fixes the issue for my setup:
github.com/qbittorrent/qBittorrent@b3ddcacda3/src/base/http/requestparser.cpp (L54)

const QByteArray EOH = QByteArrayLiteral("\x0D\x0A").repeated(2);

@SuspiciousDuck would you be able to confirm if this also fixes it for your setup?

qBittorrent: 5.1.2
libtorrent-rasterbar: 2.0.10
QT: 6.10.1
LLVM: 21.1.8
Musl: 1.2.5

@LookLotsOfPeople commented on GitHub (Jan 26, 2026): Here's what I found after following up on your lead. EOH is evaluating to an empty string (which seems to me more as a LLVM issue than a musl issue, but I could not find how to properly resolve the issue to figure out the cause). `CRLF.repeated(2)` does properly evaluate during runtime, so it seems to be a compile-time issue. Changing this line to the following (i.e., manually conducting the inline operation) fixes the issue for my setup: https://github.com/qbittorrent/qBittorrent/blob/b3ddcacda339af06727660e9cb780d621c2efdfa/src/base/http/requestparser.cpp#L54 ``` const QByteArray EOH = QByteArrayLiteral("\x0D\x0A").repeated(2); ``` @SuspiciousDuck would you be able to confirm if this also fixes it for your setup? qBittorrent: 5.1.2 libtorrent-rasterbar: 2.0.10 QT: 6.10.1 LLVM: 21.1.8 Musl: 1.2.5
Author
Owner

@SuspiciousDuck commented on GitHub (Jan 26, 2026):

@LookLotsOfPeople I patched qbittorrent-9999 to your change, and it builds and runs perfectly fine (so far). Thanks a lot for looking into this.

@SuspiciousDuck commented on GitHub (Jan 26, 2026): @LookLotsOfPeople I patched qbittorrent-9999 to your change, and it builds and runs perfectly fine (so far). Thanks a lot for looking into this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#17460
No description provided.