]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 342757: searching results in "YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHN...
authormkanat%bugzilla.org <>
Wed, 12 Jul 2006 13:05:07 +0000 (13:05 +0000)
committermkanat%bugzilla.org <>
Wed, 12 Jul 2006 13:05:07 +0000 (13:05 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=justdave

Bugzilla/CGI.pm
buglist.cgi

index b4bcf20c8b012e53023c4a3778fc231b9eb84e86..dd6061346c03da174e28da75b008ce36bceda6da 100644 (file)
@@ -158,14 +158,27 @@ sub multipart_init {
     # CGI.pm's header() sets nph according to a param or $CGI::NPH, which
     # is the desired behaviour.
 
-    # Allow multiple calls to $cgi->header()
-    $CGI::HEADERS_ONCE = 0;
-
     return $self->header(
         %param,
     ) . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $self->multipart_end;
 }
 
+# Have to add the cookies in.
+sub multipart_start {
+    my $self = shift;
+    my $headers = $self->SUPER::multipart_start(@_);
+    # Eliminate the one extra CRLF at the end.
+    $headers =~ s/$CGI::CRLF$//;
+    # Add the cookies. We have to do it this way instead of
+    # passing them to multpart_start, because CGI.pm's multipart_start
+    # doesn't understand a '-cookie' argument pointing to an arrayref.
+    foreach my $cookie (@{$self->{Bugzilla_cookie_list}}) {
+        $headers .= "Set-Cookie: ${cookie}${CGI::CRLF}";
+    }
+    $headers .= $CGI::CRLF;
+    return $headers;
+}
+
 # Override header so we can add the cookies in
 sub header {
     my $self = shift;
@@ -183,13 +196,6 @@ sub header {
     return $self->SUPER::header(@_) || "";
 }
 
-# Override multipart_start to ensure our cookies are added and avoid bad quoting of
-# CGI's multipart_start (bug 275108)
-sub multipart_start {
-    my $self = shift;
-    return $self->header(@_);
-}
-
 # The various parts of Bugzilla which create cookies don't want to have to
 # pass them around to all of the callers. Instead, store them locally here,
 # and then output as required from |header|.
index 1a7ffc316d4c68456c8d7ba08e008a8264ed8580..1400968fc7ad9d35059eb5f25c4fc3bfb42d9b54 100755 (executable)
@@ -884,6 +884,12 @@ if ($serverpush) {
     $template->process("list/server-push.html.tmpl", $vars)
       || ThrowTemplateError($template->error());
 
+    # Under mod_perl, flush stdout so that the page actually shows up.
+    if ($ENV{MOD_PERL}) {
+        require Apache2::RequestUtil;
+        Apache2::RequestUtil->request->rflush();
+    }
+
     # Don't do multipart_end() until we're ready to display the replacement
     # page, otherwise any errors that happen before then (like SQL errors)
     # will result in a blank page being shown to the user instead of the error.