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

Ensure that PollVec enum matches poll values #673

Closed kadler closed 1 year ago

kadler commented 1 year ago

IN and OUT are used by PollVec mask functions to determine which fd_sets to use in AddFD, FDReady, and FDSetNotReady, however these enums are not used outside of PollVec code and the rest of the code uses POLLIN and POLLOUT definitions instead. This works on many POSIX platforms since the enum values match the POLLIN and POLLOUT values, but not on AIX where POLLOUT is 2 instead of 4. This prevents code from determining when a file descriptor is writeable, leading to a hang when using FTPS protocol (at least).

Fixes #672

lavv17 commented 1 year ago

Good catch. But it won’t work if the system misses the poll function. Probably a conditional compilation is needed here.

On Wed, 20 Jul 2022 at 20:04, Kevin Adler @.***> wrote:

IN and OUT are used by PollVec mask functions to determine which fd_sets to use in AddFD, FDReady, and FDSetNotReady, however these enums are not used outside of PollVec code and the rest of the code uses POLLIN and POLLOUT definitions instead. This works on many POSIX platforms since the enum values match the POLLIN and POLLOUT values, but not on AIX where POLLOUT is 2 instead of 4. This prevents code from determining when a file descriptor is writeable, leading to a hang when using FTPS protocol (at least).

Fixes #672 https://github.com/lavv17/lftp/issues/672

You can view, comment on, or merge this pull request online at:

https://github.com/lavv17/lftp/pull/673 Commit Summary

File Changes

(1 file https://github.com/lavv17/lftp/pull/673/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/pull/673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHLWXG7DRXTEQ7KBNUFDWDVVAWSHANCNFSM54ENUIDA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Alexander.

kadler commented 1 year ago

Well, I think then the rest of the code which uses POLLIN/POLLOUT indiscriminately is the problem then. If you want to support systems without poll (and presumably without POLLIN/POLLOUT definitions), then that code will have to be modified. Are such systems supported today? (I don't have access to such a system)