From 9e650fe93006b281db424c0e8d314b16599bf4aa Mon Sep 17 00:00:00 2001 From: "cbiesinger@gmx.at" Date: Fri, 24 Aug 2007 16:17:07 -0700 Subject: [PATCH] 393622 add logging to HTTP channel resuming code r+sr+a=bz --- netwerk/protocol/http/src/nsHttpChannel.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/netwerk/protocol/http/src/nsHttpChannel.cpp b/netwerk/protocol/http/src/nsHttpChannel.cpp index 5c0a77d8acd..864889157f1 100644 --- a/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -801,6 +801,7 @@ nsHttpChannel::ProcessResponse() // So if a server does that and sends 200 instead of 206 that we // expect, notify our caller. if (mResuming) { + LOG(("Server ignored our Range header, cancelling [this=%p]\n", this)); Cancel(NS_ERROR_NOT_RESUMABLE); rv = CallOnStartRequest(); break; @@ -858,6 +859,8 @@ nsHttpChannel::ProcessResponse() case 412: // Precondition failed case 416: // Invalid range if (mResuming) { + LOG(("Resuming and got %i status, aborting [this=%p]\n", + httpStatus, this)); Cancel(NS_ERROR_ENTITY_CHANGED); rv = CallOnStartRequest(); break; @@ -923,8 +926,11 @@ nsHttpChannel::ProcessNormal() } // If we were passed an entity id, verify it's equal to the server's else if (!mEntityID.IsEmpty()) { - if (!mEntityID.Equals(id)) + if (!mEntityID.Equals(id)) { + LOG(("Entity mismatch, expected '%s', got '%s', aborting [this=%p]", + mEntityID.get(), id.get(), this)); Cancel(NS_ERROR_ENTITY_CHANGED); + } } } @@ -4677,6 +4683,8 @@ NS_IMETHODIMP nsHttpChannel::ResumeAt(PRUint64 aStartPos, const nsACString& aEntityID) { + LOG(("nsHttpChannel::ResumeAt [this=%p startPos=%llu id='%s']\n", + this, aStartPos, PromiseFlatCString(aEntityID).get())); mEntityID = aEntityID; mStartPos = aStartPos; mResuming = PR_TRUE;