Bug #16114 Updated: fputs doesn't send all data
| From: | jason@php.net | Date: | Wed, 10 Jul 2002 16:29:01 +0000 |
| Subject: | Bug #16114 Updated: fputs doesn't send all data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13746@lists.php.net to get a copy of this message | ||
ID: 16114
Updated by: jason@php.net
Reported By: manu@chasqui.uclv.edu.cu
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: Windows 2000 AS
PHP Version: 4.1.1
New Comment:
Could you try this on 4.2.1, and the latest snapshot on
http://snaps.php.net/win32/ ?
The internal streams subsystem has been implemented in the snapshots,
which is a complete rewrite.
Thanks,
-Jason
Previous Comments:
------------------------------------------------------------------------
[2002-03-25 16:12:18] manu@chasqui.uclv.edu.cu
I did also a test(without chunking the data), I could send 48653 bytes,
but couldn't 49229 bytes.
With the chunking feature it must be some bug in my code, cause didn't
work with 48653 bytes.
Manu.
------------------------------------------------------------------------
[2002-03-25 15:42:42] manu@chasqui.uclv.edu.cu
I did something like this. Didn't work.
$socket = fsockopen( $host, $port, $err1, $err2, 30 );
if (!$socket) die ('conn');
$start = 0;
$len = 4*1024;
$result = 0;
while ($result < strlen($request))
{
$chunk = substr( $request, $start, $start+$len );
$result = $result + fputs( $socket, $chunk );
fflush( $socket );
$start = $start+$len;
}
fclose( $socket );
Hope you find the answer. :->
Manu.
------------------------------------------------------------------------
[2002-03-25 14:14:36] wez@php.net
Could you try sending the data in smaller chunks that are
< 8KB each?
I think I might have a solution.
--Wez.
------------------------------------------------------------------------
[2002-03-25 13:16:49] manu@chasqui.uclv.edu.cu
I did once I received your reply. It didn't work either.
Manu.
------------------------------------------------------------------------
[2002-03-16 20:39:21] wez@php.net
Have you tried fflush($p) before you fclose()?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/16114
--
Edit this bug report at http://bugs.php.net/?id=16114&edit=1