]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1560187 - Remove legacy server push code
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 19 Jun 2019 23:04:51 +0000 (19:04 -0400)
committerGitHub <noreply@github.com>
Wed, 19 Jun 2019 23:04:51 +0000 (19:04 -0400)
Bugzilla/CGI.pm
Bugzilla/Error.pm
buglist.cgi
template/en/default/list/server-push.html.tmpl [deleted file]

index e6da5a2a2487d361d329e3ca4030923f232ba377..a16c21fa522a62023994d2071583febc7ccf3f15 100644 (file)
@@ -284,82 +284,6 @@ sub check_etag {
   return 0;
 }
 
-# Overwrite to ensure nph doesn't get set, and unset HEADERS_ONCE
-sub multipart_init {
-  my $self = shift;
-
-  # Keys are case-insensitive, map to lowercase
-  my %args = @_;
-  my %param;
-  foreach my $key (keys %args) {
-    $param{lc $key} = $args{$key};
-  }
-
-  # Set the MIME boundary and content-type
-  my $boundary
-    = $param{'-boundary'} || '------- =_' . generate_random_password(16);
-  delete $param{'-boundary'};
-  $self->{'separator'}       = "\r\n--$boundary\r\n";
-  $self->{'final_separator'} = "\r\n--$boundary--\r\n";
-  $param{'-type'}            = CGI::SERVER_PUSH($boundary);
-
-  # Note: CGI.pm::multipart_init up to v3.04 explicitly set nph to 0
-  # CGI.pm::multipart_init v3.05 explicitly sets nph to 1
-  # CGI.pm's header() sets nph according to a param or $CGI::NPH, which
-  # is the desired behaviour.
-
-  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 %args = @_;
-
-  # CGI.pm::multipart_start doesn't honour its own charset information, so
-  # we do it ourselves here
-  if (defined $self->charset() && defined $args{-type}) {
-
-    # Remove any existing charset specifier
-    $args{-type} =~ s/;.*$//;
-
-    # and add the specified one
-    $args{-type} .= '; charset=' . $self->charset();
-  }
-
-  my $headers = $self->SUPER::multipart_start(%args);
-
-  # 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;
-  $self->{_multipart_in_progress} = 1;
-  return $headers;
-}
-
-sub close_standby_message {
-  my ($self, $contenttype, $disp, $disp_prefix, $extension) = @_;
-  $self->set_dated_content_disp($disp, $disp_prefix, $extension);
-
-  if ($self->{_multipart_in_progress}) {
-    print $self->multipart_end();
-    print $self->multipart_start(-type => $contenttype);
-  }
-  else {
-    print $self->header($contenttype);
-  }
-}
-
 our $ALLOW_UNSAFE_RESPONSE = 0;
 
 # responding to text/plain or text/html is safe
index d47498372002408cb025d0c3fb7a1d3c6913ae7a..c7bfd1924d3e314dad99572b07791906643ced3e 100644 (file)
@@ -88,9 +88,9 @@ sub _throw_error {
   if (Bugzilla->error_mode == ERROR_MODE_WEBPAGE) {
     Bugzilla->check_rate_limit("webpage_errors", remote_ip(), sub { $vars->{rate_limit_error} = 1 });
     my $cgi = Bugzilla->cgi;
-    $cgi->close_standby_message('text/html', 'inline', 'error', 'html');
+    $cgi->set_dated_content_disp('inline', 'error', 'html');
+    print $cgi->header('text/html');
     $template->process($name, $vars) || ThrowTemplateError($template->error());
-    print $cgi->multipart_final() if $cgi->{_multipart_in_progress};
     $logfunc->("webpage error: $error");
   }
   elsif (Bugzilla->error_mode == ERROR_MODE_TEST) {
index 7f40bc6402f0b5bef1ea1e8732f0dbfff4ee4565..a5f67fdbb335365465226af5d4c45c031abb4d91 100755 (executable)
@@ -745,9 +745,6 @@ $params->delete('limit') if $vars->{'default_limited'};
 # Query Execution
 ################################################################################
 
-# Time to use server push to display an interim message to the user until
-# the query completes and we can display the bug list.
-
 # Connect to the shadow database if this installation is using one to improve
 # query performance.
 $dbh = Bugzilla->switch_to_shadow_db();
@@ -1132,8 +1129,8 @@ if ($format->{'extension'} eq "csv") {
   $vars->{'human'} = $cgi->param('human');
 }
 
-$cgi->close_standby_message($contenttype, $disposition, $disp_prefix,
-  $format->{'extension'});
+$cgi->set_dated_content_disp($disposition, $disp_prefix, $format->{extension});
+print $cgi->header($contenttype);
 
 ################################################################################
 # Content Generation
diff --git a/template/en/default/list/server-push.html.tmpl b/template/en/default/list/server-push.html.tmpl
deleted file mode 100644 (file)
index 914d827..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-[%# The contents of this file are subject to the Mozilla Public
-  # License Version 1.1 (the "License"); you may not use this file
-  # except in compliance with the License. You may obtain a copy of
-  # the License at http://www.mozilla.org/MPL/
-  #
-  # Software distributed under the License is distributed on an "AS
-  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-  # implied. See the License for the specific language governing
-  # rights and limitations under the License.
-  #
-  # The Original Code is the Bugzilla Bug Tracking System.
-  #
-  # The Initial Developer of the Original Code is Netscape Communications
-  # Corporation. Portions created by Netscape are
-  # Copyright (C) 1998 Netscape Communications Corporation. All
-  # Rights Reserved.
-  #
-  # Contributor(s): Myk Melez <myk@mozilla.org>
-  #%]
-
-[%# INTERFACE:
-  # debug: boolean. True if we want the search displayed while we wait.
-  # query: string. The SQL query which makes the buglist.
-  #%]
-
-[% PROCESS global/variables.none.tmpl %]
-
-<html>
-  <head>
-    <title>[% terms.Bugzilla %] is pondering your search</title>
-  </head>
-  <body>
-    <h1 style="margin-top: 20%; text-align: center;">Please stand by ...</h1>
-
-    [% IF debug %]
-      <p>[% query FILTER html %]</p>
-      [% IF query_explain.defined %]
-        <pre>[% query_explain FILTER html %]</pre>
-      [% END %]
-    [% END %]
-  </body>
-</html>