summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2004-02-23 03:52:05 +0100
committerjocuri%softhome.net <>2004-02-23 03:52:05 +0100
commit1ddabefad38f1fe6fc0343869a46bb7c8fa137d8 (patch)
tree47536547c725e082c3743a41cfd6494260328630 /Bugzilla
parentfcee2c5701545b734659640c66051473f565d7aa (diff)
downloadbugzilla-1ddabefad38f1fe6fc0343869a46bb7c8fa137d8.tar.gz
bugzilla-1ddabefad38f1fe6fc0343869a46bb7c8fa137d8.tar.xz
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.
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/CGI.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 2ffd35aad..763f418e9 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -23,7 +23,7 @@ use strict;
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 base qw(CGI);
@@ -111,13 +111,21 @@ sub canonicalise_query {
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 {
- my $self = shift;
-
- unshift(@_, '-nph' => undef);
-
- return $self->SUPER::multipart_init(@_);
+ my($self,@p) = @_;
+ my($boundary,$nph,@other) = rearrange(['BOUNDARY','NPH'],@p);
+ $boundary = $boundary || '------- =_aaaaaaaaaa0';
+ $self->{'separator'} = "\r\n--$boundary$\r\n";
+ $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