G'day all,
Got a bit of a weird set of behaviour with a mod_perl Apache::Registry type script.

HISTORY:
I've been using MD5 digests of the html sent from my scripts as ETags, hence saving an important bit of bandwidth. Got a little bit carried away with the success of this project and attempted to handle range requests as well. Worked fine when running as a CGI script, but blew a fuse when running as an Apache::Registry script. Stripped the script down to the basics and the error continued. I have a script called test.pl which has the following content.

#! /usr/bin/perl -wT

MAIN: {
print <<_OUT_;
Status: 206 Partial Content
Content-Type: text/html; charset=UTF-8
Content-Length: 11
Content-Range: bytes 0-10/1336
Date: Fri, 31 Jan 2003 09:39:01 GMT
ETag: "xxxx"

_OUT_
print '<?xml versi';
}

When the script is run, the following output appears.

[dave@localhost]$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /test.pl HTTP/1.1
Host: localhost

HTTP/1.1 206 Partial Content
Date: Sat, 01 Feb 2003 22:12:47 GMT
Server: Apache
Content-Range: bytes 0-10/1336
ETag: "xxxx"
Content-Length: 11
Content-Type: text/html; charset=UTF-8

<?xml versi<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>206 Partial Content</TITLE>
</HEAD><BODY>
<H1>Partial Content</H1>
The server encountered an internal error or
misconfiguration and was unable to complete
your request.<P>
Please contact the server administrator,
[EMAIL PROTECTED] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.<P>
More information about this error may be available
in the server error log.<P>
</BODY></HTML>

Fairly obviously, not what is desired. However, if you change the '206' in the script to a '200', the script works fine. I've searched through the mod_perl code in a brief fashion for a condition that would cause this, but couldn't find anything. Anyone got any ideas?

CONFIGURATION

apache 1.3.27
mod_perl 1.27
mod_ssl 2.8.11-1.3.27

httpd.conf

ServerType standalone
ServerTokens ProductOnly

Timeout 300
KeepAlive On
KeepAliveTimeout 100
MaxKeepAliveRequests 10
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 20
MaxRequestsPerChild 10
BindAddress 127.0.0.1

Port 80
User nobody
Group nobody
UseCanonicalName On
DefaultType text/plain
HostnameLookups Off
ServerSignature Off

ServerAdmin [EMAIL PROTECTED]
DocumentRoot /path/to/script/parent
<VirtualHost *>
ErrorLog /var/log/httpd/error_log
<Directory />
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
</Directory>
</VirtualHost>

Reply via email to