On Mon, Jun 04, 2001 at 07:53:59PM +0400, Ruslan V. Sulakov wrote:
> Strange numbers appeares, when I use HTTP 1.1 protocol to get response from my 
>mod_perl server.
> The test.pl script:
> use strict;
> use Apache::Request();
> my $r = shift;
> my $apr = Apache::Request->new($r);
> $apr->send_http_header('text/html');
> print "1234567";
> 
> Now look to  HTTP 1.1. response of this script:
> # telnet xx.xx.ru 81
> Trying xxx.xxx.xxx.xxx...
> Connected to xx.xx.ru.
> Escape character is '^]'.
> GET /test.pl HTTP/1.1
> Accept: */*
> Host: xx.xx.ru
> 
> HTTP/1.1 200 OK
> Date: Mon, 04 Jun 2001 14:49:24 GMT
> Server: Apache/1.3.12 (Unix) mod_perl/1.24
> Transfer-Encoding: chunked
> Content-Type: text/html
> 
> 1
> 1234567
> 0

> What does mean number 1 before line "1234567"? And what does mean 0 after all?
> Is there a way to cut off the line with number "1" and cut off the line with number 
>"0"?
> I need only line "1234567" in response! It is vital for me!
> 
> ------------
> Now look what will be, if I ask HTTP version 1.0:
> bsd2# telnet xx.xx.ru 80
> Trying 212.188.13.65...
> Connected to xx.xx.ru.
> Escape character is '^]'.
> GET /test.pl HTTP/1.0
> Accept: */*
> Host: xx.xx.ru
> 
> HTTP/1.1 200 OK
> Date: Mon, 04 Jun 2001 15:39:16 GMT
> Server: Apache/1.3.9 (Unix) mod_perl/1.21 rus/PL28.18
> Connection: close
> Content-Type: text/html; charset=koi8-r
> 
> 1234567
> 
> 
> Thats all right with HTTP/1.0! No additional lines in output and no Header 
>"Transfer-Encoding: chunked" in response.
> ------------------------
> But I need , it to be all right in case of HTTP/1.1 !
> 
> Is there any ideas?

<guess>

here's the key the the answer you're looking for:

        Transfer-Encoding: chunked

for wise browsing software, these numbers are used in
re-constructing the original html from the chunks as they
arrive.

if you're just sending your stuff to an average joe running a
standard web browser, they should all understand this stuff out
of the box. if you're doing something fancy (proxy filter,
maybe?) perhaps you need to check the specs for the HTTP/1.1
protocols and accomodate them. :)

<guess>

-- 
#95: We are waking up and linking to each other. We are watching. But
we are not waiting.  -- www.cluetrain.com

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Reply via email to