Skip to content

Commit f06c257

Browse files
bagderptitSeb
authored andcommitted
examples/ftpuploadresume.c: add use of CURLOPT_ACCEPTTIMEOUT_MS
For show Closes curl#11277
1 parent 5aa891f commit f06c257

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/examples/ftpuploadresume.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
***************************************************************************/
2424
/* <DESC>
25-
* Upload to FTP, resuming failed transfers.
25+
* Upload to FTP, resuming failed transfers. Active mode.
2626
* </DESC>
2727
*/
2828

@@ -96,8 +96,12 @@ static int upload(CURL *curlhandle, const char *remotepath,
9696
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
9797
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
9898

99-
/* disable passive mode */
99+
/* enable active mode */
100100
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-");
101+
102+
/* allow the server no more than 7 seconds to connect back */
103+
curl_easy_setopt(curlhandle, CURLOPT_ACCEPTTIMEOUT_MS, 7000L);
104+
101105
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
102106

103107
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);

0 commit comments

Comments
 (0)