aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/CurlInputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-28 23:35:01 +0100
committerMax Kellermann <max@duempel.org>2013-01-28 23:35:01 +0100
commitcffc78ad6a978c8ef0afae4fbdd4b189612a7167 (patch)
tree2496679726754549fd6aad4da0ab558b07bbe0bf /src/input/CurlInputPlugin.cxx
parentdcf55c7e328578d435eb14277cb6ba9e072f7e9c (diff)
downloadmpd-cffc78ad6a978c8ef0afae4fbdd4b189612a7167.tar.gz
mpd-cffc78ad6a978c8ef0afae4fbdd4b189612a7167.tar.xz
mpd-cffc78ad6a978c8ef0afae4fbdd4b189612a7167.zip
InputStream: store references instead of pointers
Diffstat (limited to 'src/input/CurlInputPlugin.cxx')
-rw-r--r--src/input/CurlInputPlugin.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index 0fbfa29d2..f3edf1dc8 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -462,12 +462,12 @@ input_curl_abort_all_requests(GError *error)
input_curl_easy_free(c);
- const ScopeLock protect(*c->base.mutex);
+ const ScopeLock protect(c->base.mutex);
c->postponed_error = g_error_copy(error);
c->base.ready = true;
- c->base.cond->broadcast();
+ c->base.cond.broadcast();
}
g_error_free(error);
@@ -487,7 +487,7 @@ input_curl_request_done(struct input_curl *c, CURLcode result, long status)
assert(c->easy == NULL);
assert(c->postponed_error == NULL);
- const ScopeLock protect(*c->base.mutex);
+ const ScopeLock protect(c->base.mutex);
if (result != CURLE_OK) {
c->postponed_error = g_error_new(curl_quark(), result,
@@ -501,7 +501,7 @@ input_curl_request_done(struct input_curl *c, CURLcode result, long status)
c->base.ready = true;
- c->base.cond->broadcast();
+ c->base.cond.broadcast();
}
static void
@@ -735,7 +735,7 @@ static bool
fill_buffer(struct input_curl *c, GError **error_r)
{
while (c->easy != NULL && c->buffers.empty())
- c->base.cond->wait(*c->base.mutex);
+ c->base.cond.wait(c->base.mutex);
if (c->postponed_error != NULL) {
g_propagate_error(error_r, c->postponed_error);
@@ -855,9 +855,9 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size,
is->offset += (goffset)nbytes;
if (c->paused && curl_total_buffer_size(c) < CURL_RESUME_AT) {
- c->base.mutex->unlock();
+ c->base.mutex.unlock();
io_thread_call(input_curl_resume, c);
- c->base.mutex->lock();
+ c->base.mutex.lock();
}
return nbytes;
@@ -974,7 +974,7 @@ input_curl_writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
if (size == 0)
return 0;
- const ScopeLock protect(*c->base.mutex);
+ const ScopeLock protect(c->base.mutex);
if (curl_total_buffer_size(c) + size >= CURL_MAX_BUFFERED) {
c->paused = true;
@@ -984,7 +984,7 @@ input_curl_writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
c->buffers.emplace_back(ptr, size);
c->base.ready = true;
- c->base.cond->broadcast();
+ c->base.cond.broadcast();
return size;
}
@@ -1108,7 +1108,7 @@ input_curl_seek(struct input_stream *is, goffset offset, int whence,
/* close the old connection and open a new one */
- c->base.mutex->unlock();
+ c->base.mutex.unlock();
input_curl_easy_free_indirect(c);
c->buffers.clear();
@@ -1137,10 +1137,10 @@ input_curl_seek(struct input_stream *is, goffset offset, int whence,
if (!input_curl_easy_add_indirect(c, error_r))
return false;
- c->base.mutex->lock();
+ c->base.mutex.lock();
while (!c->base.ready)
- c->base.cond->wait(*c->base.mutex);
+ c->base.cond.wait(c->base.mutex);
if (c->postponed_error != NULL) {
g_propagate_error(error_r, c->postponed_error);