Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed curl failure handling.

  • Loading branch information...
commit be1d71e79a7d4308a9f8469439b8ee348df5e357 1 parent 54abde1
Tilman Sauerbeck authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/xmms2-scrobbler.c
View
11 src/xmms2-scrobbler.c
@@ -179,12 +179,7 @@ handle_submission_reponse (void *ptr, size_t size, size_t nmemb,
*is_success = true;
} else if (total >= strlen ("FAILED ")) {
fprintf (stderr, "couldn't submit: '%s'\n", (char *) ptr);
- hard_failure_count++;
- } else
- hard_failure_count++;
-
- if (hard_failure_count == 3)
- need_handshake = true;
+ }
return total;
}
@@ -328,6 +323,10 @@ curl_thread (void *arg)
curl_easy_setopt (curl, CURLOPT_WRITEDATA, &is_success);
curl_easy_perform (curl);
+ if (!is_success && !need_handshake &&
+ ++hard_failure_count == 3)
+ need_handshake = true;
+
if (is_success ||
submission->type == SUBMISSION_TYPE_NOW_PLAYING) {
/* if the submission was successful, or if it was a
Please sign in to comment.
Something went wrong with that request. Please try again.