aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-16 08:31:17 +0200
committerMax Kellermann <max@duempel.org>2011-09-16 09:11:09 +0200
commit856b0e6886e162d15145550c498bdf3ed9c73a7a (patch)
treef64f1a5d5f2186173b9ec588175c6121befeba6b /src
parentbf1eb46b8733a81d9c904a200ffcd4fd8db413de (diff)
downloadmpd-856b0e6886e162d15145550c498bdf3ed9c73a7a.tar.gz
mpd-856b0e6886e162d15145550c498bdf3ed9c73a7a.tar.xz
mpd-856b0e6886e162d15145550c498bdf3ed9c73a7a.zip
input/curl: remove _schedule_update()
Call _update_fds() directly. This is possible because it's only called from within the I/O thread.
Diffstat (limited to 'src')
-rw-r--r--src/input/curl_input_plugin.c49
1 files changed, 1 insertions, 48 deletions
diff --git a/src/input/curl_input_plugin.c b/src/input/curl_input_plugin.c
index fdfc3ae05..4b0c7acd8 100644
--- a/src/input/curl_input_plugin.c
+++ b/src/input/curl_input_plugin.c
@@ -147,11 +147,6 @@ static struct {
GSList *fds;
- /**
- * When this is non-zero, then an update of #fds is scheduled.
- */
- guint dirty_source_id;
-
#if LIBCURL_VERSION_NUM >= 0x070f04
/**
* Did CURL give us a timeout? If yes, then we need to call
@@ -305,38 +300,6 @@ curl_update_fds(void)
}
/**
- * Callback for curl_schedule_update() that runs in the I/O thread.
- */
-static gboolean
-input_curl_dirty_callback(G_GNUC_UNUSED gpointer data)
-{
- assert(io_thread_inside());
- assert(curl.dirty_source_id != 0 || curl.requests == NULL);
- curl.dirty_source_id = 0;
-
- curl_update_fds();
-
- return false;
-}
-
-/**
- * Schedule a refresh of curl.fds. Does nothing if that is already
- * scheduled.
- *
- * No lock needed.
- */
-static void
-input_curl_schedule_update(void)
-{
- if (curl.dirty_source_id != 0)
- /* already scheduled */
- return;
-
- curl.dirty_source_id =
- io_thread_idle_add(input_curl_dirty_callback, NULL);
-}
-
-/**
* Runs in the I/O thread. No lock needed.
*/
static bool
@@ -357,7 +320,7 @@ input_curl_easy_add(struct input_curl *c, GError **error_r)
return false;
}
- input_curl_schedule_update();
+ curl_update_fds();
return true;
}
@@ -721,16 +684,6 @@ curl_destroy_sources(G_GNUC_UNUSED gpointer data)
{
g_source_destroy(curl.source);
- if (curl.dirty_source_id != 0) {
- GSource *source =
- g_main_context_find_source_by_id(io_thread_context(),
- curl.dirty_source_id);
- assert(source != NULL);
- curl.dirty_source_id = 0;
-
- g_source_destroy(source);
- }
-
return NULL;
}