|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-03 03:25 UTC] wez@php.net
[2002-10-04 21:30 UTC] sas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
fgets() is taking a VERY long time to return anything with php from cvs (4.3.0-dev). Here is a test script to show the behavior: <?php function getmicrotime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $a = getmicrotime(); $fp = fsockopen('mail.haught.org', 25, $errno, $errstr); $b = getmicrotime(); echo "(Connected in " .($b-$a). " seconds)<br>"; echo '>' .fgets($fp, 2048); $c = getmicrotime(); echo " (Read took " .($c-$b). " seconds)<br>"; echo '< EHLO localhost'; fwrite($fp, "EHLO localhost\r\n"); $d = getmicrotime(); echo " (Write took " .($d-$c). " seconds)<br>"; $numlines = 2; //number of lines to read for ($i; $i<$numlines; $i++) { echo '>' .fgets($fp, 2048); $e = getmicrotime(); echo " (Read took " .($e-$d). " seconds)<br>"; } ?> The Results: Sept 22nd tree (Connected in 0.0027800798416138 seconds) >220 haught.org ESMTP (Read took 0.0082589387893677 seconds) < EHLO localhost (Write took 0.00019896030426025 seconds) >250-haught.org (Read took 0.0012670755386353 seconds) >250-AUTH LOGIN CRAM-MD5 PLAIN (Read took 0.0014160871505737 seconds) Sept 23rd tree (Connected in 0.0024210214614868 seconds) >220 haught.org ESMTP (Read took 60.012040019035 seconds) < EHLO localhost (Write took 0.00059795379638672 seconds) >250-haught.org (Read took 60.009819984436 seconds) >250-AUTH LOGIN CRAM-MD5 PLAIN (Read took 120.02024698257 seconds) Oct 2nd tree (Connected in 0.010542035102844 seconds) >220 haught.org ESMTP (Read took 60.008027911186 seconds) < EHLO localhost (Write took 0.00064098834991455 seconds) >250-haught.org (Read took 60.009781002998 seconds) >250-AUTH LOGIN CRAM-MD5 PLAIN (Read took 120.02020800114 seconds) I have tried other mail servers with the same result. All trees compiled with the same configure script. I first noticed this using PEAR's Mail scripts using smtp. configure script: './configure' \ '--enable-posix' \ '--enable-session' \ '--enable-xml' \ '--enable-inline-optimization' \ '--with-apxs=/home/www/sbin/apxs' \ '--with-config-file-path=/etc' \ '--enable-versioning' \ '--with-regex=system' \ '--enable-track-vars' \ '--with-zlib' \ '--with-gd=/usr/local' \ '--with-pgsql=/usr/local' \ '--with-openssl=/usr' \ '--with-xml=/usr/local' \ '--with-expat-dir=/usr/local' \ '--enable-trans-sid' \ '--with-jpeg-dir=/usr/local' \ '--with-png-dir=/usr/local' \ '--with-freetype-dir=/usr/local' \ '--prefix=/home/www' \ '--enable-gd-native-ttf' \ '--with-pcre-regex' \ '--disable-tokenizer' \ '--disable-ctype' \ '--disable-mbstring' \ '--disable-mbregex' \ '--without-mysql' Matt