lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 159 forks source link

Lftp Timeout Mechanism #718

Open chengyechun opened 6 months ago

chengyechun commented 6 months ago

When you run the lftp command to connect to an unknown host, the connection times out and the connection is disconnected. However, after the lftp command is started, the local system time is changed to the past time. As a result, there is a high probability that the lftp command is suspended. Indicates whether to consider the Clock_MONOTONIC clock when setting the timeout mechanism for lftp.

chengyechun commented 5 months ago

If the system time is changed to the past time, will the value of select_timeout in the select change for a long time? Similar to the following stack

(gdb) bt

0 0x00007f0958e31929 in select () from /usr/lib64/libc.so.6

1 0x00007f09592fa105 in PollVec::Block (this=0x556a949822e0 ) at PollVec.cc:78

2 0x00007f09592fac22 in SMTask::Block () at SMTask.cc:264

3 0x00007f09593b558d in Job::WaitDone (this=0x556a95e40f40) at Job.cc:563

4 0x0000556a94975bef in main (argc=4, argv=0x7ffe721209e8) at lftp.cc:590

(gdb) f 1

1 0x00007f09592fa105 in PollVec::Block (this=0x556a949822e0 ) at PollVec.cc:78

78 select(nfds,&in_ready,&out_ready,0,select_timeout); (gdb) p *select_timeout $1 = {tv_sec = 2349, tv_usec = 561673}