input/curl: don't set "ready" on _easy_free()
Move the assignment to _request_done(), right before the GCond is signalled. This might fix spurious wakeups.
This commit is contained in:
@@ -383,8 +383,6 @@ input_curl_easy_free(struct input_curl *c)
|
|||||||
|
|
||||||
g_free(c->range);
|
g_free(c->range);
|
||||||
c->range = NULL;
|
c->range = NULL;
|
||||||
|
|
||||||
c->base.ready = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
@@ -432,6 +430,7 @@ input_curl_abort_all_requests(GError *error)
|
|||||||
|
|
||||||
input_curl_easy_free(c);
|
input_curl_easy_free(c);
|
||||||
c->postponed_error = g_error_copy(error);
|
c->postponed_error = g_error_copy(error);
|
||||||
|
c->base.ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
@@ -450,7 +449,6 @@ input_curl_request_done(struct input_curl *c, CURLcode result, long status)
|
|||||||
assert(io_thread_inside());
|
assert(io_thread_inside());
|
||||||
assert(c != NULL);
|
assert(c != NULL);
|
||||||
assert(c->easy == NULL);
|
assert(c->easy == NULL);
|
||||||
assert(c->base.ready);
|
|
||||||
assert(c->postponed_error == NULL);
|
assert(c->postponed_error == NULL);
|
||||||
|
|
||||||
if (result != CURLE_OK) {
|
if (result != CURLE_OK) {
|
||||||
@@ -463,6 +461,7 @@ input_curl_request_done(struct input_curl *c, CURLcode result, long status)
|
|||||||
status);
|
status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c->base.ready = true;
|
||||||
g_cond_broadcast(curl.cond);
|
g_cond_broadcast(curl.cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user