disable_webdav_ntlp_3.5.patch
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· PATCH 代码 · 共 338 行
PATCH
338 行
--- http.cc.orig 2006-01-07 02:39:00.000000000 +0100+++ http.cc 2006-01-07 14:50:23.000000000 +0100@@ -87,15 +87,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" );@@ -426,9 +428,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)@@ -635,9 +639,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()@@ -820,6 +827,7 @@ void HTTPProtocol::davGeneric( const KUR retrieveContent( false ); }+#endif int HTTPProtocol::codeFromResponse( const QString& response ) {@@ -828,6 +836,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;@@ -1068,6 +1077,7 @@ void HTTPProtocol::davParseActiveLocks( } } }+#endif long HTTPProtocol::parseDateTime( const QString& input, const QString& type ) {@@ -1088,6 +1098,7 @@ long HTTPProtocol::parseDateTime( const return KRFCDate::parseDateISO8601( input ); } +#if !defined(QT_NO_DOM) QString HTTPProtocol::davProcessLocks() { if ( hasMetaData( "davLockCount" ) )@@ -1220,6 +1231,7 @@ void HTTPProtocol::mkdir( const KURL& ur else davError(); }+#endif void HTTPProtocol::get( const KURL& url ) {@@ -1310,6 +1322,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()@@ -1421,6 +1434,7 @@ void HTTPProtocol::del( const KURL& url, else davError(); }+#endif void HTTPProtocol::post( const KURL& url ) {@@ -1439,6 +1453,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 ) {@@ -1727,6 +1742,7 @@ QString HTTPProtocol::davError( int code return errorString; }+#endif void HTTPProtocol::httpError() {@@ -2279,6 +2295,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;@@ -2356,6 +2373,7 @@ bool HTTPProtocol::httpOpen() header = "POLL "; m_request.bCachedWrite = false; break;+#endif default: error (ERR_UNSUPPORTED_ACTION, QString::null); return false;@@ -2505,11 +2523,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; } }@@ -2531,9 +2557,11 @@ bool HTTPProtocol::httpOpen() header += createNegotiateAuth(); break; #endif+#ifndef KONQ_EMBEDDED case AUTH_NTLM: header += createNTLMAuth(); break;+#endif case AUTH_None: default: break;@@ -2564,6 +2592,7 @@ bool HTTPProtocol::httpOpen() else header += "Connection: close\r\n"; +#if !defined(QT_NO_DOM) if ( m_protocol == "webdav" || m_protocol == "webdavs" ) { header += davProcessLocks();@@ -2581,6 +2610,7 @@ bool HTTPProtocol::httpOpen() if ( !davHeader.isNull() ) header += davHeader; }+#endif } kdDebug(7103) << "(" << m_pid << ") ============ Sending Header:" << endl;@@ -3367,6 +3397,7 @@ try_again: 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) {@@ -3377,6 +3408,7 @@ try_again: m_davCapabilities << QString::fromLatin1(trimLead(buf + 4)); } }+#endif // *** Responses to the HTTP OPTIONS method finished } else if ((httpRev == HTTP_None) && (strlen(buf) != 0))@@ -3546,6 +3578,7 @@ try_again: { if ( getAuthorization() ) {+#ifndef KONQ_EMBEDDED // for NTLM Authentication we have to keep the connection open! if ( Authentication == AUTH_NTLM && m_strAuthorization.length() > 4 ) {@@ -3557,6 +3590,7 @@ try_again: readBody( true ); } else+#endif httpCloseConnection(); return false; // Try again. }@@ -4021,6 +4055,7 @@ void HTTPProtocol::special( const QByteA cacheUpdate( url, no_cache, expireDate ); break; }+#if !defined(QT_NO_DOM) case 5: // WebDAV lock { KURL url;@@ -4044,6 +4079,7 @@ void HTTPProtocol::special( const QByteA davGeneric( url, (KIO::HTTP_METHOD) method ); break; }+#endif case 99: // Close Connection { httpCloseConnection();@@ -4247,9 +4283,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 } } @@ -4274,8 +4312,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.@@ -4979,6 +5019,7 @@ void HTTPProtocol::configAuth( char *p, }; } #endif+#ifndef KONQ_EMBEDDED else if ( strncasecmp( p, "NTLM", 4 ) == 0 ) { f = AUTH_NTLM;@@ -4986,6 +5027,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 "@@ -5187,6 +5229,7 @@ bool HTTPProtocol::getAuthorization() } } +#ifndef KONQ_EMBEDDED if ( Authentication == AUTH_NTLM || ProxyAuthentication == AUTH_NTLM ) { QString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization;@@ -5213,6 +5256,7 @@ bool HTTPProtocol::getAuthorization() } } }+#endif if ( prompt ) {@@ -5508,6 +5552,7 @@ QString HTTPProtocol::createNegotiateAut } #endif +#ifndef KONQ_EMBEDDED QString HTTPProtocol::createNTLMAuth( bool isForProxy ) { uint len;@@ -5565,6 +5610,7 @@ QString HTTPProtocol::createNTLMAuth( bo return auth; }+#endif QString HTTPProtocol::createBasicAuth( bool isForProxy ) {@@ -5961,8 +6007,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; }@@ -5976,8 +6024,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; }@@ -6008,9 +6058,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 + -
显示快捷键?