Not sure if there is a better list to report this.
Anyway, a couple of years ago, ftp (client) was changed in how it handled signals (version 1.171).

The problem was that the change made reads from the data channel potentially cause EINTR or EAGAIN. The code was changed to properly handle this in binary transfers, but it was not done for ascii transfers. So if anyone tries to transfer a large enough ascii file, with a progress bar, the transfer will fail after about 1s.

Here is a patch to fix it. Maybe someone can commit?

============
RCS file: /cvsroot/src/usr.bin/ftp/ftp.c,v
retrieving revision 1.174.2.3
diff -r1.174.2.3 ftp.c
1125c1125,1136
<               while ((c = getc(din)) != EOF) {
---
              while (1) {
                      c = getc(din);
                      if (c == EOF) {
                              if (feof(din)) {
                                      goto break2;
                              }
if ((errno == EINTR) || (errno ==
EAGAIN)) {
                                      clearerr(din);
                                      goto contin2;
                              }
                              goto break2;
                      }
===========

Also feel free to improve the code, if someone wants to. But make sure to actually test it as well. I couldn't really figure out to make it any smaller than this.

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: b...@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol

Reply via email to