summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2014-08-26 17:09:32 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2014-08-26 17:09:32 -0400
commit2233f981fb49f6cd000979bea01a483f1abd25bf (patch)
tree6ee492eb362acc971bf3fc546654ebec18dd2f1a /common
parent050b00cb5898af5d1ea82d8dd94878eb76da7faf (diff)
downloadqtlocation-mapboxgl-2233f981fb49f6cd000979bea01a483f1abd25bf.tar.gz
port curl_request to libuv 0.10.x
Diffstat (limited to 'common')
-rw-r--r--common/curl_request.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/curl_request.cpp b/common/curl_request.cpp
index 416ed90cd1..3370c0a859 100644
--- a/common/curl_request.cpp
+++ b/common/curl_request.cpp
@@ -216,7 +216,7 @@ int handle_socket(CURL * /*easy*/, curl_socket_t s, int action, void * /*userp*/
return 0;
}
-void on_timeout(uv_timer_t * /*req*/) {
+void on_timeout(uv_timer_t *, int status /*req*/) {
int running_handles;
CURLMcode error =
curl_multi_socket_action(curl_multi, CURL_SOCKET_TIMEOUT, 0, &running_handles);
@@ -227,9 +227,9 @@ void on_timeout(uv_timer_t * /*req*/) {
void start_timeout(CURLM * /*multi*/, long timeout_ms, void * /*userp*/) {
if (timeout_ms <= 0) {
- on_timeout(&timeout);
+ on_timeout(&timeout, -1);
} else {
- uv_timer_start(&timeout, on_timeout, timeout_ms, 0);
+ uv_timer_start(&timeout, &on_timeout, timeout_ms, 0);
}
}
@@ -289,7 +289,7 @@ size_t curl_write_cb(void *contents, size_t size, size_t nmemb, void *userp) {
// This callback is called in the request event loop (on the request thread).
// It initializes newly queued up download requests and adds them to the CURL
// multi handle.
-void async_add_cb(uv_async_t * /*async*/) {
+void async_add_cb(uv_async_t *, int status /*async*/) {
std::shared_ptr<Request> *req = nullptr;
while (add_queue.pop(req)) {
// Make sure that we're not starting requests that have been cancelled
@@ -321,7 +321,7 @@ void async_add_cb(uv_async_t * /*async*/) {
}
}
-void async_cancel_cb(uv_async_t * /*async*/) {
+void async_cancel_cb(uv_async_t *, int status /*async*/) {
std::shared_ptr<Request> *req = nullptr;
while (cancel_queue.pop(req)) {
// It is possible that the request has not yet been started, but that it already has been
@@ -343,8 +343,8 @@ void thread_init_cb() {
curl_global_init(CURL_GLOBAL_ALL);
loop = uv_loop_new();
- uv_async_init(loop, &async_add, async_add_cb);
- uv_async_init(loop, &async_cancel, async_cancel_cb);
+ uv_async_init(loop, &async_add, &async_add_cb);
+ uv_async_init(loop, &async_cancel, &async_cancel_cb);
uv_thread_create(&thread, thread_init, nullptr);
}
} // end namespace request