disable_webdav_ntlp_3.4.2.patch

来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· PATCH 代码 · 共 395 行

PATCH
395
字号
--- http.h.orig	2005-02-16 15:17:49.000000000 +0100+++ http.h	2005-04-11 15:30:33.884380295 +0200@@ -58,7 +58,11 @@ public:   enum HTTP_REV    {HTTP_None, HTTP_Unknown, HTTP_10, HTTP_11, SHOUTCAST};    /** Authorization method used **/-  enum HTTP_AUTH   {AUTH_None, AUTH_Basic, AUTH_NTLM, AUTH_Digest, AUTH_Negotiate};+  enum HTTP_AUTH   {AUTH_None, AUTH_Basic, +#ifndef KONQ_EMBEDDED+	  AUTH_NTLM, +#endif+	  AUTH_Digest, AUTH_Negotiate};    /** HTTP / DAV method **/   // Removed to interfaces/kio/http.h@@ -193,6 +197,7 @@ public:   virtual void put( const KURL& url, int _mode, bool _overwrite,                     bool _resume ); +#ifndef QT_NO_DOM //----------------- Re-implemented methods for WebDAV -----------   virtual void listDir( const KURL& url );   virtual void mkdir( const KURL& url, int _permissions );@@ -218,6 +223,7 @@ public:   // Handle error conditions   QString davError( int code = -1, QString url = QString::null ); //---------------------------- End WebDAV -----------------------+#endif    /**    * Special commands supported by this slave :@@ -438,7 +444,9 @@ protected:   /**    * Creates the entity-header for NTLM authentication.    */+#ifndef KONQ_EMBEDDED   QString createNTLMAuth( bool isForProxy = false );+#endif    /**    * Creates the entity-header for Negotiate authentication.@@ -506,12 +514,14 @@ protected:     //--- WebDAV+#ifndef QT_NO_DOM   // Data structure to hold data which will be passed to an internal func.   QByteArray m_bufWebDavData;   QStringList m_davCapabilities;    bool m_davHostOk;   bool m_davHostUnsupported;+#endif //----------    // Holds the POST data so it won't get lost on if we--- http.cc.orig	2005-06-28 19:18:53.000000000 +0200+++ http.cc	2005-08-12 15:05:25.000000000 +0200@@ -84,15 +84,17 @@  #endif /* HAVE_LIBGSSAPI */ +#ifndef KONQ_EMBEDDED #include <misc/kntlm/kntlm.h>+#endif  using namespace KIO;  extern "C" {-  KDE_EXPORT int kdemain(int argc, char **argv);+  KDE_EXPORT int http_kdemain(int argc, char **argv); } -int kdemain( int argc, char **argv )+int http_kdemain( int argc, char **argv ) {   KLocale::setMainCatalogue("kdelibs");   KInstance instance( "kio_http" );@@ -397,9 +399,11 @@ void HTTPProtocol::resetSessionSettings( void HTTPProtocol::setHost( const QString& host, int port,                             const QString& user, const QString& pass ) {+#if !defined(QT_NO_DOM)   // Reset the webdav-capable flags for this host   if ( m_request.hostname != host )     m_davHostOk = m_davHostUnsupported = false;+#endif    // is it an IPv6 address?   if (host.find(':') == -1)@@ -606,9 +610,12 @@ void HTTPProtocol::stat(const KURL& url)     return;   } +#if !defined(QT_NO_DOM)   davStatList( url );+#endif } +#if !defined(QT_NO_DOM) void HTTPProtocol::listDir( const KURL& url ) {   kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::listDir " << url.url()@@ -786,6 +793,7 @@ void HTTPProtocol::davGeneric( const KUR    retrieveContent( false ); }+#endif  int HTTPProtocol::codeFromResponse( const QString& response ) {@@ -794,6 +802,7 @@ int HTTPProtocol::codeFromResponse( cons   return response.mid( firstSpace + 1, secondSpace - firstSpace - 1 ).toInt(); } +#if !defined(QT_NO_DOM) void HTTPProtocol::davParsePropstats( const QDomNodeList& propstats, UDSEntry& entry ) {   QString mimeType;@@ -1034,6 +1043,7 @@ void HTTPProtocol::davParseActiveLocks(      }   } }+#endif  long HTTPProtocol::parseDateTime( const QString& input, const QString& type ) {@@ -1054,6 +1064,7 @@ long HTTPProtocol::parseDateTime( const    return KRFCDate::parseDateISO8601( input ); } +#if !defined(QT_NO_DOM) QString HTTPProtocol::davProcessLocks() {   if ( hasMetaData( "davLockCount" ) )@@ -1186,6 +1197,7 @@ void HTTPProtocol::mkdir( const KURL& ur   else     davError(); }+#endif  void HTTPProtocol::get( const KURL& url ) {@@ -1242,6 +1254,7 @@ void HTTPProtocol::put( const KURL &url,     httpError(); } +#if !defined(QT_NO_DOM) void HTTPProtocol::copy( const KURL& src, const KURL& dest, int, bool overwrite ) {   kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::copy " << src.prettyURL()@@ -1328,6 +1341,7 @@ void HTTPProtocol::del( const KURL& url,   else     davError(); }+#endif  void HTTPProtocol::post( const KURL& url ) {@@ -1346,6 +1360,7 @@ void HTTPProtocol::post( const KURL& url   retrieveContent(); } +#if !defined(QT_NO_DOM) void HTTPProtocol::davLock( const KURL& url, const QString& scope,                             const QString& type, const QString& owner ) {@@ -1634,6 +1649,7 @@ QString HTTPProtocol::davError( int code    return errorString; }+#endif  void HTTPProtocol::httpError() {@@ -2188,6 +2204,7 @@ bool HTTPProtocol::httpOpen()         header = "OPTIONS ";         m_request.bCachedWrite = false; // Do not put any result in the cache         break;+#if !defined(QT_NO_DOM)     case DAV_PROPFIND:         header = "PROPFIND ";         davData = true;@@ -2265,6 +2282,7 @@ bool HTTPProtocol::httpOpen()         header = "POLL ";         m_request.bCachedWrite = false;         break;+#endif     default:         error (ERR_UNSUPPORTED_ACTION, QString::null);         return false;@@ -2426,11 +2444,19 @@ bool HTTPProtocol::httpOpen()         info.username = m_request.user;       if ( checkCachedAuthentication( info ) && !info.digestInfo.isEmpty() )       {-        Authentication = info.digestInfo.startsWith("Basic") ? AUTH_Basic : info.digestInfo.startsWith("NTLM") ? AUTH_NTLM : info.digestInfo.startsWith("Negotiate") ? AUTH_Negotiate : AUTH_Digest ;+        Authentication = info.digestInfo.startsWith("Basic") ? AUTH_Basic : +#ifndef KONQ_EMBEDDED+		info.digestInfo.startsWith("NTLM") ? AUTH_NTLM : +#endif+		info.digestInfo.startsWith("Negotiate") ? AUTH_Negotiate : AUTH_Digest ;         m_state.user   = info.username;         m_state.passwd = info.password;         m_strRealm = info.realmValue;+#ifndef KONQ_EMBEDDED         if ( Authentication != AUTH_NTLM && Authentication != AUTH_Negotiate ) // don't use the cached challenge+#else+        if ( Authentication != AUTH_Negotiate ) // don't use the cached challenge+#endif           m_strAuthorization = info.digestInfo;       }     }@@ -2452,9 +2478,11 @@ bool HTTPProtocol::httpOpen()           header += createNegotiateAuth();           break; #endif+#ifndef KONQ_EMBEDDED       case AUTH_NTLM:           header += createNTLMAuth();           break;+#endif       case AUTH_None:       default:           break;@@ -2475,7 +2503,7 @@ bool HTTPProtocol::httpOpen()     // Do we need to authorize to the proxy server ?     if ( m_state.doProxy && !m_bIsTunneled )       header += proxyAuthenticationHeader();-+#if !defined(QT_NO_DOM)     if ( m_protocol == "webdav" || m_protocol == "webdavs" )     {       header += davProcessLocks();@@ -2493,6 +2521,7 @@ bool HTTPProtocol::httpOpen()       if ( !davHeader.isNull() )         header += davHeader;     }+#endif   }    kdDebug(7103) << "(" << m_pid << ") ============ Sending Header:" << endl;@@ -3278,6 +3307,7 @@ bool HTTPProtocol::readHeader()         m_sContentMD5 = QString::fromLatin1(trimLead(buf + 12));       } +#if !defined(QT_NO_DOM)       // *** Responses to the HTTP OPTIONS method follow       // WebDAV capabilities       else if (strncasecmp(buf, "DAV:", 4) == 0) {@@ -3288,6 +3318,7 @@ bool HTTPProtocol::readHeader()           m_davCapabilities << QString::fromLatin1(trimLead(buf + 4));         }       }+#endif       // *** Responses to the HTTP OPTIONS method finished     }     else if ((httpRev == HTTP_None) && (strlen(buf) != 0))@@ -3457,6 +3488,7 @@ bool HTTPProtocol::readHeader()     {         if ( getAuthorization() )         {+#ifndef KONQ_EMBEDDED            // for NTLM Authentication we have to keep the connection open!            if ( Authentication == AUTH_NTLM && m_strAuthorization.length() > 4 )             {@@ -3468,6 +3500,7 @@ bool HTTPProtocol::readHeader()             readBody( true );            }            else+#endif              httpCloseConnection();            return false; // Try again.         }@@ -3931,6 +3964,7 @@ void HTTPProtocol::special( const QByteA       cacheUpdate( url, no_cache, expireDate );       break;     }+#if !defined(QT_NO_DOM)     case 5: // WebDAV lock     {       KURL url;@@ -3954,6 +3988,7 @@ void HTTPProtocol::special( const QByteA       davGeneric( url, (KIO::HTTP_METHOD) method );       break;     }+#endif     case 99: // Close Connection     {       httpCloseConnection();@@ -4157,9 +4192,11 @@ void HTTPProtocol::slotData(const QByteA    }    else    {+#if !defined(QT_NO_DOM)       uint old_size = m_bufWebDavData.size();       m_bufWebDavData.resize (old_size + d.size());       memcpy (m_bufWebDavData.data() + old_size, d.data(), d.size());+#endif    } } @@ -4184,8 +4221,10 @@ bool HTTPProtocol::readBody( bool dataIn   //    corresponding functions.   // This is used for returning data to WebDAV.   m_dataInternal = dataInternal;+#if !defined(QT_NO_DOM)   if ( dataInternal )     m_bufWebDavData.resize (0);+#endif    // Check if we need to decode the data.   // If we are in copy mode, then use only transfer decoding.@@ -4887,6 +4926,7 @@ void HTTPProtocol::configAuth( char *p,      };   } #endif+#ifndef KONQ_EMBEDDED   else if ( strncasecmp( p, "NTLM", 4 ) == 0 &&      (( b && m_bPersistentProxyConnection ) || !b ) )   {@@ -4895,6 +4935,7 @@ void HTTPProtocol::configAuth( char *p,      p += 4;     m_strRealm = "NTLM"; // set a dummy realm   }+#endif   else   {     kdWarning(7113) << "(" << m_pid << ") Unsupported or invalid authorization "@@ -5096,6 +5137,7 @@ bool HTTPProtocol::getAuthorization()       }     } +#ifndef KONQ_EMBEDDED     if ( Authentication == AUTH_NTLM || ProxyAuthentication == AUTH_NTLM )     {       QString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization;@@ -5122,6 +5164,7 @@ bool HTTPProtocol::getAuthorization()         }       }     }+#endif      if ( prompt )     {@@ -5417,6 +5460,7 @@ QString HTTPProtocol::createNegotiateAut } #endif +#ifndef KONQ_EMBEDDED QString HTTPProtocol::createNTLMAuth( bool isForProxy ) {   uint len;@@ -5472,6 +5516,7 @@ QString HTTPProtocol::createNTLMAuth( bo    return auth; }+#endif  QString HTTPProtocol::createBasicAuth( bool isForProxy ) {@@ -5868,8 +5913,10 @@ QString HTTPProtocol::proxyAuthenticatio         ProxyAuthentication = AUTH_None;       else if( m_strProxyAuthorization.startsWith("Basic") )         ProxyAuthentication = AUTH_Basic;+#ifndef KONQ_EMBEDDED       else if( m_strProxyAuthorization.startsWith("NTLM") )         ProxyAuthentication = AUTH_NTLM;+#endif       else         ProxyAuthentication = AUTH_Digest;     }@@ -5883,8 +5930,10 @@ QString HTTPProtocol::proxyAuthenticatio         m_strProxyAuthorization = info.digestInfo;         if( m_strProxyAuthorization.startsWith("Basic") )           ProxyAuthentication = AUTH_Basic;+#ifndef KONQ_EMBEDDED         else if( m_strProxyAuthorization.startsWith("NTLM") )           ProxyAuthentication = AUTH_NTLM;+#endif         else           ProxyAuthentication = AUTH_Digest;       }@@ -5915,9 +5964,11 @@ QString HTTPProtocol::proxyAuthenticatio     case AUTH_Digest:       header += createDigestAuth( true );       break;+#ifndef KONQ_EMBEDDED     case AUTH_NTLM:       if ( m_bFirstRequest ) header += createNTLMAuth( true );       break;+#endif     case AUTH_None:     default:       break;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?