souphttpsrc: fix svace issue
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 21 Dec 2016 04:50:34 +0000 (13:50 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Mon, 26 Dec 2016 10:35:45 +0000 (02:35 -0800)
Change-Id: Iacedc8aa02fb42a010e6713a332008fa89a58491
(cherry picked from commit eb0c48d090bee73bd317dd0b4fe6378fe4f559bd)

ext/soup/gstsouphttpsrc.c

index 586c9f0..7a8fee5 100644 (file)
@@ -837,26 +837,27 @@ gst_soup_http_src_add_range_header (GstSoupHTTPSrc * src, guint64 offset,
   gint rc;
 
   soup_message_headers_remove (src->msg->request_headers, "Range");
-#ifdef TIZEN_FEATURE_SOUP_MODIFICATION
+
 /*[prasenjit.c]This changes are needed to enable Seekable Contents from server.
 We have observed that , for few specific networks ( VODAFONE ) , without theabove headers ,
 Youtube is sending non-seekable contents to the Client.
 */
-  if (stop_offset != -1) {
-#else
-  if (offset || stop_offset != -1) {
+#ifndef TIZEN_FEATURE_SOUP_MODIFICATION
+  if (offset || stop_offset != -1)
 #endif
+  {
     if (stop_offset != -1) {
       rc = g_snprintf (buf, sizeof (buf), "bytes=%" G_GUINT64_FORMAT "-%"
-          G_GUINT64_FORMAT, offset, stop_offset);
+                G_GUINT64_FORMAT, offset, stop_offset);
     } else {
       rc = g_snprintf (buf, sizeof (buf), "bytes=%" G_GUINT64_FORMAT "-",
-          offset);
+                offset);
     }
     if (rc > sizeof (buf) || rc < 0)
       return FALSE;
     soup_message_headers_append (src->msg->request_headers, "Range", buf);
   }
+
   src->read_position = offset;
   return TRUE;
 }
@@ -912,7 +913,7 @@ _append_extra_header (GQuark field_id, const GValue * value, gpointer user_data)
         if (src->cookie_jar)
           soup_cookie_jar_add_cookie (src->cookie_jar, cookie_parsed);
 
-        tmp_field = strtok (NULL, ";");
+        tmp_field = strtok_r (NULL, ";", &saveptr);
       }
       soup_uri_free (uri);
     }