I posted this question on the modperl list, but I figured I'd bring it over here, too.

I've been pulling my hair out this evening trying to resolve a problem serving content to a cell phone.

Phone is a LG VX-4500. I've written a simple handler as a start to just send "Hello" to the phone along with a Content-Length and Connection: Close header but the phone just times out. With a browser, all is well. File-based (non mod_perl) content gets to the phone fine, it's only the mod_perl content that is timing out. I can see the requests coming and going in the logs. It looks like the data just never gets sent back to the phone.

I rewrote the handler as a stand-alone CGI.pm script and it works just fine.

Running:
Debian Sarge
Apache 2.0.52
mod_perl2
Any thoughts on this would be appreciated.



UPDATE:

I received a post on the mod_perl list concerning this suggesting that I double-check the headers. Here copies of the relavent posts:

Perrin,

My first inclination upon reading this post was "Silly, of course I checked the headers."

However, upon doing what you suggested by putting the CGI.pm script and mod_perl version side by side in lynx, the only difference was the following header:

Cache-Control: max-age=0 must-revalidate

I took that out and it works fine. Further inspection reveals that Cache-Control is apparently an HTTP1.1 feature. I replaced it with the HTTP1.0 'Pragma: no-cache' and that worked out fine.

Thank you so much for the suggestion. I'm sure it was suggested before, but perhaps I just needed to time away from it to look deeper.

Rodger

On Tue, 15 Mar 2005 22:25:10 -0500
Perrin <perrin@....> wrote:

> On Sat, 2005-03-12 at 18:25 -0500, Rodger Castle wrote:
> > I got around the immediate problem by a per-file <Location> directive
> > for the particular script in question and writing it with CGI.pm with
> > no problems.
>
> This almost certainly means that your mod_perl script is not sending out
> the right headers. Look at the complete response headers using GET or
> lynx or something and compare them to see what's missing in your
> mod_perl script.
>
> - Perrin
>
>
edited by demerphq to give perrin some privacy.

In reply to Cell phone / mod_perl2 trouble by virgomoon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.