[DF180926-00154] Add speed limit 48/191248/1
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 15 Oct 2018 04:22:00 +0000 (13:22 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 15 Oct 2018 04:22:06 +0000 (13:22 +0900)
downloading cannot be canceled in case of no packet.
It's because cancel request is depended on CURLOPT_WRITEFUNCTION.
Therefore, if there is no packet, downloading would be blocked without error.
This patch limits speed and time to prevent this issue.

Change-Id: I13d6538528254f88884d8573cd320608916a9561

agent/download-agent-plugin-libcurl.c
agent/include/download-agent-plugin-libcurl.h
packaging/download-provider.spec

index d262673..a7173a7 100755 (executable)
@@ -486,6 +486,9 @@ da_ret_t PI_http_start(da_info_t *da_info)
        curl_easy_setopt(curl, CURLOPT_MAXCONNECTS, MAX_SESSION_COUNT);
        curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, MAX_TIMEOUT);
 
+       curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, LOW_SPEED_TIME);
+       curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1L);
+
        __set_proxy_on_soup_session(http_info->proxy_addr, curl);
 
        curl_easy_setopt(curl, CURLOPT_URL, url);
index 6262f95..d97a3a9 100644 (file)
@@ -22,6 +22,7 @@
 
 #define MAX_SESSION_COUNT      DA_MAX_DOWNLOAD_REQ_AT_ONCE
 #define MAX_TIMEOUT                    DA_MAX_TIME_OUT
+#define LOW_SPEED_TIME         200
 #define _ENABLE_LIBCURL_LOG_VERBOSE                    0
 
 da_ret_t PI_http_start(da_info_t *da_info);
index 3f9ce09..a0a61e8 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.1.102
+Version:    2.1.103
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0