HI,
I've been working with another local server using GLUEscript curl.
I am having problem knowing when all the data is in before writing out NET response.print
Does curl.Info.SIZE_DOWNLOAD report the size sent by the Content-Length: header?
This is my trial code (response) is from a GLUEscript "net" HTTPserver which is working well.
var curl = require("curl");
var c = new curl.Easy();
var html = '';
c.onWrite = function(data)
{
html += data.decodeToString();
}
var resp = c.perform();
while(html.length < c.getinfo(curl.Info.SIZE_DOWNLOAD))
{
}
response.contentType="text/html";
response.print( html );
I never get the complete output. Only about 1400 characters.
My error code for
c.perform();
is 23
The following code is what is writing the response. It works fine when driectly shown in a browser window from the same address that
<?php
$phpinfoHtml = phpinfo();
$fsize = mb_strlen($phpinfoHtml);
// tried this instead: $fsize = strlen($phpinfoHtml);
header("Content-Type: text/html");
header("Content-Length: ".$fsize);
echo $phpinfoHtml;
?>
Are there more headers that curl is expecting?
Or is it my GLUEscript code please?
Paul