Skip to content

Fix UPnP not working

Yaroslav Kurlaev requested to merge ykurlaev/libktorrent:upnp-fix into master

One issue that is separated to the first commit was occuring when URLs in the router XML description doesn't have full URL with host and port. For, example, MiniUPnPd replies with the following XML:

<controlURL>/ctl/L3F</controlURL>

Other application seems to handle this case so it makes sense to support it even if it doesn't conform to the standard (I'm not sure if it is though).

This bug https://bugs.kde.org/show_bug.cgi?id=404135 contains dumps with this issue.

But also it looked like there are other issues as well.

start() call after the creation of the HTTPRequest instance was removed in the commit d671f62f and I'm not sure how it is supposed to work without it. It looks like UPnP does work in some cases so please tell me if I misunderstood something or need to change something in my commit.

And also it looked like HTTPRequest::replyFinished connected to QNetworkAccessManager::finished was triggering after connectToHost. I changed it to be connected to QNetworkReply::finished.

It also seems to fix GetExternalIP that was mentioned in the commit I mentioned above.

Merge request reports