disable_webdav_ntlp_3.4.patch
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· PATCH 代码 · 共 372 行
PATCH
372 行
--- http.cc.orig 2005-04-07 11:19:17.000000000 +0200+++ http.cc 2005-04-11 15:31:17.051630343 +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" );@@ -606,9 +608,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 +791,7 @@ void HTTPProtocol::davGeneric( const KUR retrieveContent( false ); }+#endif int HTTPProtocol::codeFromResponse( const QString& response ) {@@ -794,6 +800,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 +1041,7 @@ void HTTPProtocol::davParseActiveLocks( } } }+#endif long HTTPProtocol::parseDateTime( const QString& input, const QString& type ) {@@ -1054,6 +1062,7 @@ long HTTPProtocol::parseDateTime( const return KRFCDate::parseDateISO8601( input ); } +#if !defined(QT_NO_DOM) QString HTTPProtocol::davProcessLocks() { if ( hasMetaData( "davLockCount" ) )@@ -1186,6 +1195,7 @@ void HTTPProtocol::mkdir( const KURL& ur else davError(); }+#endif void HTTPProtocol::get( const KURL& url ) {@@ -1242,6 +1252,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 +1339,7 @@ void HTTPProtocol::del( const KURL& url, else davError(); }+#endif void HTTPProtocol::post( const KURL& url ) {@@ -1346,6 +1358,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 +1647,7 @@ QString HTTPProtocol::davError( int code return errorString; }+#endif void HTTPProtocol::httpError() {@@ -2184,6 +2198,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;@@ -2261,6 +2276,7 @@ bool HTTPProtocol::httpOpen() header = "POLL "; m_request.bCachedWrite = false; break;+#endif default: error (ERR_UNSUPPORTED_ACTION, QString::null); return false;@@ -2422,11 +2438,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; } }@@ -2448,9 +2472,11 @@ bool HTTPProtocol::httpOpen() header += createNegotiateAuth(); break; #endif+#ifndef KONQ_EMBEDDED case AUTH_NTLM: header += createNTLMAuth(); break;+#endif case AUTH_None: default: break;@@ -2471,7 +2497,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();@@ -2489,6 +2515,7 @@ bool HTTPProtocol::httpOpen() if ( !davHeader.isNull() ) header += davHeader; }+#endif } kdDebug(7103) << "(" << m_pid << ") ============ Sending Header:" << endl;@@ -3274,6 +3301,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) {@@ -3284,6 +3312,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))@@ -3452,6 +3481,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 ) {@@ -3463,6 +3493,7 @@ bool HTTPProtocol::readHeader() readBody( true ); } else+#endif httpCloseConnection(); return false; // Try again. }@@ -3926,6 +3957,7 @@ void HTTPProtocol::special( const QByteA cacheUpdate( url, no_cache, expireDate ); break; }+#if !defined(QT_NO_DOM) case 5: // WebDAV lock { KURL url;@@ -3949,6 +3981,7 @@ void HTTPProtocol::special( const QByteA davGeneric( url, (KIO::HTTP_METHOD) method ); break; }+#endif case 99: // Close Connection { httpCloseConnection();@@ -4152,9 +4185,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 } } @@ -4882,6 +4917,7 @@ void HTTPProtocol::configAuth( char *p, }; } #endif+#ifndef KONQ_EMBEDDED else if ( strncasecmp( p, "NTLM", 4 ) == 0 && (( b && m_bPersistentProxyConnection ) || !b ) ) {@@ -4890,6 +4926,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 "@@ -5091,6 +5128,7 @@ bool HTTPProtocol::getAuthorization() } } +#ifndef KONQ_EMBEDDED if ( Authentication == AUTH_NTLM || ProxyAuthentication == AUTH_NTLM ) { QString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization;@@ -5117,6 +5155,7 @@ bool HTTPProtocol::getAuthorization() } } }+#endif if ( prompt ) {@@ -5412,6 +5451,7 @@ QString HTTPProtocol::createNegotiateAut } #endif +#ifndef KONQ_EMBEDDED QString HTTPProtocol::createNTLMAuth( bool isForProxy ) { uint len;@@ -5467,6 +5507,7 @@ QString HTTPProtocol::createNTLMAuth( bo return auth; }+#endif QString HTTPProtocol::createBasicAuth( bool isForProxy ) {@@ -5863,8 +5904,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; }@@ -5878,8 +5921,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; }@@ -5910,9 +5955,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;--- 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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?