Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

WWWXXXAPC, docmd.close 2585, WWWXXXDOCO, nu vot, dhcpd lease file "binding state", WWWXXXDOCO, how to setup procmail to process html2text, how to setup procmail html2text, WWWXXXAPC., XXXCNZZZ

Links

XODOX
Impressum

#1: MP2 - ("did not send an HTTP header")

Posted on 2005-07-12 00:14:01 by Bill Whillers

Ugh. We have CGI scripts that were ported a while ago to MP 1x and seemed to
work fine at that time but now we've set up an MP 2 environment and are
seeing "did not send an HTTP header" (everywhere), such as with:

print "Location: $url\n\n";

(All CGI code here uses the same common method to produce standard headers)

What is confusing is that sometimes pages return fine.

Is there something I'm missing or should verify/check? -- (httpd.conf does use
PerlOptions +ParseHeaders).


BW

Report this message

#2: re: MP2 - ("did not send an HTTP header")

Posted on 2005-07-12 01:25:19 by kmcgrail

Bill:

I am having the same problem. I thought it stemmed from the $|++ that we
used to turn off buffering but that doesn't seem to be it for us.

See
http://perl.apache.org/docs/2.0/user/coding/coding.html#Gene rating_HTTP_Response_Headers
for a hint but I haven't fixed it and I haven't turned on assbackwards
method either.

Regards,
KAM

----- Original Message -----
From: "Bill Whillers" <mod_perl@whohasit.com>
To: <modperl@perl.apache.org>
Sent: Monday, July 11, 2005 6:14 PM
Subject: MP2 - ("did not send an HTTP header")


> Ugh. We have CGI scripts that were ported a while ago to MP 1x and seemed
to
> work fine at that time but now we've set up an MP 2 environment and are
> seeing "did not send an HTTP header" (everywhere), such as with:
>
> print "Location: $url\n\n";
>
> (All CGI code here uses the same common method to produce standard
headers)
>
> What is confusing is that sometimes pages return fine.
>
> Is there something I'm missing or should verify/check? -- (httpd.conf does
use
> PerlOptions +ParseHeaders).
>
>
> BW
>

Report this message

#3: Re: MP2 - ("did not send an HTTP header")

Posted on 2005-07-12 20:48:17 by Bill Whillers

Can someone on the list share any information about this?

Without modification, our scripts work fine until they generate a Cookie,
Location header or other header using our own methods (without using $r).

> because I'd like to move towards more native MP code anyway!
ditto.

Thanks Kevin


----- Original Message -----
From: "Kevin A. McGrail" <kmcgrail@pccc.com>
To: "Bill Whillers" <mod_perl@whohasit.com>
Sent: Tuesday, July 12, 2005 5:37 AM
Subject: Re: MP2 - ("did not send an HTTP header")

> I've gotten the opinion so far that this is more of an Apache2 and not a
> MP2 issue. That's why the $r->assbackwards method is really
> re-configuring an Apache2 core method.
>
> But I agree that this was very annoying because I had hoped to switch
> several scripts that would benefit from perlrun/registry but believe I
> will need to now hunt down the content-type/location/cookie/etc. code that
> is outputted and use the mp2 header methodology to avoid the did not send
> HTTP header error from the Apache core.
>
> The reason I haven't delved deeper is that I believe the issue should be
> fixed fairly simply with some code like this:
>
> if (MP2) {
> $r->err_headers_out(whatever=>'something');
> } else {
> print "Content-type: text/html\n";
> }
>
> This is probably a "good thing" because I'd like to move towards more
> native MP code anyway!
>
> Regards,
> KAM
>
> ----- Original Message -----
> From: Bill Whillers <mod_perl@whohasit.com>
> To: "Kevin A. McGrail" <kmcgrail@pccc.com>
> Sent: Monday, July 11, 2005 10:38 PM
> Subject: Re: MP2 - ("did not send an HTTP header")
>
>> Thanks. This seems to have become a big can of worms-- much more involved
>> than
>> moving CGI to MP1x. Unless I have some revelation that does not involve
>> re-writing or a severe re-architect of what we've got, I'll abandon this
>> project and just stick to MP-1.99.
>>
>> I'm having trouble finding anything that even touches on why we're
>> hitting
>> trouble that did not seem to exist in earlier revs. The "META" comments
>> seem
>> to pick up right where I need more info.
>>
>> Of course, if I find something, I'll post it.

-------------------------------------------------------

Report this message

#4: Re: MP2 - ("did not send an HTTP header")

