<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>50746</bug_id>
          
          <creation_ts>2010-12-09 03:14:30 -0800</creation_ts>
          <short_desc>[Qt] GZip-Compressed content is not shown if end-of-file marker is missing</short_desc>
          <delta_ts>2011-06-20 12:15:13 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>58727</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Thomas Thrainer">thomas.thrainer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>hausmann</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>markus</cc>
    
    <cc>peter.hartmann</cc>
    
    <cc>robert</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>319375</commentid>
    <comment_count>0</comment_count>
      <attachid>76036</attachid>
    <who name="Thomas Thrainer">thomas.thrainer</who>
    <bug_when>2010-12-09 03:14:30 -0800</bug_when>
    <thetext>Created attachment 76036
Ignore HttpError when the HTTP status code is 200 and at least some data was received

Seen on the german eBay site, when logging into &quot;Mein eBay&quot;.

The Problem is that the gzip-stream sent by the server is correct, but does not have an end-of-file marker (zcat says &quot;unexpected end of file&quot;). Other browsers (Chrome, Firefox) do load the page without any error messages.
 
I attach a patch which fixes this problem, and does show all available content when the server has sent a status code of 200. Potentially, incomplete pages could be shown with this patch. I don&apos;t think that&apos;s an issue tough, because otherwise the QWebPage&apos;s error page is shown instead of any data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320016</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Thrainer">thomas.thrainer</who>
    <bug_when>2010-12-10 01:24:53 -0800</bug_when>
    <thetext>I just realized that patching QtWebKit alone is probably not enough.

In Qt, qhttpnetworkconnectionchannel.cpp (what a mouth full!), in the expand(...) method around line 585, QHttpNetworkReplyPrivate::gunzipBodyPartially(...) is called. The return value is compared to Z_STREAM_END if the received data was complete, which fails as the end-of-stream marker is missing. The decompressed data is _not_ appended to the received data in this case, instead an error is emited. This will cause the last piece of data to be lost.

The right thing to do would probably be to append the data if it was successfully received (i.e. ret &gt;= Z_OK), emit readyRead and dataReadProgress anyways, and only finally emit an error if dataComplete &amp;&amp; ret != Z_STREAM_END.

But I think somebody more knowledgeable than me should have a look at this and decide what&apos;s best to do. For now, QtWebKit does handle the eBay-site happily with the attached patch, even if some bytes are probably missing at the end.

I created a Qt-bug for this issue too (http://bugreports.qt.nokia.com/browse/QTBUG-16022).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>335162</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-01-16 23:43:22 -0800</bug_when>
    <thetext>Attachment 76036 did not pass style-queue:

Failed to run &quot;[&apos;Tools/Scripts/check-webkit-style&apos;, &apos;--diff-files&apos;]&quot; exit_code: 1

Total errors found: 0 in 0 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361071</commentid>
    <comment_count>3</comment_count>
      <attachid>76036</attachid>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-03-02 14:18:52 -0800</bug_when>
    <thetext>Comment on attachment 76036
Ignore HttpError when the HTTP status code is 200 and at least some data was received

This is a bad idea. If a page has status 200, and the network is disconnected in the middle of the load, the frame will report loadFinished as if everything was find.

And this patch is without test and changelog :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361386</commentid>
    <comment_count>4</comment_count>
    <who name="Thomas Thrainer">thomas.thrainer</who>
    <bug_when>2011-03-02 23:35:02 -0800</bug_when>
    <thetext>Actually, this patch was not really meant to be included, but rather as illustration for the problem and a (possible) solution for it. I don&apos;t think that I have enough knowledge about the WebKit codebase such that I can really propose a real solution for the problem...

I guess I have misunderstood the patch submission and review process in this bugzilla tough :-).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361461</commentid>
    <comment_count>5</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-03-03 02:23:56 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I guess I have misunderstood the patch submission and review process in this bugzilla tough :-).

Ok, no problem.
You had set the r? flags, this request review for landing the patch in WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>423842</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2011-06-20 12:15:13 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 58727 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76036</attachid>
            <date>2010-12-09 03:14:30 -0800</date>
            <delta_ts>2011-03-02 14:18:52 -0800</delta_ts>
            <desc>Ignore HttpError when the HTTP status code is 200 and at least some data was received</desc>
            <filename>0008_tiitoo_show_incomplete_pages.patch</filename>
            <type>text/plain</type>
            <size>509</size>
            <attacher name="Thomas Thrainer">thomas.thrainer</attacher>
            
              <data encoding="base64">LS0tIGEvV2ViQ29yZS9wbGF0Zm9ybS9uZXR3b3JrL3F0L1FOZXR3b3JrUmVwbHlIYW5kbGVyLmNw
cAkyMDEwLTEyLTAyIDA5OjI1OjU5Ljk5NDc0NDAwMSArMDEwMAorKysgYi9XZWJDb3JlL3BsYXRm
b3JtL25ldHdvcmsvcXQvUU5ldHdvcmtSZXBseUhhbmRsZXIuY3BwCTIwMTAtMTItMDkgMTE6NTA6
MDkuMDM0NTMwOTk4ICswMTAwCkBAIC0yMjksNyArMjI5LDcgQEAKICAgICBpZiAoaHR0cFN0YXR1
c0NvZGUgPT0gNDAxIHx8IGh0dHBTdGF0dXNDb2RlID09IDQwNykKICAgICAgICAgcmV0dXJuIHRy
dWU7CiAKLSAgICBpZiAocmVjZWl2ZWREYXRhICYmIChodHRwU3RhdHVzQ29kZSA+PSA0MDAgJiYg
aHR0cFN0YXR1c0NvZGUgPCA2MDApKQorICAgIGlmIChyZWNlaXZlZERhdGEgJiYgKChodHRwU3Rh
dHVzQ29kZSA+PSA0MDAgJiYgaHR0cFN0YXR1c0NvZGUgPCA2MDApIHx8IGh0dHBTdGF0dXNDb2Rl
ID09IDIwMCkpCiAgICAgICAgIHJldHVybiB0cnVlOwogCiAgICAgcmV0dXJuIGZhbHNlOwo=
</data>
<flag name="review"
          id="70510"
          type_id="1"
          status="-"
          setter="benjamin"
    />
          </attachment>
      

    </bug>

</bugzilla>