<?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>22349</bug_id>
          
          <creation_ts>2008-11-18 18:07:12 -0800</creation_ts>
          <short_desc>Loader::Host::didReceiveResponse doesn&apos;t clear the client for 304 redirects</short_desc>
          <delta_ts>2008-11-19 12:46:14 -0800</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brett Wilson (Google)">brettw</reporter>
          <assigned_to name="Brett Wilson (Google)">brettw</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>99266</commentid>
    <comment_count>0</comment_count>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2008-11-18 18:07:12 -0800</bug_when>
    <thetext>When Loader::Host::didReceiveResponse sees a 304 redirect, it magically removes the load from the list of pending loads, since the load is effectively complete (the cached version is good enough). This means the Host doesn&apos;t have a reference to the load that was a 304, but that load is still active.

Under CFNet, didFinishLoading is called immediately after the didReceiveResponse without going back to the message loop. At this time, the Host object (which is the client of the subresource load) is still active and it works OK.

Other platforms&apos; network stack (and this might not even be guaranteed by CFNet) have different timing. On Chromium, our network stack sends the finished loading after you go back to the message loop. This gives a chance for the Host cleaner-uppper to run, which happens on a timer. This can lead to the Host getting deleted before the finished callback is run.

The Host should just clear out the callback when it gets a 304 so there isn&apos;t this inconsistent state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99306</commentid>
    <comment_count>1</comment_count>
      <attachid>25268</attachid>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2008-11-19 08:22:24 -0800</bug_when>
    <thetext>Created attachment 25268
Patch

Patch as we discussed on IRC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99330</commentid>
    <comment_count>2</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2008-11-19 09:54:53 -0800</bug_when>
    <thetext>r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99366</commentid>
    <comment_count>3</comment_count>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2008-11-19 12:46:14 -0800</bug_when>
    <thetext>Fixed in r38601</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>25268</attachid>
            <date>2008-11-19 08:22:24 -0800</date>
            <delta_ts>2008-11-19 09:54:37 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>clearclient.diff</filename>
            <type>text/plain</type>
            <size>1301</size>
            <attacher name="Brett Wilson (Google)">brettw</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
NGMyZGExYi4uZDdjNjdjYiAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNiBAQAorMjAwOC0xMS0xOSAgQnJldHQgV2lsc29u
ICA8YnJldHR3QGNocm9taXVtLm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0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bG9jYWwgY29weQogICAgICAgICAg
ICAgbV9yZXF1ZXN0c0xvYWRpbmcucmVtb3ZlKGxvYWRlcik7CisgICAgICAgICAgICBsb2FkZXIt
PmNsZWFyQ2xpZW50KCk7CiAgICAgICAgICAgICByZXF1ZXN0LT5kb2NMb2FkZXIoKS0+ZGVjcmVt
ZW50UmVxdWVzdENvdW50KCk7CiAKICAgICAgICAgICAgIC8vIEV4aXN0aW5nIHJlc291cmNlIGlz
IG9rLCBqdXN0IHVzZSBpdCB1cGRhdGluZyB0aGUgZXhwaXJhdGlvbiB0aW1lLgo=
</data>
<flag name="review"
          id="11686"
          type_id="1"
          status="+"
          setter="koivisto"
    />
          </attachment>
      

    </bug>

</bugzilla>