diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:00:14 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:00:14 +0000 |
commit | 361fec5b672ef8fdb44f61fb12b2cbb2f950b347 (patch) | |
tree | 9de49e1f2fc574f4e68e0c5eb903cb537c8c2695 /netkit-ftp-0.17-lsn-timeout.patch | |
parent | 75ec6de8f8f0b5d1c1905cb24264099d45eea096 (diff) |
automatic import of ftpopeneuler24.03_LTS
Diffstat (limited to 'netkit-ftp-0.17-lsn-timeout.patch')
-rw-r--r-- | netkit-ftp-0.17-lsn-timeout.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/netkit-ftp-0.17-lsn-timeout.patch b/netkit-ftp-0.17-lsn-timeout.patch new file mode 100644 index 0000000..561ccdb --- /dev/null +++ b/netkit-ftp-0.17-lsn-timeout.patch @@ -0,0 +1,24 @@ +--- netkit-ftp-0.17/ftp/ftp.c.to 2012-08-10 15:49:08.510257542 +0200 ++++ netkit-ftp-0.17/ftp/ftp.c 2012-08-10 15:49:32.386220785 +0200 +@@ -1245,6 +1245,10 @@ initconn(void) + u_int ad[16], po[2], af, alen, plen; + char *pasvcmd = NULL; + char hbuf[MAXHOSTNAMELEN], pbuf[NI_MAXSERV]; ++ struct timeval timeout; ++ ++ timeout.tv_sec = 30; ++ timeout.tv_usec = 0; + + #ifdef INET6 + if (myctladdr.su_family == AF_INET6 +@@ -1486,6 +1490,10 @@ noport: + perror("ftp: setsockopt (reuse address)"); + goto bad; + } ++ if (setsockopt (data, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, ++ sizeof(timeout)) < 0) { ++ perror("ftp: setsockopt failed\n"); ++ } + if (bind(data, (struct sockaddr *)&data_addr, sizeof (data_addr)) < 0) { + perror("ftp: bind"); + goto bad; |