From kfm-devel Sun Dec 01 00:00:56 2002 From: "Dawit A." Date: Sun, 01 Dec 2002 00:00:56 +0000 To: kfm-devel Subject: Re: PATCH: Fix BR# 51185 X-MARC-Message: https://marc.info/?l=kfm-devel&m=103870094201501 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_4EV69zVpcAev5Xq" --Boundary-00=_4EV69zVpcAev5Xq Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Saturday 30 November 2002 18:55, Dawit A. wrote: > Hi, > > The following patch fixes the problem reported by BR# 51185. > Note that it does not deal with the issue of how Content-Location > affects caching as outlined by section 14.14 of RFC 2616. That > requires extra flags and meta-data being sent back to the io-slave. Of course attaching the patch would help a lot. Regards, Dawit A. --Boundary-00=_4EV69zVpcAev5Xq Content-Type: text/x-diff; charset="iso-8859-1"; name="http.cc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="http.cc.diff" Index: http.cc =================================================================== RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v retrieving revision 1.552 diff -u -p -b -B -w -r1.552 http.cc --- http.cc 2002/11/26 21:33:38 1.552 +++ http.cc 2002/11/30 23:48:04 @@ -2735,6 +2735,11 @@ bool HTTPProtocol::readHeader() else if (strncasecmp(buf, "Content-length:", 15) == 0) { m_iSize = STRTOLL(trimLead(buf + 15), 0, 10); } + + else if (strncasecmp(buf, "Content-location:", 17) == 0) { + setMetaData ("content-location", + QString::fromLatin1(trimLead(buf+17)).stripWhiteSpace()); + } // what type of data do we have? else if (strncasecmp(buf, "Content-type:", 13) == 0) { --Boundary-00=_4EV69zVpcAev5Xq Content-Type: text/x-diff; charset="iso-8859-1"; name="khtml.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="khtml.diff" Index: khtml_part.cpp =================================================================== RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v retrieving revision 1.772 diff -u -p -b -B -w -r1.772 khtml_part.cpp --- khtml_part.cpp 2002/11/29 21:51:06 1.772 +++ khtml_part.cpp 2002/11/30 23:48:39 @@ -1110,6 +1110,12 @@ void KHTMLPart::slotData( KIO::Job* kio_ } d->m_bHTTPRefresh = true; } + + // Support Content-Location per section 14.14 of RFC 2616. + QString baseURL = d->m_job->queryMetaData ("content-location"); + if (!baseURL.isEmpty()) + d->m_doc->setBaseURL(d->m_doc->completeURL(baseURL)); + if ( !m_url.isLocalFile() ) { // Support for http last-modified --Boundary-00=_4EV69zVpcAev5Xq--