2

I am using mod_perl 2, mason, and apache 2.2 on Ubuntu 10.10 (x86) (standard packages from apt). When I send a HTTP request to my server, I get the following:

$ nc localhost 80 < ~/Desktop/test.http
HTTP/1.1 200 OK
Date: Mon, 22 Nov 2010 00:32:02 GMT
Server: Apache/2.2.16 (Ubuntu)
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html

38
<html><body>Current IP Address: 127.0.0.1</body></html>

0

I am a bit curious about this. What do those numbers (38 and 0) mean? I have looked in my logs, but I don't see anything meaningful and I can't seem to figure out the best search phrase for Google (and sorry if I am missing something obvious from the docs). I get the same result from telnet (but Firefox doesn't seem to throw any sort of error).

Here is the content of my request (omitting the whitespace at the end):

GET /test.html HTTP/1.1
HOST: example.com

and my script (test.html):

% my $ip = $r->connection->remote_ip();
<html><body>Current IP Address: <% $ip %></body></html>

Thanks in advance!

friedo
  • 65,762
  • 16
  • 114
  • 184
Joe Bane
  • 1,556
  • 1
  • 15
  • 30

1 Answers1

5

The numbers are boundary delimiters for chunked encoding. (Note the value of the Transfer-Encoding header you got in the response.)

The 38 indicates there are 38(hex) = 56 bytes in the first chunk. The 0 indicates there are no more chunks.

friedo
  • 65,762
  • 16
  • 114
  • 184