# HG changeset patch # User Olaf Wintermann # Date 1686343037 -7200 # Node ID 8776125fd49c1cd03821d2cc100e193fb3641962 # Parent 2b153bc3eb5763fe56715740afbb7d9da44d3215 fix crash when the seekfunction is used diff -r 2b153bc3eb57 -r 8776125fd49c libidav/methods.c --- 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);