Posted on 2005-07-12 20:59:07 by Geoffrey Young

Bill Whillers wrote:
> Can someone on the list share any information about this?

please file a proper bug report:

http://perl.apache.org/bugs/

specifically, running t/REPORT will let us know which versions of CGI.pm and
mod_perl you're using so we don't need to guess.

--Geoff

Report this message

#5: Re: MP2 - ("did not send an HTTP header")

Posted on 2005-07-12 22:12:33 by Bill Whillers

Thanks Geoff,

I'm not suggesting this is a 'bug' at this point however I'd like to find (or
solicit) more info about this.

The is some kind of buffering issue. I've isolated that this only happens
serving pages exceeding a specific size (7716 bytes) (??).

httpd.conf uses:

<Location /test/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>


Thanks

On Tuesday 12 July 2005 11:59, Geoffrey Young wrote:
> Bill Whillers wrote:
> > Can someone on the list share any information about this?
>
> please file a proper bug report:
>
> http://perl.apache.org/bugs/
>
> specifically, running t/REPORT will let us know which versions of CGI.pm
> and mod_perl you're using so we don't need to guess.
>
> --Geoff

Report this message

#6: Re: MP2 - ("did not send an HTTP header")

Posted on 2005-07-12 22:22:42 by Bill Whillers

The test machine is running:

CGI 3.10
Apache/2.0.54 (Unix)
mod_perl/2.0.1
Perl/v5.8.5


On Tuesday 12 July 2005 13:12, Bill Whillers wrote:
> Thanks Geoff,
>
> I'm not suggesting this is a 'bug' at this point however I'd like to find
> (or solicit) more info about this.
>
> The is some kind of buffering issue. I've isolated that this only happens
> serving pages exceeding a specific size (7716 bytes) (??).
>
> httpd.conf uses:
>
> <Location /test/>
> SetHandler perl-script
> PerlResponseHandler ModPerl::Registry
> PerlOptions +ParseHeaders
> Options +ExecCGI
> </Location>
>
>
> Thanks
>
> On Tuesday 12 July 2005 11:59, Geoffrey Young wrote:
> > Bill Whillers wrote:
> > > Can someone on the list share any information about this?
> >
> > please file a proper bug report:
> >
> > http://perl.apache.org/bugs/
> >
> > specifically, running t/REPORT will let us know which versions of CGI.pm
> > and mod_perl you're using so we don't need to guess.
> >
> > --Geoff

Report this message

#7: Re: MP2 - ("did not send an HTTP header")

Posted on 2005-07-13 01:03:42 by Bill Whillers

OK... life is better after re-visiting:

<http://perl.apache.org/docs/2.0/user/coding/coding.html#Generating_HTTP_Response_Headers>

and just using:
use Apache2::RequestRec ();
$r=Apache2::RequestUtil->request;
$r->content_type($mime_type);

in the few places where these scripts print their own headers.

I've yet to rewrite/replace the other areas where they print headers (i.e.
Cookies, Redirects, etc.) and plan to use something like:

use Apache2::Const -compile => qw(REDIRECT);
$r->headers_out->set(Location => $location);
return Apache2::Const::REDIRECT;

but for now, it appears that we're on the right track.

Hope this thread can help others.



On Tuesday 12 July 2005 13:22, Bill Whillers wrote:
> The test machine is running:
>
> CGI 3.10
> Apache/2.0.54 (Unix)
> mod_perl/2.0.1
> Perl/v5.8.5
>
> On Tuesday 12 July 2005 13:12, Bill Whillers wrote:
> > Thanks Geoff,
> >
> > I'm not suggesting this is a 'bug' at this point however I'd like to find
> > (or solicit) more info about this.
> >
> > The is some kind of buffering issue. I've isolated that this only happens
> > serving pages exceeding a specific size (7716 bytes) (??).
> >
> > httpd.conf uses:
> >
> > <Location /test/>
> > SetHandler perl-script
> > PerlResponseHandler ModPerl::Registry
> > PerlOptions +ParseHeaders
> > Options +ExecCGI
> > </Location>
> >
> >
> > Thanks
> >
> > On Tuesday 12 July 2005 11:59, Geoffrey Young wrote:
> > > Bill Whillers wrote:
> > > > Can someone on the list share any information about this?
> > >
> > > please file a proper bug report:
> > >
> > > http://perl.apache.org/bugs/
> > >
> > > specifically, running t/REPORT will let us know which versions of
> > > CGI.pm and mod_perl you're using so we don't need to guess.
> > >
> > > --Geoff

Report this message