gcc484ntopperl-5.22
Last change
on this file since c5c522c was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[c5c522c] | 1 | --- netkit-ftp-0.17/ftp/ftp.c.vsftp 2005-08-29 16:07:35.000000000 +0200 |
---|
| 2 | +++ netkit-ftp-0.17/ftp/ftp.c 2005-08-30 10:58:10.000000000 +0200 |
---|
| 3 | @@ -582,6 +582,7 @@ |
---|
| 4 | volatile long long bytes = 0, hashbytes = HASHBYTES; |
---|
| 5 | char buf[BUFSIZ], *bufp; |
---|
| 6 | const char *volatile lmode; |
---|
| 7 | + int old_code_l; |
---|
| 8 | |
---|
| 9 | if (verbose && printnames) { |
---|
| 10 | if (local && *local != '-') |
---|
| 11 | @@ -799,7 +800,35 @@ |
---|
| 12 | (void) fclose(dout); |
---|
| 13 | /* closes data as well, so discard it */ |
---|
| 14 | data = -1; |
---|
| 15 | - (void) getreply(0); |
---|
| 16 | + old_code_l = code; |
---|
| 17 | + (void) getreply(0); |
---|
| 18 | + |
---|
| 19 | + /* Following "if" will avoid a bug #165083 in ftp-server */ |
---|
| 20 | + /* It can be later removed. */ |
---|
| 21 | + if (old_code_l == 150 && code == 150 && cpend == 1 |
---|
| 22 | + && sunique == 1 && cin != NULL && fileno (cin) >= 0 ) { |
---|
| 23 | + #include <sys/poll.h> |
---|
| 24 | + struct pollfd fds_events_l [2] ; |
---|
| 25 | + int rc; |
---|
| 26 | + |
---|
| 27 | + fds_events_l [0] .fd = fileno (cin); |
---|
| 28 | + fds_events_l [0] .events = POLLIN | POLLERR | POLLHUP; |
---|
| 29 | + |
---|
| 30 | + rc = poll (fds_events_l, 1, 5000); |
---|
| 31 | + switch (rc) { |
---|
| 32 | + case 1: |
---|
| 33 | + (void) getreply (0); |
---|
| 34 | + break; |
---|
| 35 | + case 0: |
---|
| 36 | + fprintf (stderr, "ftp: no answer from ftp-server " |
---|
| 37 | + "(more than 5 sec).\n"); |
---|
| 38 | + break; |
---|
| 39 | + case -1: |
---|
| 40 | + perror("ftp: poll"); |
---|
| 41 | + break; |
---|
| 42 | + } |
---|
| 43 | + } |
---|
| 44 | + |
---|
| 45 | (void) signal(SIGINT, oldintr); |
---|
| 46 | if (oldintp) |
---|
| 47 | (void) signal(SIGPIPE, oldintp); |
---|
Note: See
TracBrowser
for help on using the repository browser.