#19678 [Opn->Bgs]: echo and print output the number of bytes written
| From: | hholzgra@php.net | Date: | Mon, 30 Sep 2002 21:18:33 +0000 |
| Subject: | #19678 [Opn->Bgs]: echo and print output the number of bytes written | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20794@lists.php.net to get a copy of this message | ||
ID: 19678
Updated by: hholzgra@php.net
Reported By: busby@pnts.com
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: redhat 7.3
PHP Version: 4.2.3
New Comment:
you just discovered http/1.1 chunked output encoding ;)
you can either switch to http/1.0 to prevent chunked
output or implement chunk decoding as required as a
'MUST' in RFC2616
see also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1
http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.4.6
Previous Comments:
------------------------------------------------------------------------
[2002-09-30 14:11:05] busby@pnts.com
$doc = domxml_open_mem($HTTP_RAW_POST_DATA);
if (!$doc) {
soap_fault("BAD_DATA","The content supplied was invalid");
}
$env = $doc->document_element();
$body = $env->first_child();
$nodes = $body->child_nodes();
$c = sizeof($nodes);
for($i=0;$i<$c;$i++)
{
if ($nodes[$i]->tagname == "method") $method =
$nodes[$i]->get_content();
if ($nodes[$i]->tagname == "argv") $argv =
$nodes[$i]->child_nodes();
}
echo "AnyData Here";
results in:
c
AnyData Here
That 'c' represents 12, the number of bytes written.
It will do this for every usage of echo, here is a more complicated
response result (can't show code cause my company won't allow that,
will try to provide another sample later)
Sample Code/Output:
-- begin code --
header("Content-Type: text/xml; charset=\"UTF-8\")");
header("Cache-control: private");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"
standalone=\"no\" ?>";
echo "<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">";
echo "<SOAP-ENV:Body>";
echo "<status>success</status>";
echo "</SOAP-ENV:Body></SOAP-ENV:Envelope>";
exit();
-- end code --
-- begin output --
d0
<?xml version="1.0" encoding="UTF-8" standalone="no"
?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><status>success</status></SOAP-ENV:Body></SOAP-ENV:Envelope>
0
-- end output --
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19678&edit=1