examples/ftpuploadresume.c: add use of CURLOPT_ACCEPTTIMEOUT_MS

For show

Closes #11277
This commit is contained in:
Daniel Stenberg 2023-06-08 16:30:31 +02:00
parent 4894ca6813
commit 67e9e90f96
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -22,7 +22,7 @@
*
***************************************************************************/
/* <DESC>
* Upload to FTP, resuming failed transfers.
* Upload to FTP, resuming failed transfers. Active mode.
* </DESC>
*/
@ -96,8 +96,12 @@ static int upload(CURL *curlhandle, const char *remotepath,
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
/* disable passive mode */
/* enable active mode */
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-");
/* allow the server no more than 7 seconds to connect back */
curl_easy_setopt(curlhandle, CURLOPT_ACCEPTTIMEOUT_MS, 7000L);
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);