From 95718f8fe36562452bc12848a6524c0dfa840f52 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 7 Apr 2008 15:11:53 +0300 Subject: [PATCH] Use common curl_multi, no need to check if it needs init or not --- src/route.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/route.c b/src/route.c index d82d3bf..efdb164 100644 --- a/src/route.c +++ b/src/route.c @@ -241,7 +241,7 @@ g_memmove(rdl_data->bytes + old_size, ptr, size * nmemb); return (size * nmemb); } -gboolean +gboolean auto_route_dl_idle() { gchar latstr[32], lonstr[32], *latlonstr; @@ -249,19 +249,13 @@ gchar latstr[32], lonstr[32], *latlonstr; g_ascii_dtostr(latstr, 32, _gps->data.lat); g_ascii_dtostr(lonstr, 32, _gps->data.lon); latlonstr = g_strdup_printf("%s,%s", latstr, lonstr); -_autoroute_data.src_str = - g_strdup_printf(_route_dl_url, latlonstr, _autoroute_data.dest); +_autoroute_data.src_str = g_strdup_printf(_route_dl_url, latlonstr, _autoroute_data.dest); g_free(latlonstr); MACRO_CURL_EASY_INIT(_autoroute_data.curl_easy); curl_easy_setopt(_autoroute_data.curl_easy, CURLOPT_URL, _autoroute_data.src_str); curl_easy_setopt(_autoroute_data.curl_easy, CURLOPT_WRITEFUNCTION, route_dl_cb_read); curl_easy_setopt(_autoroute_data.curl_easy, CURLOPT_WRITEDATA, &_autoroute_data.rdl_data); -if (!_curl_multi) { - /* Initialize CURL. */ - _curl_multi = curl_multi_init(); - /*curl_multi_setopt(_curl_multi, CURLMOPT_PIPELINING, 1); */ -} curl_multi_add_handle(_curl_multi, _autoroute_data.curl_easy); if (iap_is_connected() && !_curl_sid) -- 2.39.5