From:             [EMAIL PROTECTED]
Operating system: Suse Linux 7.2
PHP version:      4CVS-2003-02-12 (stable)
PHP Bug Type:     Sockets related
Bug description:  fgets() does not return all data

I have written a IRC Nickserv/Authserv/Chanserv bot in php. Using a socket
connection to the irc server. After updating from php 4.2.3 to 4.3.1-dev
(tried stable version of 7.2 and 13.2) fgets() reacts very strange.

The main code (very simplified), that produces the error is this:

$sock = fsockopen($ircServer, $ircPort);
while($line = fgets($sock)) {
  echo $line;
}
fclose($sock);

While handshaking and exchanging data between the irc bot and the irc
server there are more than 200 lines of text, that is sent to the bot.
Using PHP 4.2.3 all the lines are displayed. Using PHP 4.3.1-dev only two
lines are returned. The first line of the whole text and a part of a line
inbetween. Nothing else. Also, when a user sends the command:

/join #test,#test1,#test2,#test3

fgets() in PHP 4.3.1-dev only returns /join #test

That is a very strange behavior i must say.

May configuration line:
./configure --prefix=/usr/share --datadir=/usr/share/php --bindir=/usr/bin
--libdir=/usr/share --with-config-file-path=/etc
--with-exec-dir=/usr/lib/php/bin --with-mysql=/usr --with-gd=yes
--enable-gd-native-ttf --enable-gd-imgstrttf --with-tiff-dir=/usr
--with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr/X11R6
--with-ldap=yes --with-zlib=yes --with-bz2 --with-gmp --with-xml
--with-ttf --with-t1lib --with-mcal=/usr --with-imap-ssl=yes --with-sablot
--with-ftp --with-ndbm --with-gdbm --with-mcrypt --with-gettext
--with-gd=yes --enable-versioning --enable-yp --enable-bcmath
--enable-trans-sid --enable-inline-optimization --enable-track-vars
--enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem
--enable-sysvshm --enable-shmop --enable-calendar --enable-mbstring
--enable-mbstr-enc-trans --enable-exif --enable-ftp --enable-memory-limit
--enable-wddx --enable-filepro --enable-dbase --enable-ctype
--disable-debug --enable-force-cgi-redirect --enable-discard-path
--enable-sigchild


I hope this bug report is in any way usefull =)

-- 
Edit bug report at http://bugs.php.net/?id=22199&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22199&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22199&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22199&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22199&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22199&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22199&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22199&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22199&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22199&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22199&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22199&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22199&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22199&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22199&r=gnused

Reply via email to