Sorry, I made a mistake.

  >Command:
> curl --ssl-reqd --tls-max 1.2 -k --user Anonymous: ftp://localhost:21/
 -P -
If localhost is specified, no delay occurs.
The delay problem was caused by specifying an IP address.

Delay command:
 curl --ssl-reqd --tls-max 1.2 -k --user Anonymous: ftp://127.0.0.1:21/ -P -

Not delay command:
 curl --ssl-reqd --tls-max 1.2 -k --user Anonymous: ftp://localhost:21/  -P
-

Is there anyone who can reproduce this?

2024年8月31日(土) 8:59 Yoshimasa Ohno <momon...@gmail.com>:

> Hello everyone.
>
> When using FTPS Acitive mode in the Windows version of Curl environment,
> DataConnection establishment takes a timeout period.
> Does anyone know of a solution?
>
> ---- Condition begin ----
> Client-side:
>  Protocol: FTPS (explicit or implicit)
>  Curl Version(module): curl-8.9.1 (curl-8.9.1_3-win64-mingw)
>  OS: Windows 10 Version 22H2 (OS Build 19045.4780)
>
> Server-side:
>  FTP server: Filezilla server 1.8.2
>  Network: Addjacent network (local network or local host)
>
> Command:
>  curl --ssl-reqd --tls-max 1.2 -k --user Anonymous: ftp://localhost:21/
>  -P -
> ---- Condition end ----
>
> Looking at the packet, after the TCP socket SYN/ACK, there is exactly one
> second of wait before the Client Hello is sent.
>
> I built and investigated independently from source.
>
> The following WSAWaitForMultipleEvents is causing a 1 second wait.
>
> https://github.com/curl/curl/blob/83bedbd730d62b83744cc26fa0433d3f6e2e4cd6/lib/multi.c#L1438
>     else { /* now wait... if not ready during the pre-check (pollrc == 0)
> */
>       WSAWaitForMultipleEvents(1, &multi->wsa_event, FALSE,
> (DWORD)timeout_ms,
>                                FALSE);
>     }
>
> I found that the timeout argument of curl_multi_poll, the literal 1000,
> was having an effect.
> Changing this to 3000 resulted in a 3 second wait.
>
> https://github.com/curl/curl/blob/83bedbd730d62b83744cc26fa0433d3f6e2e4cd6/lib/easy.c#L673
>     mcode = curl_multi_poll(multi, NULL, 0, 1000, NULL);
>
> Adding a 1 ms sleep at the beginning of static CURLcode
> ReceivedServerConnect (struct Curl_easy *data, bool *received) would have
> avoided the delay problem.
>
> https://github.com/curl/curl/blob/83bedbd730d62b83744cc26fa0433d3f6e2e4cd6/lib/ftp.c#L533C1-L533C78
>
>
> As additional information, the problem did not occur in Plain FTP or PASV
> mode or when the server side was Microsoft IIS.
> Also, the problem did not occur when the Verbose command was turned on (I
> think it had the same effect as Sleep).
> (I think it had the same effect as Sleep).
>
> I am having trouble determining if it is a client-side or server-side
> problem.
> Any information at all would be appreciated.
>
> Thanks.
>
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to