Mercurial > audlegacy-plugins
diff src/scrobbler/scrobbler.c @ 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 | 314b7ac7f771 |
children | a3ca00f30af5 |
line wrap: on
line diff
--- 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);