I've been working for hours trying to debug a problem under mod_perl and it's been stumping me. Basically, we have a pseudo-REST interface attempts to return JSON data. We return the JSON as one long string. Unfortunately, it never showed up in the browser even though "warn"ing the data made it show up in the error log.
After verifying that I could just $r->print('something');, I became even more confused. A bit of research revealed that short strings would work, long strings would not. So I came up with this:
# Usage: http://www.example.com/?4095 sub handler { my $r = shift; $r->content_type('text/plain'); my @args = $r->args; $r->print('x' x $args[0]); return Apache2::Const::OK; }
That handler will print as many "X" characters as the first number in the query string. Most suspiciously, Firefox stopped rendering as soon as that number hit 2^12, or 4096. I finally created a file on my computer named "ff_test.html" and wrote out 4096 'x's to it. I opened it in Firefox and it rendered fine but the font was different. The I noticed the extension and renamed the file to "ff_test.txt" and reopened it. Bingo! No rendering. Removing a single 'x' allowed it to render.
I can't seem to find a mention of this bug on bugs.mozilla.org. Before I report it, I'm wondering if anyone else has this problem. If so, what platform are you running and what version of Firefox?
I don't have a problem with either 4095 or 4096 x's using Firefox 1.0.7 on Fedora Core 4
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7
perl -e 'print "X"x8192' > firefoxx.txt
File opens and renders fine in Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.10) Gecko/20050925 Firefox/1.0.4 (opened locally or downloaded from the web).
No. Whether I use 4,096 or 40,960 characters – it always renders.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7