Commit 1ddabefa authored by jocuri%softhome.net's avatar jocuri%softhome.net

Patch for bug 226251 (internal error when server push is enabled): Due to…

Patch for bug 226251 (internal error when server push is enabled): Due to randomization of perl hash table functionality since 5.8.1 the 'hack' to unset the nph parameter for multipart messages is not working reliable, instead a modified clone of the original multipart_init function is setting this parameter to '0' and is ignoring the given nph parameter from buglist.cgi; patch by Stephen Reindl <sr@stephenreindl.de>; r=bbaetz; a=justdave.
parent fcee2c57
...@@ -23,7 +23,7 @@ use strict; ...@@ -23,7 +23,7 @@ use strict;
package Bugzilla::CGI; package Bugzilla::CGI;
use CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles :unique_headers); use CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles :unique_headers SERVER_PUSH);
use CGI::Util qw(rearrange); use CGI::Util qw(rearrange);
use base qw(CGI); use base qw(CGI);
...@@ -111,13 +111,21 @@ sub canonicalise_query { ...@@ -111,13 +111,21 @@ sub canonicalise_query {
return join("&", @parameters); return join("&", @parameters);
} }
# CGI.pm makes this nph, but apache doesn't like that # Overwrite to handle nph parameter. This should stay here until perl 5.8.1 CGI
# has been fixed to support -nph as a parameter
#
sub multipart_init { sub multipart_init {
my $self = shift; my($self,@p) = @_;
my($boundary,$nph,@other) = rearrange(['BOUNDARY','NPH'],@p);
unshift(@_, '-nph' => undef); $boundary = $boundary || '------- =_aaaaaaaaaa0';
$self->{'separator'} = "\r\n--$boundary$\r\n";
return $self->SUPER::multipart_init(@_); $self->{'final_separator'} = "\r\n--$boundary--\r\n";
my $type = SERVER_PUSH($boundary);
return $self->header(
-nph => 0,
-type => $type,
(map { split "=", $_, 2 } @other),
) . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $self->multipart_end;
} }
# Override header so we can add the cookies in # Override header so we can add the cookies in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment