Re: Bug #1691: blocking mode sockets override max_execution_time

From: Date: Sat, 10 Jul 1999 19:33:32 +0000
Subject: Re: Bug #1691: blocking mode sockets override max_execution_time
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-8284@lists.php.net to get a copy of this message
True, it seems to block at fgetc() on 3.0.12. However, read on.. Here's my test script: <?php /* test.php3 */ $host = "192.168.1.115"; $port = "80"; $path = "/"; $user = "john"; $pass = "doe"; $auth = base64_encode($user.":".$pass); $fp = fsockopen($host,$port,&$errno,&$errstr); if(!$fp) { echo "$errstr ($errno)<br>\n"; } else { set_socket_blocking($fp,FALSE); fputs($fp,"GET $path HTTP/1.0\r\n"); fputs($fp,"Authorization: Basic $auth\r\n"); fputs($fp,"\r\n"); echo "So far, so good\n"; flush(); while(!feof($fp)) { echo "So far, so good\n"; flush(); $result = $result . fgetc($fp); } fclose($fp); } echo $result; ?> And here are the results: PHP3.0.9 with blocking socket: "So far, so good" once PHP3.0.9 without blocking socket: "So far, so good" forever PHP3.0.12 with blocking socket: "So far, so good" twice PHP3.0.12 without blocking socket: "So far, so good" twice Of these, only PHP3.0.9 without blocking socket will terminate the script after max_execution_time. I consider this a bug. Marko -- this is my sig. there are many like it, but this one is mine marko karppinen @ icon medialab finland, +358 40 541 3399

« previous php.dev (#8284) next »