RSS

trunk : 6125

gerv%gerv.net
2008-07-07 15:07:23
Revision ID: cvs-1:gervgerv.net-20080707200723-ikz4tw9pto8tzum4
Bug 441496 - Use server push (multipart/x-mixed-replace) with compatible versions of Safari. Patch by gerv; r,a=LpSolit.

collapse all collapse all

added added

removed removed

137
# to the URL.
137
# to the URL.
138
#
138
#
139
# Server push is a Netscape 3+ hack incompatible with MSIE, Lynx, and others. 
139
# Server push is a Netscape 3+ hack incompatible with MSIE, Lynx, and others. 
140
# Even Communicator 4.51 has bugs with it, especially during page reload.
140
# Safari 2.0.2 (Webkit 416.11) and above support it.
141
# http://www.browsercaps.org used as source of compatible browsers.
 
 
142
# Safari (WebKit) does not support it, despite a UA that says otherwise (bug 188712)
 
 
143
# MSIE 5+ supports it on Mac (but not on Windows) (bug 190370)
141
# MSIE 5+ supports it on Mac (but not on Windows) (bug 190370)
144
#
142
#
 
 
143
my $webkitversion = "";
 
 
144
if ($ENV{'HTTP_USER_AGENT'} =~ /WebKit\/(\d+)/) {
 
 
145
  $webkitversion = $1;
 
 
146
}
 
 
147
 
145
my $serverpush =
148
my $serverpush =
146
  $format->{'extension'} eq "html"
149
  $format->{'extension'} eq "html"
147
    && exists $ENV{'HTTP_USER_AGENT'} 
150
    && exists $ENV{'HTTP_USER_AGENT'} 
148
      && $ENV{'HTTP_USER_AGENT'} =~ /Mozilla.[3-9]/ 
151
      && $ENV{'HTTP_USER_AGENT'} =~ /Mozilla.[3-9]/ 
149
        && (($ENV{'HTTP_USER_AGENT'} !~ /[Cc]ompatible/) || ($ENV{'HTTP_USER_AGENT'} =~ /MSIE 5.*Mac_PowerPC/))
152
        && (($ENV{'HTTP_USER_AGENT'} !~ /[Cc]ompatible/) || ($ENV{'HTTP_USER_AGENT'} =~ /MSIE 5.*Mac_PowerPC/))
150
          && $ENV{'HTTP_USER_AGENT'} !~ /WebKit/
153
          && (!$webkitversion || $webkitversion >= 416)
151
            && !$agent
154
            && !$agent
152
              && !defined($cgi->param('serverpush'))
155
              && !defined($cgi->param('serverpush'))
153
                || $cgi->param('serverpush');
156
                || $cgi->param('serverpush');

Loggerhead runs on Bazaar branches