perl-5.22
|
Last change
on this file since 3223269 was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 9 years ago
|
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100644
|
|
File size:
771 bytes
|
| Rev | Line | |
|---|
| [c5c522c] | 1 | --- netkit-ftp-0.17/ftp/ftp.c.to 2012-08-10 15:49:08.510257542 +0200 |
|---|
| 2 | +++ netkit-ftp-0.17/ftp/ftp.c 2012-08-10 15:49:32.386220785 +0200 |
|---|
| 3 | @@ -1245,6 +1245,10 @@ initconn(void) |
|---|
| 4 | u_int ad[16], po[2], af, alen, plen; |
|---|
| 5 | char *pasvcmd = NULL; |
|---|
| 6 | char hbuf[MAXHOSTNAMELEN], pbuf[NI_MAXSERV]; |
|---|
| 7 | + struct timeval timeout; |
|---|
| 8 | + |
|---|
| 9 | + timeout.tv_sec = 30; |
|---|
| 10 | + timeout.tv_usec = 0; |
|---|
| 11 | |
|---|
| 12 | #ifdef INET6 |
|---|
| 13 | if (myctladdr.su_family == AF_INET6 |
|---|
| 14 | @@ -1486,6 +1490,10 @@ noport: |
|---|
| 15 | perror("ftp: setsockopt (reuse address)"); |
|---|
| 16 | goto bad; |
|---|
| 17 | } |
|---|
| 18 | + if (setsockopt (data, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, |
|---|
| 19 | + sizeof(timeout)) < 0) { |
|---|
| 20 | + perror("ftp: setsockopt failed\n"); |
|---|
| 21 | + } |
|---|
| 22 | if (bind(data, (struct sockaddr *)&data_addr, sizeof (data_addr)) < 0) { |
|---|
| 23 | perror("ftp: bind"); |
|---|
| 24 | goto bad; |
|---|
Note: See
TracBrowser
for help on using the repository browser.