fix crash when the seekfunction is used

Fri, 09 Jun 2023 22:37:17 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 09 Jun 2023 22:37:17 +0200
changeset 753
8776125fd49c
parent 752
2b153bc3eb57
child 755
283d3d7a657a

fix crash when the seekfunction is used

libidav/methods.c file | annotate | diff | comparison | revisions
--- a/libidav/methods.c	Fri Jun 09 21:45:29 2023 +0200
+++ b/libidav/methods.c	Fri Jun 09 22:37:17 2023 +0200
@@ -68,7 +68,8 @@
     curl_easy_setopt(handle, CURLOPT_UPLOAD, 1); 
     curl_easy_setopt(handle, CURLOPT_READFUNCTION, cxBufferRead);
     curl_easy_setopt(handle, CURLOPT_SEEKFUNCTION, cxBufferSeek);
-    curl_easy_setopt(handle, CURLOPT_READDATA, request); 
+    curl_easy_setopt(handle, CURLOPT_READDATA, request);
+    curl_easy_setopt(handle, CURLOPT_SEEKDATA, request);
     curl_easy_setopt(handle, CURLOPT_INFILESIZE, request->size);
     
     curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, cxBufferWrite);
@@ -809,7 +810,8 @@
     curl_easy_setopt(handle, CURLOPT_UPLOAD, 1); 
     curl_easy_setopt(handle, CURLOPT_READFUNCTION, cxBufferRead);
     curl_easy_setopt(handle, CURLOPT_SEEKFUNCTION, cxBufferSeek);
-    curl_easy_setopt(handle, CURLOPT_READDATA, request); 
+    curl_easy_setopt(handle, CURLOPT_READDATA, request);
+    curl_easy_setopt(handle, CURLOPT_SEEKDATA, request);
     curl_easy_setopt(handle, CURLOPT_INFILESIZE, request->size);
     
     curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, cxBufferWrite);
@@ -1041,6 +1043,7 @@
     
     curl_easy_setopt(handle, CURLOPT_READFUNCTION, read_func);
     curl_easy_setopt(handle, CURLOPT_SEEKFUNCTION, seek_func);
+    curl_easy_setopt(handle, CURLOPT_SEEKDATA, data);
     curl_easy_setopt(handle, CURLOPT_READDATA, data);
     
     curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, dummy_write);
@@ -1272,6 +1275,7 @@
     curl_easy_setopt(handle, CURLOPT_READFUNCTION, cxBufferRead);
     curl_easy_setopt(handle, CURLOPT_SEEKFUNCTION, cxBufferSeek);
     curl_easy_setopt(handle, CURLOPT_READDATA, request); 
+    curl_easy_setopt(handle, CURLOPT_SEEKDATA, request);
     curl_easy_setopt(handle, CURLOPT_INFILESIZE, request->size);
     
     curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, cxBufferWrite);
@@ -1340,7 +1344,8 @@
     curl_easy_setopt(handle, CURLOPT_UPLOAD, 1); 
     curl_easy_setopt(handle, CURLOPT_READFUNCTION, cxBufferRead);
     curl_easy_setopt(handle, CURLOPT_SEEKFUNCTION, cxBufferSeek);
-    curl_easy_setopt(handle, CURLOPT_READDATA, request); 
+    curl_easy_setopt(handle, CURLOPT_READDATA, request);
+    curl_easy_setopt(handle, CURLOPT_SEEKDATA, request);
     curl_easy_setopt(handle, CURLOPT_INFILESIZE, request->size);
     
     curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, cxBufferWrite);

mercurial