rpms/kdelibs/F-9 kdelibs-4.2.2-kio_http.patch, NONE, 1.1 kdelibs.spec, 1.386, 1.387

Than Ngo than at fedoraproject.org
Tue Apr 7 10:28:32 UTC 2009


Author: than

Update of /cvs/extras/rpms/kdelibs/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9745

Modified Files:
	kdelibs.spec 
Added Files:
	kdelibs-4.2.2-kio_http.patch 
Log Message:
upstream patch to fix kio_http issue



kdelibs-4.2.2-kio_http.patch:

--- NEW FILE kdelibs-4.2.2-kio_http.patch ---
Index: kioslave/http/http.cpp
===================================================================
--- kioslave/http/http.cpp	(Revision 950464)
+++ kioslave/http/http.cpp	(Revision 950465)
@@ -229,16 +229,12 @@
 }
 
 
+#define NO_SIZE ((KIO::filesize_t) -1)
 
-
-
-
-#define NO_SIZE		((KIO::filesize_t) -1)
-
 #ifdef HAVE_STRTOLL
-#define STRTOLL	strtoll
+#define STRTOLL strtoll
 #else
-#define STRTOLL	strtol
+#define STRTOLL strtol
 #endif
 
 
@@ -259,6 +255,7 @@
     , m_proxyAuth(0)
     , m_socketProxyAuth(0)
     , m_isError(false)
+    , m_isLoadingErrorPage(false)
     , m_remoteRespTimeout(DEFAULT_RESPONSE_TIMEOUT)
 {
     reparseConfiguration();
@@ -292,6 +289,7 @@
 {
   m_isEOF = false;
   m_isError = false;
+  m_isLoadingErrorPage = false;
 }
 
 void HTTPProtocol::resetResponseParsing()
@@ -575,8 +573,11 @@
               m_server.initFrom(m_request);
           }
           break;
-      } else if (m_isError) {
-          // Hard error, abort everything.
+      } else if (m_isError || m_isLoadingErrorPage) {
+          // Unrecoverable error, abort everything.
+          // Also, if we've just loaded an error page there is nothing more to do.
+          // In that case we abort to avoid loops; some webservers manage to send 401 and
+          // no authentication request. Or an auth request we don't understand.
           return false;
       }
 
@@ -1728,6 +1729,15 @@
   error( ERR_SLAVE_DEFINED, errorString );
 }
 
+void HTTPProtocol::setLoadingErrorPage()
+{
+    if (m_isLoadingErrorPage) {
+        kWarning(7113) << "called twice during one request, something is probably wrong.";
+    }
+    m_isLoadingErrorPage = true;
+    SlaveBase::errorPage();
+}
+
 bool HTTPProtocol::isOffline(const KUrl &url)
 {
   const int NetWorkStatusUnknown = 1;
@@ -2720,7 +2730,7 @@
             ; // Ignore error
         } else {
             if (m_request.preferErrorPage) {
-                errorPage();
+                setLoadingErrorPage();
             } else {
                 error(ERR_INTERNAL_SERVER, m_request.url.url());
                 return false;
@@ -2743,7 +2753,7 @@
         // Any other client errors
         // Tell that we will only get an error page here.
         if (m_request.preferErrorPage) {
-            errorPage();
+            setLoadingErrorPage();
         } else {
             error(ERR_DOES_NOT_EXIST, m_request.url.url());
             return false;
@@ -3303,14 +3313,14 @@
         kDebug(7113) << "pointer to auth class is now" << *auth;
         if (!(*auth)) {
             if (m_request.preferErrorPage) {
-                errorPage();
+                setLoadingErrorPage();
             } else {
                 error(ERR_UNSUPPORTED_ACTION, "Unknown Authorization method!");
                 return false;
             }
         }
 
-        // auth may still be null due to errorPage().
+        // *auth may still be null due to setLoadingErrorPage().
 
         if (*auth) {
             // remove trailing space from the method string, or digest auth will fail
@@ -3357,7 +3367,7 @@
 
             if ((*auth)->isError()) {
                 if (m_request.preferErrorPage) {
-                    errorPage();
+                    setLoadingErrorPage();
                 } else {
                     error(ERR_UNSUPPORTED_ACTION, "Authorization failed!");
                     return false;
Index: kioslave/http/http.h
===================================================================
--- kioslave/http/http.h	(Revision 950464)
+++ kioslave/http/http.h	(Revision 950465)
@@ -259,6 +259,7 @@
   void cacheUpdate( const KUrl &url, bool nocache, time_t expireDate);
 
   void httpError(); // Generate error message based on response code
+  void setLoadingErrorPage(); // Call SlaveBase::errorPage() and remember that we've called it
 
   bool isOffline(const KUrl &url); // Check network status
 
@@ -523,6 +524,8 @@
 
   // Indicates whether there was some connection error.
   bool m_isError;
+  // Whether we are loading an error page (we should close the connection afterwards)
+  bool m_isLoadingErrorPage;
 
   // Values that determine the remote connection timeouts.
   int m_remoteRespTimeout;


Index: kdelibs.spec
===================================================================
RCS file: /cvs/extras/rpms/kdelibs/F-9/kdelibs.spec,v
retrieving revision 1.386
retrieving revision 1.387
diff -u -r1.386 -r1.387
--- kdelibs.spec	1 Apr 2009 17:52:26 -0000	1.386
+++ kdelibs.spec	7 Apr 2009 10:28:02 -0000	1.387
@@ -1,6 +1,6 @@
 Summary: K Desktop Environment 4 - Libraries
 Version: 4.2.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 %if 0%{?fedora} > 8
 Name: kdelibs
@@ -86,6 +86,7 @@
 
 # upstream
 # 4.2 branch
+Patch100: kdelibs-4.2.2-kio_http.patch
 
 # 4.3 branch
 Patch200: kdelibs-4.1.96-AllowExternalPaths.patch
@@ -225,6 +226,7 @@
 
 # upstream patches
 # 4.2
+%patch100 -p0 -b .kio_http
 
 # 4.3
 %patch200 -p1 -b .AllowExternalPaths
@@ -409,6 +411,9 @@
 
 
 %changelog
+* Tue Apr 07 2009 Than Ngo <than at redhat.com> - 4.2.2-2
+- upstream patch to fix kio_http issue
+
 * Wed Apr  1 2009 Lukáš Tinkl <ltinkl at redhat.com> - 4.2.2-1
 - KDE 4.2.2
 




More information about the fedora-extras-commits mailing list