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?

Thanks!
Ruslan

Reply via email to