Forráskód Böngészése

Changed the way the content-length is set.

default 2 éve
szülő
commit
d0306975c5
1 módosított fájl, 1 hozzáadás és 3 törlés
  1. 1 3
      xs_curl.h

+ 1 - 3
xs_curl.h

@@ -134,9 +134,7 @@ xs_dict *xs_http_request(const char *method, const char *url,
                 b_size = xs_size(body);
 
             /* add the content-length header */
-            char tmp[32];
-            sprintf(tmp, "content-length: %d", b_size);
-            list = curl_slist_append(list, tmp);
+            curl_easy_setopt(curl, CURLOPT_INFILESIZE, b_size);
 
             pd.data = (char *)body;
             pd.size = b_size;