Mercurial > audlegacy-plugins
changeset 401:192004e2a1b7 trunk
[svn] - add connection timeout option to curl_easy_perform(). hopefully, audacious can quit smoothly even though last.fm server goes down.
author | yaz |
---|---|
date | Fri, 29 Dec 2006 04:53:41 -0800 |
parents | de2413cc592e |
children | 1d50eb0b5a0a |
files | ChangeLog src/scrobbler/gerpok.c src/scrobbler/hatena.c src/scrobbler/scrobbler.c src/scrobbler/scrobbler.h |
diffstat | 5 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Dec 28 17:19:22 2006 -0800 +++ b/ChangeLog Fri Dec 29 04:53:41 2006 -0800 @@ -1,3 +1,10 @@ +2006-12-29 01:19:22 +0000 Tony Vroon <chainsaw@gentoo.org> + revision [876] + Play those supertux tunes. + trunk/src/modplug/plugin.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2006-12-28 10:57:42 +0000 Yoshiki Yazawa <yaz@cc.rim.or.jp> revision [874] - add DYEAR and DGENRE support.
--- a/src/scrobbler/gerpok.c Thu Dec 28 17:19:22 2006 -0800 +++ b/src/scrobbler/gerpok.c Fri Dec 29 04:53:41 2006 -0800 @@ -420,6 +420,8 @@ memset(gerpok_sc_curl_errbuf, 0, sizeof(gerpok_sc_curl_errbuf)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, gerpok_sc_curl_errbuf); curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, SC_CURL_TIMEOUT); status = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -634,6 +636,8 @@ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *)submission->str); memset(gerpok_sc_curl_errbuf, 0, sizeof(gerpok_sc_curl_errbuf)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, gerpok_sc_curl_errbuf); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, SC_CURL_TIMEOUT); /* curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
--- a/src/scrobbler/hatena.c Thu Dec 28 17:19:22 2006 -0800 +++ b/src/scrobbler/hatena.c Fri Dec 29 04:53:41 2006 -0800 @@ -387,6 +387,8 @@ memset(hatena_sc_curl_errbuf, 0, sizeof(hatena_sc_curl_errbuf)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, hatena_sc_curl_errbuf); curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, SC_CURL_TIMEOUT); status = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -596,6 +598,8 @@ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *)submission->str); memset(hatena_sc_curl_errbuf, 0, sizeof(hatena_sc_curl_errbuf)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, hatena_sc_curl_errbuf); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, SC_CURL_TIMEOUT); /* curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
--- a/src/scrobbler/scrobbler.c Thu Dec 28 17:19:22 2006 -0800 +++ b/src/scrobbler/scrobbler.c Fri Dec 29 04:53:41 2006 -0800 @@ -419,6 +419,8 @@ memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sc_curl_errbuf); curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, SC_CURL_TIMEOUT); status = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -633,6 +635,8 @@ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *)submission->str); memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf)); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sc_curl_errbuf); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, SC_CURL_TIMEOUT); /* curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
--- a/src/scrobbler/scrobbler.h Thu Dec 28 17:19:22 2006 -0800 +++ b/src/scrobbler/scrobbler.h Fri Dec 29 04:53:41 2006 -0800 @@ -3,6 +3,8 @@ #include "audacious/titlestring.h" +#define SC_CURL_TIMEOUT 5 + int sc_idle(GMutex *); void sc_init(char *, char *); void sc_addentry(GMutex *, TitleInput *, int);