Fixed UPnP for full URLs with scheme#2451
Fixed UPnP for full URLs with scheme#2451ypopovych wants to merge 1 commit intoMusicPlayerDaemon:v0.24.xfrom
Conversation
|
Your commit consists of (at least) 3 distinct changes that deserve to be a separate commit, and your commit message documents none of these changes. It doesn't even describe the problem to be solved, let alone how and why. I don't understand this PR. |
|
Sorry about that - here’s a clearer explanation of what was done and why. These fixes were added because the UPnP database plugin does not handle URLs correctly. There are two separate issues: Bug 1The server may return full URLs instead of relative paths in XML responses. The current UPnP implementation assumes that only paths are returned. It then joins the returned value with the server’s base URL. When a full URL is returned, this results in a malformed URL like: This was fixed in two places:
Bug 2This issue lies in the XML parser logic. The current implementation incorrectly assumes that a URL is returned as a single string. However, when a URL contains query parameters, the parser invokes the callback separately for each segment. As a result, only the last query parameter is captured instead of the full URL. This was fixed in src/db/plugins/upnp/Directory.cxx. The URL buffer is now cleared at the start of each element (once per element) and then incrementally built by appending data in the character data callback. I hope this explanation helps, Yehor. |
|
How do you want me to split it? Do a different PRs? Or to have 2(3?) commits in the one PR? |
|
Not the author, but imo you can split the commits, this is still useful for me since I did struggle on those network path. |
Fixes #2450
To be frank I have zero confidence in URL fix, I simply patched two URL methods to return relative if it has scheme.
XML parser fix is a better one. Current version breaks on URLs with parameters. Parser sends URL by parts split on each
&. With this fix all of them will be concatenated together.Tested on Jellyfin server - works fine (slow, but works).