qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.99k stars 3.89k forks source link

Web UI tries to bind to IP "42" by default #9498

Closed adduxa closed 6 years ago

adduxa commented 6 years ago

qBittorrent version and Operating System

qBittorrent v4.1.2 FreeBSD 11.2-RELEASE-p3 #4 r338638 Compiled from ports with nox

If on linux, libtorrent and Qt version

libtorrent-rasterbar: 1.1.9 qt5-core: 5.11.1

What is the problem

Error "Web UI: Unable to bind to IP: 42, port: 8080. Reason: The address is not available" at start with clean install without configs.

What is the expected behavior

Bind to 0.0.0.0, instead of 42

Steps to reproduce

  1. Compile
  2. Launch qbittorrent-nox

Extra info

If we look at https://github.com/qbittorrent/qBittorrent/blob/master/src/webui/webui.cpp#L96-L97, we can see "*" (asterisk) used as a default bind IP. And asterisk's ASCII code is 42. I think there's automatic type detection problem somewhere. Also, if we look at documentation, QHostAddress::Any is enum and not QHostAddress or string. Shouldn't code above

            const auto address = (serverAddressString == "*" || serverAddressString.isEmpty())
                ? QHostAddress::Any : QHostAddress(serverAddressString);

be like

            const auto address = (serverAddressString == "*" || serverAddressString.isEmpty())
                ? QHostAddress(QHostAddress::Any) : QHostAddress(serverAddressString);

instead?

Workaround

Add

[Preferences]
WebUI\Address=*

to .config/qBittorrent/qBittorrent.conf

Chocobo1 commented 6 years ago

Thanks for the report! Already fixed in #9365, please wait for the next release (v4.1.3) or compile using our master branch.