diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-10-20 16:48:03 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-10-20 16:48:56 +0300 |
commit | 0d2a2b4e0793f56a78bc9589dd98b7303efb6d65 (patch) | |
tree | 3f39b19c8a1bc5e434458c0f39bee4c88aebd10c /main/libquvi/fix-redirects.patch | |
parent | edbda7b9abf93a45e9d193e5fe5d1c2badb4fa50 (diff) | |
download | aports-0d2a2b4e0793f56a78bc9589dd98b7303efb6d65.tar.bz2 aports-0d2a2b4e0793f56a78bc9589dd98b7303efb6d65.tar.xz |
main/libquvi: fix redirect handling
Diffstat (limited to 'main/libquvi/fix-redirects.patch')
-rw-r--r-- | main/libquvi/fix-redirects.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/main/libquvi/fix-redirects.patch b/main/libquvi/fix-redirects.patch new file mode 100644 index 0000000000..d6352947e1 --- /dev/null +++ b/main/libquvi/fix-redirects.patch @@ -0,0 +1,29 @@ +Do not use Effective URL if no redirections happened. This fixes to not +drop 'fragment' part of the URL that some services need to identify the +media to play. + +diff -ru libquvi-0.9.4.orig/src/curl/resolve.c libquvi-0.9.4/src/curl/resolve.c +--- libquvi-0.9.4.orig/src/curl/resolve.c 2013-11-04 14:55:25.000000000 -0200 ++++ libquvi-0.9.4/src/curl/resolve.c 2014-10-20 16:36:38.493630381 -0300 +@@ -61,10 +61,17 @@ + + if (curlcode == CURLE_OK && r->status.resp_code == 200) + { +- gchar *u = NULL; +- curl_easy_getinfo(c, CURLINFO_EFFECTIVE_URL, &u); +- /* Leave comparison for resolve_redirections.lua */ +- g_string_assign(r->url.dst, u); ++ long count = 0; ++ curl_easy_getinfo(c, CURLINFO_REDIRECT_COUNT, &count); ++ if (count > 0) ++ { ++ gchar *u = NULL; ++ curl_easy_getinfo(c, CURLINFO_EFFECTIVE_URL, &u); ++ /* Leave comparison for resolve_redirections.lua */ ++ g_string_assign(r->url.dst, u); ++ } ++ else ++ g_string_assign(r->url.dst, r->url.addr->str); + } + else + { |