You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jason Leidigh <jl...@uol.com.ar> on 2000/06/07 01:51:52 UTC

$r->print() Fails

I have a rewriting proxy based on the module of the same name by:
Mike Reiling, Steve Baker and Tim DiLauro (Many thanks to them and I =
will be contacting you soon)

I have made some modifications which SEEM to have disturbed the code.  =
The original SEEM to fail in the same way (I say seem because =
it appears to be irregular).  The problem is the following.

I capture a request using a the proxy_mod internally carry out the =
request with LWP and rewrite much of the content but when I print the =
content to the browser using:

$r->print("/n$content");

The page comes back broken, like this:

<html>
<head>

<title>Sexoterapia</title>
<meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Diso-8859-1">
</head>

<frameset rows=3D"96,1*" frameborder=3D"NO" border=3D"0" =
framespacing=3D"0">=20
  <frame src=3D"intro_top.htm" name=3D"superior" marginwi


That word marginwidth is not the only place the page can break and I =
have found that while it very regular per session is I change sessions I =
can often see a different break point.  BUT her is the real doozy... if =
I porint $content to a Log file right before I send it out with =
$r->print("/n$content"); it ALWAYS prints well.  That is to say that =
neither the LWP GET nor and of the substitutions are the problem but =
some how the sending of the material to the browser via Apache...  I =
supoose there must be some character confusing apache and making it =
believe that the file has ended when it has not...but I am =
stumped!@%^$^!
ALSO if I print out the content direct from the LWP I get the same =
problem.. The page breaks in the browser but is perfect in the log

I tried something stupid like:

$content =3D~ s/(\n|\r)/\r/gio;but no luck!

I guess my real question is what character can fool apache but get =
printed to a text file without detection...