Subject: ftpio.c's expect hang
To: None <tech-pkg@NetBSD.org>
From: iMil <imil@home.imil.net>
List: tech-pkg
Date: 02/28/2005 11:41:01
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi pkg crowd,

i'm using libinstall's ftpio.c to perform ftp pkgsrc fetch in pkg_select, 
but for it to work i have to comment out this code portion in ftp_start() :

- ---[snip]---
                 if ((expect(ftpio.answer, "\n(221|250|221|550).*\n", &rc) 
!= 0)
                     || rc != 250) {
                         warnx("expect1 failed, rc=%d", rc);
                         return -1;
                 }
- ---[snip]---

if i don't, expect hangs here (with verbose_expect=1) :

- ---> PWD
257 "/" is the current directory.
got remotepwd as `/'
- ---> TYPE I
200 Type set to I.

i suspected a classic passive / active issue, so i inserted a 
setenv("FTP_PASSIVE_MODE", "yes", 1); in my code, without success.
ftp(1) and pkg_add(1), even when called from pkg_select, both work 
perfectly, so it's clearly a mistake of mine. Any libinstall guru around 
could give me a hint ?

thanks

- -------------------------
iMil <imil@home.imil.net>                                                 _
      http://gcu-squad.org                          ASCII ribbon campaign ( )
                                                     - against HTML email  X
                                                                 & vCards / \
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iD8DBQFCIvU/FG3BlGWyzUIRAtKgAJwPbf/HdZDZhrcpcUpql/jG8i5pbQCeLT+t
Dw6aMeraSgw01mThEHKwaZA=
=tWPw
-----END PGP SIGNATURE-----