source: npl/system/netkit-ftp/patches/31-netkit-ftp-0.17-lsn-timeout.patch

Last change on this file 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: 771 bytes
  • netkit-ftp-0.17/ftp/ftp.c

    old new initconn(void) 
    12451245        u_int ad[16], po[2], af, alen, plen;
    12461246        char *pasvcmd = NULL;
    12471247        char hbuf[MAXHOSTNAMELEN], pbuf[NI_MAXSERV];
     1248        struct timeval timeout;
     1249
     1250        timeout.tv_sec = 30;
     1251        timeout.tv_usec = 0;
    12481252
    12491253#ifdef INET6
    12501254        if (myctladdr.su_family == AF_INET6
    noport: 
    14861490                        perror("ftp: setsockopt (reuse address)");
    14871491                        goto bad;
    14881492                }
     1493        if (setsockopt (data, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,
     1494                sizeof(timeout)) < 0) {
     1495                perror("ftp: setsockopt failed\n");
     1496        }
    14891497        if (bind(data, (struct sockaddr *)&data_addr, sizeof (data_addr)) < 0) {
    14901498                perror("ftp: bind");
    14911499                goto bad;
Note: See TracBrowser for help on using the repository browser.