Re: Re: cvs: php-src / NEWS /ext/ftp ftp.c /main network.c php_network.h /main/streams xp_socket.c

From: Date: Wed, 13 Jul 2005 23:10:56 +0000
Subject: Re: Re: cvs: php-src / NEWS /ext/ftp ftp.c /main network.c php_network.h /main/streams xp_socket.c
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-17259@lists.php.net to get a copy of this message
Indeed, ftp:// doesn't use the transports layer at all. I'll patch this up.... -Sara ""Nuno Lopes"" <nlopess@php.net> wrote in message news:002f01c587f4$3fb36aa0$0100a8c0@pc07653... > OK. but at least it could work with 'x.x.x.x:0'. From I what I remember from > the code, it always uses NULL as bindto when calling > php_network_connect_socket_to_host(). > > Nuno > > > ----- Original Message ----- > FTP creates two socket connections during normal operation; it will > attempt to bind both to the port you specified. > > --Wez. > > On 7/13/05, Nuno Lopes <nlopess@php.net> wrote: > > Well I've tested again and it works also with the 'tcp' wrapper, but not > > with ftp. > > > > consider this: > > <? > > $bogus = stream_context_create(array('socket'=>array('bindto' => > > "1.2.3.1:5000"))); > > echo > > file_get_contents('http://darkstar.ist.utl.pt/gentoo/snapshots/portage-20050 712.tar.bz2.md5sum', > > NULL, $bogus); > > echo > > file_get_contents('ftp://ftp.rnl.ist.utl.pt/gentoo/snapshots/portage-2005071 2.tar.bz2.md5sum', > > NULL, $bogus); > > ?> > > > > outputs a warning with the http wrapper, but not with the ftp one. > > Is it a bug or a feature? :) > > > > Nuno > > > > > > ----- Original Message ----- > > > It is not a wrapper specific context option, it'll work with any TCP/IP > > > socket. > > > > > > Ilia > > > > > > Nuno Lopes wrote: > > >>> iliaa Mon Jun 13 22:39:43 2005 EDT > > >>> > > >>> Modified files: > > >>> /php-src/main network.c php_network.h > > >>> /php-src/main/streams xp_socket.c > > >>> /php-src/ext/ftp ftp.c > > >>> /php-src NEWS > > >>> Log: > > >>> Added bindto socket context option. > > >> > > >> > > >> > > >> Hi, > > >> > > >> I was going to document this new feature but I have a question: > > >> Does the 'bindto' work with wrappers other than 'http'? From > > >> what I > > >> could > > >> test (tcp and ftp) and read from the code I think not. > > >> So, why it is under the 'socket' wrapper, instead of the > > >> 'http' > > >> wrapper? > > >> > > >> Regards, > > >> Nuno

« previous php.internals (#17259) next »