Fix SVace issue localtimer - WGID 46818, 47048 65/62765/1 accepted/tizen/mobile/20160318.114153 accepted/tizen/tv/20160318.114234 submit/tizen_mobile/20160318.053247 submit/tizen_tv/20160318.053231
authorcookie <cookie@samsung.com>
Fri, 18 Mar 2016 05:11:16 +0000 (14:11 +0900)
committercookie <cookie@samsung.com>
Fri, 18 Mar 2016 05:11:16 +0000 (14:11 +0900)
Change-Id: I701f463fbc043fbf52a0ef018627c5435072a5f6
Signed-off-by: cookie <cookie@samsung.com>
agent/download-agent-http-mgr.c
provider/download-provider-plugin-download-agent.c [changed mode: 0644->0755]

index aba809c..a3ddcaf 100755 (executable)
@@ -1172,7 +1172,7 @@ da_ret_t __handle_event_http_packet(http_raw_data_t *raw_data, da_info_t *da_inf
        http_info_t *http_info = DA_NULL;
        file_info_t *file_info = DA_NULL;
        time_t t;
-       struct tm *lc_time;
+       struct tm lc_time;
        DA_LOGV("");
 
        NULL_CHECK_RET(da_info);
@@ -1250,9 +1250,9 @@ da_ret_t __handle_event_http_packet(http_raw_data_t *raw_data, da_info_t *da_inf
 #endif
                // send event every 1 second.
                if ((t = time(DA_NULL)) > 0) {
-                       if ((lc_time = localtime(&t)) != DA_NULL) {
-                               if (da_info->update_time != lc_time->tm_sec) {
-                                       da_info->update_time = lc_time->tm_sec;
+                       if ((localtime_r(&t,&lc_time)) != DA_NULL) {
+                               if (da_info->update_time != lc_time.tm_sec) {
+                                       da_info->update_time = lc_time.tm_sec;
                                        ret = send_client_update_progress_info(da_info);
                                }
                        } else {
old mode 100644 (file)
new mode 100755 (executable)
index 377c435..6391fe3
@@ -535,10 +535,14 @@ static void __progress_cb(int download_id, unsigned long long received_size,
        if (request->state == DP_STATE_DOWNLOADING) {
                request->received_size = received_size;
                time_t tt = time(NULL);
-               struct tm *localTime = localtime(&tt);
+               struct tm localTime ;
+               if(localtime_r(&tt,&localTime)==NULL){
+                   TRACE_ERROR("Error localtime_r");
+                   return;
+               }
                // send event every 1 second.
-               if (request->progress_lasttime != localTime->tm_sec) {
-                       request->progress_lasttime = localTime->tm_sec;
+               if (request->progress_lasttime != localTime.tm_sec) {
+                       request->progress_lasttime = localTime.tm_sec;
 
                        if (request->progress_cb == 1) {
                                if (slot->client.notify < 0 ||