ID:               50629
 Updated by:       [email protected]
 Reported By:      viaujoc at videotron dot ca
-Status:           Open
+Status:           Assigned
 Bug Type:         Streams related
 Operating System: Win2003
 PHP Version:      5.3.1
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

Have to reproduce it.


Previous Comments:
------------------------------------------------------------------------

[2010-01-01 19:45:05] viaujoc at videotron dot ca

Description:
------------
When using stream_get_contents() without the $maxlength argument, the
warning "Warning: Invalid CRT parameters detected" is showing up. This
only happens in PHP 5.3.1, it works correctly in PHP 5.2.12.

Adding a very large value to $maxlength, even much larger than the
actual content to be retrieve makes the warning go away.

Reproduce code:
---------------
<?php
$sock = fsockopen("127.0.0.1",80);
$writeStr = "GET / HTTP/1.0\r\n\r\n";
for ($written = 0; $written < strlen($writeStr); $written += $fwrite)
{
   $fwrite = fwrite($sock,substr($writeStr,$written));
   if (!$fwrite) break;
 }
$data = stream_get_contents($sock);
var_dump($data);
?>

Expected result:
----------------
The warning "Warning: Invalid CRT parameters detected" should not show
up, it does not in PHP 5.2.12. In both PHP 5.2.12 and 5.3.1, $data is
containing the same thing.

Actual result:
--------------
Warning: Invalid CRT parameters detected in
D:\wwwroot\Dev\Framework_TestApp\bug.php on line 8
string(726) "HTTP/1.1 200 OK
Content-Length: 555
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Fri, 01 Jan 2010 19:34:36 GMT
Connection: close

<html><head><META http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>127.0.0.1 - /</title></head><body><H1>127.0.0.1 -
/</H1><hr>

<pre>           [... the rest of $data is here]"



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50629&edit=1

Reply via email to