From kfm-devel Wed May 26 20:01:49 1999 From: David Faure Date: Wed, 26 May 1999 20:01:49 +0000 To: kfm-devel Subject: Re: KFM and PASV uploading X-MARC-Message: https://marc.info/?l=kfm-devel&m=92774823716068 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--d6Gm4EdcadzBjdND" --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii On Wed, May 26, 1999 at 12:16:35PM -0700, Gordon Messmer wrote: > Greets, list members > > When Red Hat 6.0 was released (and during the starbuck pre-release > series) I got a chance to evaluate the new release and the KDE rpms it > contained. KFM had problems uploading files, and continued to do so > after I updated to the 1.1.1 release. Yes. > I browsed the archived messages from this list and found that Dave Faure My name is David ;) > suggested > #defining DONT_TRY_PASV in one of the header files. Sho' nuff kfm ^^^^^^^^^ ?? > resumed it's normal operation. If it's relevant, the ftp server I was > trying to send files to was wu-ftpd-2.4.2vr17-3. > > I originally tried to email Dave directly, but that didn't work, so I've Don't get fooled by alpha.tat.... buggy headers. faure@kde.org is the answer ;) > joined the list. If I can help you debug this, let me know, eh? It has been solved already. The fix is in CVS. Patch attached, if you have 1.1.1 sources at hand. -- David FAURE david.faure@insa-lyon.fr, faure@kde.org http://www.insa-lyon.fr/People/AEDI/dfaure/index.html KDE, Making The Future of Computing Available Today --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ftp.cpp.diff" Index: ftp.cpp =================================================================== RCS file: /home/kde/kdebase/kfm/kioslave/ftp.cpp,v retrieving revision 1.21.4.4 retrieving revision 1.21.4.6 diff -u -p -r1.21.4.4 -r1.21.4.6 --- ftp.cpp 1999/04/06 14:37:47 1.21.4.4 +++ ftp.cpp 1999/05/20 18:50:43 1.21.4.6 @@ -349,7 +349,7 @@ int KProtocolFTP::ftpPasv(void) struct sockaddr sa; struct sockaddr_in in; } sin; - struct linger lng = { 0, 0 }; + struct linger lng = { 1, 120 }; pasv=1; if (sDatal != -1) @@ -400,6 +400,8 @@ int KProtocolFTP::ftpPasv(void) return 0; } + if (setsockopt(sDatal, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, (int) sizeof(on)) < 0) + perror("Keepalive not allowed."); if (setsockopt(sDatal, SOL_SOCKET,SO_LINGER, (char *) &lng,(int) sizeof (lng)) < 0) perror("Linger mode was not allowed."); return 1; @@ -460,14 +462,14 @@ int KProtocolFTP::ftpMkdir( const char * FD_ZERO(&mask); FD_SET(sDatal,&mask); + if (pasv == 1) + { + return sDatal; + } if (select( sDatal + 1, &mask,NULL,NULL, 0L) == 0) { close(sDatal); return -2; - } - if (pasv == 1) - { - return sDatal; } l = sizeof(addr); --d6Gm4EdcadzBjdND--