[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    KIO::http_post bug fixed
From:       Christian Weilbach <christian_weilbach () web ! de>
Date:       2007-07-22 5:14:04
Message-ID: 200707220714.04912.christian_weilbach () web ! de
[Download RAW message or body]

Hi,

as actually nobody helped me, I've helped myself and have fixed another 
http_post bug. This one is in the http.cpp file and is about header parsing.

As Thiago has pointed out in IRC kDebug( xxxx ) does not work, so I have 
replaced it by kDebug(). Otherwise it will only throw the header, which might 
be o.k., but was to less for me.

The actual bugfix is the part about metaData( "content-length" ), which is not 
checked for its length correctly and therefore may introduce one carriage 
return to much, therefore the "Content-length: xxx" is not regarded as part 
of the header by the server.

Another bug fixed imho is the replacement of isNull() with isEmpty(), actually 
there are many accurances of isNull() in http.cpp, which in my opinion should 
be replaced as much as possible with isEmpty(). Another bug fixed by Antonio 
had the same problem.

Cheers and I hope you can fix it upstream soon,
Christian


["kio_content_length_patch.diff" (text/x-diff)]

Index: http.cpp
===================================================================
--- http.cpp	(Revision 690648)
+++ http.cpp	(Arbeitskopie)
@@ -217,7 +217,7 @@
 
 void HTTPProtocol::reparseConfiguration()
 {
-    kDebug(7113) << "(" << m_pid << ") HTTPProtocol::reparseConfiguration" << endl;
+    kDebug() << "(" << m_pid << ") HTTPProtocol::reparseConfiguration" << endl;
 
     m_strProxyRealm.clear();
     m_strProxyAuthorization.clear();
@@ -273,13 +273,13 @@
     m_proxyURL = proxy;
     m_bUseProxy = m_proxyURL.isValid();
 
-    kDebug(7113) << "(" << m_pid << ") Using proxy: " << m_bUseProxy <<
+    kDebug() << "(" << m_pid << ") Using proxy: " << m_bUseProxy <<
                                               " URL: " << m_proxyURL.url() <<
                                             " Realm: " << m_strProxyRealm << endl;
   }
 
   m_bPersistentProxyConnection = config()->readEntry("PersistentProxyConnection", \
                false);
-  kDebug(7113) << "(" << m_pid << ") Enable Persistent Proxy Connection: "
+  kDebug() << "(" << m_pid << ") Enable Persistent Proxy Connection: "
                 << m_bPersistentProxyConnection << endl;
 
   m_request.bUseCookiejar = config()->readEntry("Cookies", false);
@@ -290,8 +290,8 @@
   m_maxCacheAge = config()->readEntry("MaxCacheAge", DEFAULT_MAX_CACHE_AGE);
   m_request.window = config()->readEntry("window-id");
 
-  kDebug(7113) << "(" << m_pid << ") Window Id = " << m_request.window << endl;
-  kDebug(7113) << "(" << m_pid << ") ssl_was_in_use = "
+  kDebug() << "(" << m_pid << ") Window Id = " << m_request.window << endl;
+  kDebug() << "(" << m_pid << ") ssl_was_in_use = "
                 << metaData ("ssl_was_in_use") << endl;
 
   m_request.referrer.clear();
@@ -364,7 +364,7 @@
   {
     m_bNeedTunnel = true;
     setRealHost( m_request.hostname );
-    kDebug(7113) << "(" << m_pid << ") SSL tunnel: Setting real hostname to: "
+    kDebug() << "(" << m_pid << ") SSL tunnel: Setting real hostname to: "
                   << m_request.hostname << endl;
   }
   else
@@ -438,7 +438,7 @@
 
   m_bIsTunneled = false;
 
-  kDebug(7113) << "(" << m_pid << ") Hostname is now: " << m_request.hostname <<
+  kDebug() << "(" << m_pid << ") Hostname is now: " << m_request.hostname <<
     " (" << m_request.encoded_hostname << ")" <<endl;
 }
 
@@ -521,7 +521,7 @@
 
       if (m_bIsTunneled)
       {
-        kDebug(7113) << "(" << m_pid << ") Re-establishing SSL tunnel..." << endl;
+        kDebug() << "(" << m_pid << ") Re-establishing SSL tunnel..." << endl;
         httpCloseConnection();
       }
     }
@@ -529,9 +529,9 @@
     {
       // Do not save authorization if the current response code is
       // 4xx (client error) or 5xx (server error).
-      kDebug(7113) << "(" << m_pid << ") Previous Response: "
+      kDebug() << "(" << m_pid << ") Previous Response: "
                     << m_prevResponseCode << endl;
-      kDebug(7113) << "(" << m_pid << ") Current Response: "
+      kDebug() << "(" << m_pid << ") Current Response: "
                     << m_responseCode << endl;
 
       if (isSSLTunnelEnabled() && usingSSL() && !m_bUnauthorized && !m_bError)
@@ -539,7 +539,7 @@
         // If there is no error, disable tunneling
         if ( m_responseCode < 400 )
         {
-          kDebug(7113) << "(" << m_pid << ") Unset tunneling flag!" << endl;
+          kDebug() << "(" << m_pid << ") Unset tunneling flag!" << endl;
           setEnableSSLTunnel( false );
           m_bIsTunneled = true;
           // Reset the CONNECT response code...
@@ -550,12 +550,12 @@
         {
           if ( !m_request.bErrorPage )
           {
-            kDebug(7113) << "(" << m_pid << ") Sending an error message!" << endl;
+            kDebug() << "(" << m_pid << ") Sending an error message!" << endl;
             error( ERR_UNKNOWN_PROXY_HOST, m_proxyURL.host() );
             return false;
           }
 
-          kDebug(7113) << "(" << m_pid << ") Sending an error page!" << endl;
+          kDebug() << "(" << m_pid << ") Sending an error page!" << endl;
         }
       }
 
@@ -570,7 +570,7 @@
   if (!m_bufPOST.isEmpty())
   {
     m_bufPOST.resize(0);
-    kDebug(7113) << "(" << m_pid << ") HTTP::retrieveHeader: Cleared POST "
+    kDebug() << "(" << m_pid << ") HTTP::retrieveHeader: Cleared POST "
                      "buffer..." << endl;
   }
 
@@ -585,7 +585,7 @@
 
 void HTTPProtocol::stat(const KUrl& url)
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::stat " << url.prettyUrl()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::stat " << url.prettyUrl()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -617,7 +617,7 @@
 
 void HTTPProtocol::listDir( const KUrl& url )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::listDir " << url.url()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::listDir " << url.url()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -757,7 +757,7 @@
     }
     else
     {
-      kDebug(7113) << "Error: no URL contained in response to PROPFIND on "
+      kDebug() << "Error: no URL contained in response to PROPFIND on "
                     << url.prettyUrl() << endl;
     }
   }
@@ -775,7 +775,7 @@
 
 void HTTPProtocol::davGeneric( const KUrl& url, KIO::HTTP_METHOD method )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::davGeneric " << url.url()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::davGeneric " << url.url()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -817,7 +817,7 @@
     if ( status.isNull() )
     {
       // error, no status code in this propstat
-      kDebug(7113) << "Error, no status code in this propstat" << endl;
+      kDebug() << "Error, no status code in this propstat" << endl;
       return;
     }
 
@@ -825,14 +825,14 @@
 
     if ( code != 200 )
     {
-      kDebug(7113) << "Warning: status code " << code << " (this may mean that some \
properties are unavailable" << endl; +      kDebug() << "Warning: status code " << \
code << " (this may mean that some properties are unavailable" << endl;  continue;
     }
 
     QDomElement prop = propstat.namedItem( "prop" ).toElement();
     if ( prop.isNull() )
     {
-      kDebug(7113) << "Error: no prop segment in this propstat." << endl;
+      kDebug() << "Error: no prop segment in this propstat." << endl;
       return;
     }
 
@@ -953,7 +953,7 @@
       }
       else
       {
-        kDebug(7113) << "Found unknown webdav property: " << property.tagName() << \
endl; +        kDebug() << "Found unknown webdav property: " << property.tagName() << \
endl;  }
     }
   }
@@ -1100,12 +1100,12 @@
   // cached?
   if ( m_davHostOk )
   {
-    kDebug(7113) << "(" << m_pid << ") " << k_funcinfo << " true" << endl;
+    kDebug() << "(" << m_pid << ") " << k_funcinfo << " true" << endl;
     return true;
   }
   else if ( m_davHostUnsupported )
   {
-    kDebug(7113) << "(" << m_pid << ") " << k_funcinfo << " false" << endl;
+    kDebug() << "(" << m_pid << ") " << k_funcinfo << " false" << endl;
     davError( -2 );
     return false;
   }
@@ -1132,7 +1132,7 @@
       if (ok && verNo > 0 && verNo < 3)
       {
         m_davHostOk = true;
-        kDebug(7113) << "Server supports DAV version " << verNo << "." << endl;
+        kDebug() << "Server supports DAV version " << verNo << "." << endl;
       }
     }
 
@@ -1156,7 +1156,7 @@
 
 void HTTPProtocol::mkdir( const KUrl& url, int )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::mkdir " << url.url()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::mkdir " << url.url()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1178,7 +1178,7 @@
 
 void HTTPProtocol::get( const KUrl& url )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::get " << url.url()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::get " << url.url()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1203,7 +1203,7 @@
 
 void HTTPProtocol::put( const KUrl &url, int, bool overwrite, bool)
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::put " << url.prettyUrl()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::put " << url.prettyUrl()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1250,11 +1250,11 @@
 
   retrieveHeader( false );
 
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::put error = " << m_bError << \
endl; +  kDebug() << "(" << m_pid << ") HTTPProtocol::put error = " << m_bError << \
endl;  if (m_bError)
     return;
 
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::put responseCode = " << \
m_responseCode << endl; +  kDebug() << "(" << m_pid << ") HTTPProtocol::put \
responseCode = " << m_responseCode << endl;  
   httpClose(false); // Always close connection.
 
@@ -1266,7 +1266,7 @@
 
 void HTTPProtocol::copy( const KUrl& src, const KUrl& dest, int, bool overwrite )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::copy " << src.prettyUrl()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::copy " << src.prettyUrl()
                 << " -> " << dest.prettyUrl() << endl;
 
   if ( !checkRequestUrl( dest ) || !checkRequestUrl( src ) )
@@ -1298,7 +1298,7 @@
 
 void HTTPProtocol::rename( const KUrl& src, const KUrl& dest, bool overwrite )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::rename " << src.prettyUrl()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::rename " << src.prettyUrl()
                 << " -> " << dest.prettyUrl() << endl;
 
   if ( !checkRequestUrl( dest ) || !checkRequestUrl( src ) )
@@ -1329,7 +1329,7 @@
 
 void HTTPProtocol::del( const KUrl& url, bool )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::del " << url.prettyUrl()
+  kDebug() << "(" << m_pid << ") HTTPProtocol::del " << url.prettyUrl()
                 << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1353,7 +1353,7 @@
 
 void HTTPProtocol::post( const KUrl& url )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::post "
+  kDebug() << "(" << m_pid << ") HTTPProtocol::post "
                 << url.prettyUrl() << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1371,7 +1371,7 @@
 void HTTPProtocol::davLock( const KUrl& url, const QString& scope,
                             const QString& type, const QString& owner )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::davLock "
+  kDebug() << "(" << m_pid << ") HTTPProtocol::davLock "
                 << url.prettyUrl() << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1436,7 +1436,7 @@
 
 void HTTPProtocol::davUnlock( const KUrl& url )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::davUnlock "
+  kDebug() << "(" << m_pid << ") HTTPProtocol::davUnlock "
                 << url.prettyUrl() << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -1732,10 +1732,10 @@
   if ( reply.isValid() )
   {
      int result = reply;
-     kDebug(7113) << "(" << m_pid << ") networkstatus status = " << result << endl;
+     kDebug() << "(" << m_pid << ") networkstatus status = " << result << endl;
      return (result != NetWorkStatusUnknown) && (result != NetWorkStatusOnline);
   }
-  kDebug(7113) << "(" << m_pid << ") networkstatus <unreachable>" << endl;
+  kDebug() << "(" << m_pid << ") networkstatus <unreachable>" << endl;
   return false; // On error, assume we are online
 }
 
@@ -1745,7 +1745,7 @@
   quint32 n;
   stream >> n;
 
-  kDebug(7113) << "(" << m_pid << ") HTTPProtcool::multiGet n = " << n << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtcool::multiGet n = " << n << endl;
 
   HTTPRequest saveRequest;
   if (m_bBusy)
@@ -1760,7 +1760,7 @@
      if ( !checkRequestUrl( url ) )
         continue;
 
-     kDebug(7113) << "(" << m_pid << ") HTTPProtocol::multi_get " << url.url() << \
endl; +     kDebug() << "(" << m_pid << ") HTTPProtocol::multi_get " << url.url() << \
endl;  
      m_request.method = HTTP_GET;
      m_request.path = url.path();
@@ -1924,7 +1924,7 @@
 
 void HTTPProtocol::httpCheckConnection()
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpCheckConnection: " <<
+  kDebug() << "(" << m_pid << ") HTTPProtocol::httpCheckConnection: " <<
 //                                   " Socket status: " << m_iSock <<
                                       " Keep Alive: " << m_bKeepAlive <<
                                            " First: " << m_bFirstRequest << endl;
@@ -1934,7 +1934,7 @@
      bool closeDown = false;
      if ( !isConnectionValid())
      {
-        kDebug(7113) << "(" << m_pid << ") Connection lost!" << endl;
+        kDebug() << "(" << m_pid << ") Connection lost!" << endl;
         closeDown = true;
      }
      else if ( m_request.method != HTTP_GET )
@@ -1974,7 +1974,7 @@
   int errCode;
   QString errMsg;
 
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpOpenConnection" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::httpOpenConnection" << endl;
 
   setBlockConnection( true );
 
@@ -1983,7 +1983,7 @@
     QString proxy_host = m_proxyURL.host();
     int proxy_port = m_proxyURL.port();
 
-    kDebug(7113) << "(" << m_pid << ") Connecting to proxy server: "
+    kDebug() << "(" << m_pid << ") Connecting to proxy server: "
                   << proxy_host << ", port: " << proxy_port << endl;
 
     infoMessage( i18n("Connecting to %1...", m_state.hostname) );
@@ -2085,7 +2085,7 @@
  */
 bool HTTPProtocol::httpOpen()
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpOpen" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::httpOpen" << endl;
 
   // Cannot have an https request without the m_bIsSSL being set!  This can
   // only happen if TCPSlaveBase::InitializeSSL() function failed in which it
@@ -2218,7 +2218,7 @@
         davHeader = "Depth: ";
         if ( hasMetaData( "davDepth" ) )
         {
-          kDebug(7113) << "Reading DAV depth from metadata: " << metaData( \
"davDepth" ) << endl; +          kDebug() << "Reading DAV depth from metadata: " << \
metaData( "davDepth" ) << endl;  davHeader += metaData( "davDepth" );
         }
         else
@@ -2354,7 +2354,7 @@
     if ( m_request.offset > 0 )
     {
       header += QString("Range: bytes=%1-\r\n").arg(KIO::number(m_request.offset));
-      kDebug(7103) << "kio_http : Range = " << KIO::number(m_request.offset) << \
endl; +      kDebug() << "kio_http : Range = " << KIO::number(m_request.offset) << \
endl;  }
 
     if ( m_request.cache == CC_Reload )
@@ -2428,9 +2428,10 @@
       header += "\r\n";
     }
 
-    if (m_request.method == HTTP_POST)
+    QString contentType = metaData("content-type");
+    if (m_request.method == HTTP_POST && !contentType.isEmpty() )
     {
-      header += metaData("content-type");
+      header += contentType;
       header += "\r\n";
     }
 
@@ -2439,7 +2440,7 @@
     // no caching for Negotiate auth.
     if ( !m_request.bNoAuth && m_responseCode != 401 && m_responseCode != 407 && \
Authentication != AUTH_Negotiate )  {
-      kDebug(7113) << "(" << m_pid << ") Calling checkCachedAuthentication " << \
endl; +      kDebug() << "(" << m_pid << ") Calling checkCachedAuthentication " << \
endl;  AuthInfo info;
       info.url = m_request.url;
       info.verifyPath = true;
@@ -2457,7 +2458,7 @@
     }
     else
     {
-      kDebug(7113) << "(" << m_pid << ") Not calling checkCachedAuthentication " << \
endl; +      kDebug() << "(" << m_pid << ") Not calling checkCachedAuthentication " \
<< endl;  }
 
     switch ( Authentication )
@@ -2484,13 +2485,13 @@
     /********* Only for debugging purpose *********/
     if ( Authentication != AUTH_None )
     {
-      kDebug(7113) << "(" << m_pid << ") Using Authentication: " << endl;
-      kDebug(7113) << "(" << m_pid << ")   HOST= " << m_state.hostname << endl;
-      kDebug(7113) << "(" << m_pid << ")   PORT= " << m_state.port << endl;
-      kDebug(7113) << "(" << m_pid << ")   USER= " << m_state.user << endl;
-      kDebug(7113) << "(" << m_pid << ")   PASSWORD= [protected]" << endl;
-      kDebug(7113) << "(" << m_pid << ")   REALM= " << m_strRealm << endl;
-      kDebug(7113) << "(" << m_pid << ")   EXTRA= " << m_strAuthorization << endl;
+      kDebug() << "(" << m_pid << ") Using Authentication: " << endl;
+      kDebug() << "(" << m_pid << ")   HOST= " << m_state.hostname << endl;
+      kDebug() << "(" << m_pid << ")   PORT= " << m_state.port << endl;
+      kDebug() << "(" << m_pid << ")   USER= " << m_state.user << endl;
+      kDebug() << "(" << m_pid << ")   PASSWORD= [protected]" << endl;
+      kDebug() << "(" << m_pid << ")   REALM= " << m_strRealm << endl;
+      kDebug() << "(" << m_pid << ")   EXTRA= " << m_strAuthorization << endl;
     }
 
     // Do we need to authorize to the proxy server ?
@@ -2521,16 +2522,16 @@
     }
   }
 
-  kDebug(7103) << "(" << m_pid << ") ============ Sending Header:" << endl;
+  kDebug() << "(" << m_pid << ") ============ Sending Header:" << endl;
 
   QStringList headerOutput = header.split("\r\n", QString::SkipEmptyParts);
   QStringList::Iterator it = headerOutput.begin();
 
   for (; it != headerOutput.end(); ++it)
-    kDebug(7103) << "(" << m_pid << ") " << (*it) << endl;
+    kDebug() << "(" << m_pid << ") " << (*it) << endl;
 
-  if ( !moreData && !davData)
-    header += "\r\n";  /* end header */
+  if ( !moreData && !davData )
+     header += "\r\n";  /* end header */
 
   // Now that we have our formatted header, let's send it!
   // Create a new connection to the remote machine if we do
@@ -2539,7 +2540,7 @@
   {
     if (!httpOpenConnection())
     {
-       kDebug(7113) << "Couldn't connect, oopsie!" << endl;
+       kDebug() << "Couldn't connect, oopsie!" << endl;
        return false;
     }
   }
@@ -2548,7 +2549,7 @@
   bool sendOk = (write(header.toLatin1(), header.length()) == (ssize_t) \
header.length());  if (!sendOk)
   {
-    kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpOpen: "
+    kDebug() << "(" << m_pid << ") HTTPProtocol::httpOpen: "
                      "Connection broken! (" << m_state.hostname << ")" << endl;
 
     // With a Keep-Alive connection this can happen.
@@ -2561,14 +2562,14 @@
 
     if (!sendOk)
     {
-       kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpOpen: sendOk==false."
+       kDebug() << "(" << m_pid << ") HTTPProtocol::httpOpen: sendOk==false."
                         " Connnection broken !" << endl;
        error( ERR_CONNECTION_BROKEN, m_state.hostname );
        return false;
     }
   }
   else
-      kDebug(7113) << "sent it!" << endl;
+      kDebug() << "sent it!" << endl;
 
   bool res = true;
 
@@ -2600,7 +2601,7 @@
 bool HTTPProtocol::readHeader()
 {
 try_again:
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readHeader" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::readHeader" << endl;
 
   // Check
   if (m_request.bCachedRead)
@@ -2611,7 +2612,7 @@
      if (!gzgets(m_request.fcache, buffer, 4096) )
      {
         // Error, delete cache entry
-        kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readHeader: "
+        kDebug() << "(" << m_pid << ") HTTPProtocol::readHeader: "
                       << "Could not access cache to obtain mimetype!" << endl;
         error( ERR_CONNECTION_BROKEN, m_state.hostname );
         return false;
@@ -2619,13 +2620,13 @@
 
      m_strMimeType = QString::fromUtf8( buffer).trimmed();
 
-     kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readHeader: cached "
+     kDebug() << "(" << m_pid << ") HTTPProtocol::readHeader: cached "
                    << "data mimetype: " << m_strMimeType << endl;
 
      if (!gzgets(m_request.fcache, buffer, 4096) )
      {
         // Error, delete cache entry
-        kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readHeader: "
+        kDebug() << "(" << m_pid << ") HTTPProtocol::readHeader: "
                       << "Could not access cached data! " << endl;
         error( ERR_CONNECTION_BROKEN, m_state.hostname );
         return false;
@@ -2682,7 +2683,7 @@
 
   if ( !isConnectionValid() )
   {
-     kDebug(7113) << "HTTPProtocol::readHeader: No connection." << endl;
+     kDebug() << "HTTPProtocol::readHeader: No connection." << endl;
      return false; // Restablish connection and try again
   }
 
@@ -2699,7 +2700,7 @@
 
   if (m_bEOF || *buffer == '\0')
   {
-    kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readHeader: "
+    kDebug() << "(" << m_pid << ") HTTPProtocol::readHeader: "
                   << "EOF while waiting for header start." << endl;
     if (m_bKeepAlive) // Try to reestablish connection.
     {
@@ -2713,18 +2714,18 @@
       // Some web-servers fail to respond properly to a HEAD request.
       // We compensate for their failure to properly implement the HTTP standard
       // by assuming that they will be sending html.
-      kDebug(7113) << "(" << m_pid << ") HTTPPreadHeader: HEAD -> returned "
+      kDebug() << "(" << m_pid << ") HTTPPreadHeader: HEAD -> returned "
                     << "mimetype: " << DEFAULT_MIME_TYPE << endl;
       mimeType(QString::fromLatin1(DEFAULT_MIME_TYPE));
       return true;
     }
 
-    kDebug(7113) << "HTTPProtocol::readHeader: Connection broken !" << endl;
+    kDebug() << "HTTPProtocol::readHeader: Connection broken !" << endl;
     error( ERR_CONNECTION_BROKEN, m_state.hostname );
     return false;
   }
 
-  kDebug(7103) << "(" << m_pid << ") ============ Received Response:"<< endl;
+  kDebug() << "(" << m_pid << ") ============ Received Response:"<< endl;
 
   bool noHeader = true;
   HTTP_REV httpRev = HTTP_None;
@@ -2741,7 +2742,7 @@
     // if there was only a newline then continue
     if (!len)
     {
-      kDebug(7103) << "(" << m_pid << ") --empty--" << endl;
+      kDebug() << "(" << m_pid << ") --empty--" << endl;
       continue;
     }
 
@@ -2753,7 +2754,7 @@
     // top of the reponse...
     noHeader = false;
 
-    kDebug(7103) << "(" << m_pid << ") \"" << buffer << "\"" << endl;
+    kDebug() << "(" << m_pid << ") \"" << buffer << "\"" << endl;
 
     // Save broken servers from damnation!!
     char* buf = buffer;
@@ -2765,7 +2766,7 @@
     {
       // We get XML / HTTP without a proper header
       // put string back
-      kDebug(7103) << "kio_http: No valid HTTP header found! Document starts with \
XML/HTML tag" << endl; +      kDebug() << "kio_http: No valid HTTP header found! \
Document starts with XML/HTML tag" << endl;  
       // Document starts with a tag, assume html instead of text/plain
       m_strMimeType = "text/html";
@@ -3023,7 +3024,7 @@
 
       // Assign the mime-type.
       m_strMimeType = QString::fromLatin1(start, pos-start).trimmed().toLower();
-      kDebug(7113) << "(" << m_pid << ") Content-type: " << m_strMimeType << endl;
+      kDebug() << "(" << m_pid << ") Content-type: " << m_strMimeType << endl;
 
       // If we still have text, then it means we have a mime-type with a
       // parameter (eg: charset=iso-8851) ; so let's get that...
@@ -3212,7 +3213,7 @@
         if( pos > -1 )
           disposition = disposition.mid(pos+1);
 
-        kDebug(7113) << "(" << m_pid << ") Content-Disposition: "
+        kDebug() << "(" << m_pid << ") Content-Disposition: "
                       << disposition<< endl;
       }
     }
@@ -3544,10 +3545,10 @@
        sendMetaData();
     }
 
-    kDebug(7113) << "(" << m_pid << ") request.url: " << m_request.url.url()
+    kDebug() << "(" << m_pid << ") request.url: " << m_request.url.url()
                   << endl << "LocationStr: " << locationStr.data() << endl;
 
-    kDebug(7113) << "(" << m_pid << ") Requesting redirection to: " << u.url()
+    kDebug() << "(" << m_pid << ") Requesting redirection to: " << u.url()
                   << endl;
 
     // If we're redirected to a http:// url, remember that we're doing webdav...
@@ -3688,7 +3689,7 @@
 
   if( !disposition.isEmpty() )
   {
-    kDebug(7113) << "(" << m_pid << ") Setting Content-Disposition metadata to: "
+    kDebug() << "(" << m_pid << ") Setting Content-Disposition metadata to: "
                   << disposition << endl;
     setMetaData("content-disposition", disposition);
   }
@@ -3715,7 +3716,7 @@
   if (locationStr.isEmpty() && (!m_strMimeType.isEmpty() ||
       m_request.method == HTTP_HEAD))
   {
-    kDebug(7113) << "(" << m_pid << ") Emitting mimetype " << m_strMimeType << endl;
+    kDebug() << "(" << m_pid << ") Emitting mimetype " << m_strMimeType << endl;
     mimeType( m_strMimeType );
   }
 
@@ -3735,7 +3736,7 @@
         if (!m_request.fcache)
 	    {
 		m_request.bCachedWrite = false; // Error creating cache entry.
-		kDebug(7113) << "(" << m_pid << ") Error creating cache entry for " << \
m_request.url.url()<<"!\n"; +		kDebug() << "(" << m_pid << ") Error creating cache \
entry for " << m_request.url.url()<<"!\n";  }
         m_request.expireDate = expireDate;
         m_maxCacheSize = config()->readEntry("MaxCacheSize", DEFAULT_MAX_CACHE_SIZE) \
/ 2; @@ -3743,11 +3744,11 @@
   }
 
   if (m_request.bCachedWrite && !m_strMimeType.isEmpty())
-    kDebug(7113) << "(" << m_pid << ") Cache, adding \"" << m_request.url.url() << \
"\"" << endl; +    kDebug() << "(" << m_pid << ") Cache, adding \"" << \
m_request.url.url() << "\"" << endl;  else if (m_request.bCachedWrite && \
                m_strMimeType.isEmpty())
-    kDebug(7113) << "(" << m_pid << ") Cache, pending \"" << m_request.url.url() << \
"\"" << endl; +    kDebug() << "(" << m_pid << ") Cache, pending \"" << \
m_request.url.url() << "\"" << endl;  else
-    kDebug(7113) << "(" << m_pid << ") Cache, not adding \"" << m_request.url.url() \
<< "\"" << endl; +    kDebug() << "(" << m_pid << ") Cache, not adding \"" << \
m_request.url.url() << "\"" << endl;  return true;
 }
 
@@ -3773,7 +3774,7 @@
   } else if ((encoding == "x-deflate") || (encoding == "deflate")) {
     encs.append(QString::fromLatin1("deflate"));
   } else {
-    kDebug(7113) << "(" << m_pid << ") Unknown encoding encountered.  "
+    kDebug() << "(" << m_pid << ") Unknown encoding encountered.  "
                     << "Please write code. Encoding = \"" << encoding
                     << "\"" << endl;
   }
@@ -3789,16 +3790,16 @@
   // m_bufPOST will NOT be empty iff authentication was required before posting
   // the data OR a re-connect is requested from ::readHeader because the
   // connection was lost for some reason.
-  if ( !m_bufPOST.isNull() )
+  if ( !m_bufPOST.isEmpty() )
   {
-    kDebug(7113) << "(" << m_pid << ") POST'ing saved data..." << endl;
+    kDebug() << "(" << m_pid << ") POST'ing saved data..." << endl;
 
     result = 0;
     length = m_bufPOST.size();
   }
   else
   {
-    kDebug(7113) << "(" << m_pid << ") POST'ing live data..." << endl;
+    kDebug() << "(" << m_pid << ") POST'ing live data..." << endl;
 
     QByteArray buffer;
     int old_size;
@@ -3828,24 +3829,24 @@
   infoMessage( i18n( "Sending data to %1" ,  m_request.hostname ) );
 
   QString size = QString ("Content-Length: %1\r\n\r\n").arg(length);
-  kDebug( 7113 ) << "(" << m_pid << ")" << size << endl;
+  kDebug() << "(" << m_pid << ")" << size << endl;
 
   // Send the content length...
   bool sendOk = (write(size.toLatin1(), size.length()) == (ssize_t) size.length());
   if (!sendOk)
   {
-    kDebug( 7113 ) << "(" << m_pid << ") Connection broken when sending "
+    kDebug() << "(" << m_pid << ") Connection broken when sending "
                     << "content length: (" << m_state.hostname << ")" << endl;
     error( ERR_CONNECTION_BROKEN, m_state.hostname );
     return false;
   }
 
   // Send the data...
-  // kDebug( 7113 ) << "(" << m_pid << ") POST DATA: " << QCString(m_bufPOST) << \
endl; +  // kDebug() << "(" << m_pid << ") POST DATA: " << QCString(m_bufPOST) << \
endl;  sendOk = (write(m_bufPOST.data(), m_bufPOST.size()) == (ssize_t) \
m_bufPOST.size());  if (!sendOk)
   {
-    kDebug(7113) << "(" << m_pid << ") Connection broken when sending message body: \
(" +    kDebug() << "(" << m_pid << ") Connection broken when sending message body: \
("  << m_state.hostname << ")" << endl;
     error( ERR_CONNECTION_BROKEN, m_state.hostname );
     return false;
@@ -3856,7 +3857,7 @@
 
 void HTTPProtocol::httpClose( bool keepAlive )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpClose" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::httpClose" << endl;
 
   if (m_request.fcache)
   {
@@ -3881,7 +3882,7 @@
     else if (m_keepAliveTimeout > 2*DEFAULT_KEEP_ALIVE_TIMEOUT)
        m_keepAliveTimeout = 2*DEFAULT_KEEP_ALIVE_TIMEOUT;
 
-    kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpClose: keep alive (" << \
m_keepAliveTimeout << ")" << endl; +    kDebug() << "(" << m_pid << ") \
HTTPProtocol::httpClose: keep alive (" << m_keepAliveTimeout << ")" << endl;  \
QByteArray data;  QDataStream stream( &data, QIODevice::WriteOnly );
     stream << int(99); // special: Close connection
@@ -3894,13 +3895,13 @@
 
 void HTTPProtocol::closeConnection()
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::closeConnection" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::closeConnection" << endl;
   httpCloseConnection ();
 }
 
 void HTTPProtocol::httpCloseConnection ()
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::httpCloseConnection" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::httpCloseConnection" << endl;
   m_bIsTunneled = false;
   m_bKeepAlive = false;
   closeDescriptor();
@@ -3909,7 +3910,7 @@
 
 void HTTPProtocol::slave_status()
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::slave_status" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::slave_status" << endl;
 
   if ( !isConnectionValid() )
      httpCloseConnection();
@@ -3919,7 +3920,7 @@
 
 void HTTPProtocol::mimetype( const KUrl& url )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::mimetype: "
+  kDebug() << "(" << m_pid << ") HTTPProtocol::mimetype: "
                 << url.prettyUrl() << endl;
 
   if ( !checkRequestUrl( url ) )
@@ -3933,13 +3934,13 @@
 
   retrieveHeader();
 
-  kDebug(7113) << "(" << m_pid << ") http: mimetype = " << m_strMimeType
+  kDebug() << "(" << m_pid << ") http: mimetype = " << m_strMimeType
                 << endl;
 }
 
 void HTTPProtocol::special( const QByteArray &data )
 {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::special" << endl;
+  kDebug() << "(" << m_pid << ") HTTPProtocol::special" << endl;
 
   int tmp;
   QDataStream stream(data);
@@ -4010,7 +4011,7 @@
 
      if (!gets(m_bufReceive.data(), m_bufReceive.size()))
      {
-       kDebug(7113) << "(" << m_pid << ") gets() failure on Chunk header" << endl;
+       kDebug() << "(" << m_pid << ") gets() failure on Chunk header" << endl;
        return -1;
      }
      // We could have got the CRLF of the previous chunk.
@@ -4019,25 +4020,25 @@
      {
         if (!gets(m_bufReceive.data(), m_bufReceive.size()))
         {
-           kDebug(7113) << "(" << m_pid << ") gets() failure on Chunk header" << \
endl; +           kDebug() << "(" << m_pid << ") gets() failure on Chunk header" << \
endl;  return -1;
         }
      }
      if (m_bEOF)
      {
-        kDebug(7113) << "(" << m_pid << ") EOF on Chunk header" << endl;
+        kDebug() << "(" << m_pid << ") EOF on Chunk header" << endl;
         return -1;
      }
 
      long long trunkSize = STRTOLL(m_bufReceive.data(), 0, 16);
      if (trunkSize < 0)
      {
-        kDebug(7113) << "(" << m_pid << ") Negative chunk size" << endl;
+        kDebug() << "(" << m_pid << ") Negative chunk size" << endl;
         return -1;
      }
      m_iBytesLeft = trunkSize;
 
-     // kDebug(7113) << "(" << m_pid << ") Chunk size = " << m_iBytesLeft << " \
bytes" << endl; +     // kDebug() << "(" << m_pid << ") Chunk size = " << \
m_iBytesLeft << " bytes" << endl;  
      if (m_iBytesLeft == 0)
      {
@@ -4047,10 +4048,10 @@
          // Skip trailer of last chunk.
          if (!gets(m_bufReceive.data(), m_bufReceive.size()))
          {
-           kDebug(7113) << "(" << m_pid << ") gets() failure on Chunk trailer" << \
endl; +           kDebug() << "(" << m_pid << ") gets() failure on Chunk trailer" << \
endl;  return -1;
          }
-         // kDebug(7113) << "(" << m_pid << ") Chunk trailer = \"" << \
m_bufReceive.data() << "\"" << endl; +         // kDebug() << "(" << m_pid << ") \
Chunk trailer = \"" << m_bufReceive.data() << "\"" << endl;  }
        while (strlen(m_bufReceive.data()) != 0);
 
@@ -4092,7 +4093,7 @@
 {
   if (m_bKeepAlive)
   {
-     kDebug(7113) << "(" << m_pid << ") Unbounded datastream on a Keep "
+     kDebug() << "(" << m_pid << ") Unbounded datastream on a Keep "
                      << "alive connection!" << endl;
      m_bKeepAlive = false;
   }
@@ -4133,7 +4134,7 @@
       if ( m_strMimeType.isEmpty() && !m_bRedirect &&
            !( m_responseCode >= 300 && m_responseCode <=399) )
       {
-        kDebug(7113) << "(" << m_pid << ") Determining mime-type from content..." << \
endl; +        kDebug() << "(" << m_pid << ") Determining mime-type from content..." \
<< endl;  int old_size = m_mimeTypeBuffer.size();
         m_mimeTypeBuffer.resize( old_size + d.size() );
         memcpy( m_mimeTypeBuffer.data() + old_size, d.data(), d.size() );
@@ -4144,21 +4145,21 @@
           return;   // Do not send up the data since we do not yet know its \
mimetype!  }
 
-        kDebug(7113) << "(" << m_pid << ") Mimetype buffer size: " << \
m_mimeTypeBuffer.size() +        kDebug() << "(" << m_pid << ") Mimetype buffer size: \
" << m_mimeTypeBuffer.size()  << endl;
 
         KMimeType::Ptr mime = \
KMimeType::findByNameAndContent(m_request.url.fileName(), m_mimeTypeBuffer);  if( \
mime && !mime->isDefault() )  {
           m_strMimeType = mime->name();
-          kDebug(7113) << "(" << m_pid << ") Mimetype from content: "
+          kDebug() << "(" << m_pid << ") Mimetype from content: "
                         << m_strMimeType << endl;
         }
 
         if ( m_strMimeType.isEmpty() )
         {
           m_strMimeType = QString::fromLatin1( DEFAULT_MIME_TYPE );
-          kDebug(7113) << "(" << m_pid << ") Using default mimetype: "
+          kDebug() << "(" << m_pid << ") Using default mimetype: "
                         <<  m_strMimeType << endl;
         }
 
@@ -4245,7 +4246,7 @@
 
   if (m_request.bCachedRead)
   {
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readBody: read data from cache!" \
<< endl; +  kDebug() << "(" << m_pid << ") HTTPProtocol::readBody: read data from \
cache!" << endl;  m_request.bCachedWrite = false;
 
     char buffer[ MAX_IPC_SIZE ];
@@ -4287,7 +4288,7 @@
   if (m_bChunked)
     m_iBytesLeft = NO_SIZE;
 
-  kDebug(7113) << "(" << m_pid << ") HTTPProtocol::readBody: retrieve data. \
"<<KIO::number(m_iBytesLeft)<<" left." << endl; +  kDebug() << "(" << m_pid << ") \
HTTPProtocol::readBody: retrieve data. "<<KIO::number(m_iBytesLeft)<<" left." << \
endl;  
   // Main incoming loop...  Gather everything while we can...
   m_cpMimeBuffer = false;
@@ -4354,7 +4355,7 @@
        bytesReceived = readUnlimited();
 
     // make sure that this wasn't an error, first
-    // kDebug(7113) << "(" << (int) m_pid << ") readBody: bytesReceived: "
+    // kDebug() << "(" << (int) m_pid << ") readBody: bytesReceived: "
     //              << (int) bytesReceived << " m_iSize: " << (int) m_iSize << " \
                Chunked: "
     //              << (int) m_bChunked << " BytesLeft: "<< (int) m_iBytesLeft << \
endl;  if (bytesReceived == -1)
@@ -4367,7 +4368,7 @@
          break;
       }
       // Oh well... log an error and bug out
-      kDebug(7113) << "(" << m_pid << ") readBody: bytesReceived==-1 sz=" << (int)sz
+      kDebug() << "(" << m_pid << ") readBody: bytesReceived==-1 sz=" << (int)sz
                     << " Connnection broken !" << endl;
       error(ERR_CONNECTION_BROKEN, m_state.hostname);
       return false;
@@ -4401,7 +4402,7 @@
 
     if (m_iBytesLeft == 0)
     {
-      kDebug(7113) << "("<<m_pid<<") EOD received! Left = "<< \
KIO::number(m_iBytesLeft) << endl; +      kDebug() << "("<<m_pid<<") EOD received! \
Left = "<< KIO::number(m_iBytesLeft) << endl;  break;
     }
   }
@@ -4412,9 +4413,9 @@
     QString calculatedMD5 = md5Filter->md5();
 
     if ( m_sContentMD5 == calculatedMD5 )
-      kDebug(7113) << "(" << m_pid << ") MD5 checksum MATCHED!!" << endl;
+      kDebug() << "(" << m_pid << ") MD5 checksum MATCHED!!" << endl;
     else
-      kDebug(7113) << "(" << m_pid << ") MD5 checksum MISMATCH! Expected: "
+      kDebug() << "(" << m_pid << ") MD5 checksum MISMATCH! Expected: "
                     << calculatedMD5 << ", Got: " << m_sContentMD5 << endl;
   }
 
@@ -4423,9 +4424,9 @@
   {
      if (m_request.bCachedWrite && m_request.fcache)
         closeCacheEntry();
-     else if (m_request.bCachedWrite) kDebug(7113) << "(" << m_pid << ") no cache \
file!\n"; +     else if (m_request.bCachedWrite) kDebug() << "(" << m_pid << ") no \
cache file!\n";  }
-  else kDebug(7113) << "(" << m_pid << ") still "<< KIO::number(m_iBytesLeft) <<" \
bytes left! can't close cache entry!\n"; +  else kDebug() << "(" << m_pid << ") still \
"<< KIO::number(m_iBytesLeft) <<" bytes left! can't close cache entry!\n";  
   if (!dataInternal)
     data( QByteArray() );
@@ -4447,7 +4448,7 @@
   if (!m_bufPOST.isEmpty())
   {
     m_bufPOST.resize(0);
-    kDebug(7113) << "(" << m_pid << ") HTTP::error: Cleared POST "
+    kDebug() << "(" << m_pid << ") HTTP::error: Cleared POST "
                      "buffer..." << endl;
   }
 
@@ -4751,7 +4752,7 @@
 
    QString filename = m_request.cef + ".new";  // Create a new cache entryexpireDate
 
-//   kDebug( 7103 ) <<  "creating new cache entry: " << filename << endl;
+//   kDebug() <<  "creating new cache entry: " << filename << endl;
 
    m_request.fcache = gzopen( QFile::encodeName(filename), "w");
    if (!m_request.fcache)
@@ -4812,7 +4813,7 @@
    m_request.bytesCached+=nbytes;
    if ( m_request.bytesCached>>10 > m_maxCacheSize )
    {
-      kDebug(7113) << "writeCacheEntry: File size reaches " << \
(m_request.bytesCached>>10) +      kDebug() << "writeCacheEntry: File size reaches " \
                << (m_request.bytesCached>>10)
                     << "Kb, exceeds cache limits. (" << m_maxCacheSize << "Kb)" << \
endl;  gzclose(m_request.fcache);
       m_request.fcache = 0;
@@ -4955,22 +4956,22 @@
       // scheme is received. This check accomplishes just that...
       if ( m_iProxyAuthCount == 0)
         ProxyAuthentication = f;
-      kDebug(7113) << "(" << m_pid << ") Rejected proxy auth method: " << f << endl;
+      kDebug() << "(" << m_pid << ") Rejected proxy auth method: " << f << endl;
       return;
     }
     m_iProxyAuthCount++;
-    kDebug(7113) << "(" << m_pid << ") Accepted proxy auth method: " << f << endl;
+    kDebug() << "(" << m_pid << ") Accepted proxy auth method: " << f << endl;
   }
   else
   {
     if ((f == AUTH_None) ||
         ((m_iWWWAuthCount > 0) && (f < Authentication)))
     {
-      kDebug(7113) << "(" << m_pid << ") Rejected auth method: " << f << endl;
+      kDebug() << "(" << m_pid << ") Rejected auth method: " << f << endl;
       return;
     }
     m_iWWWAuthCount++;
-    kDebug(7113) << "(" << m_pid << ") Accepted auth method: " << f << endl;
+    kDebug() << "(" << m_pid << ") Accepted auth method: " << f << endl;
   }
 
 
@@ -5115,7 +5116,7 @@
         if ( pos < len && auth.indexOf("true", pos, Qt::CaseInsensitive) != -1 )
         {
           isStaleNonce = true;
-          kDebug(7113) << "(" << m_pid << ") Stale nonce value. "
+          kDebug() << "(" << m_pid << ") Stale nonce value. "
                         << "Will retry using same info..." << endl;
         }
       }
@@ -5143,12 +5144,12 @@
     if ( Authentication == AUTH_NTLM || ProxyAuthentication == AUTH_NTLM )
     {
       QString auth = ( m_responseCode == 401 ) ? m_strAuthorization : \
                m_strProxyAuthorization;
-      kDebug(7113) << "auth: " << auth << endl;
+      kDebug() << "auth: " << auth << endl;
       if ( auth.length() > 4 )
       {
         prompt = false;
         result = true;
-        kDebug(7113) << "(" << m_pid << ") NTLM auth second phase, "
+        kDebug() << "(" << m_pid << ") NTLM auth second phase, "
                       << "sending response..." << endl;
         if ( m_responseCode == 401 )
         {
@@ -5240,7 +5241,7 @@
         if ( pos < len && auth.indexOf("true", pos, Qt::CaseInsensitive) != -1 )
         {
           info.digestInfo = (m_responseCode == 401) ? m_strAuthorization : \
                m_strProxyAuthorization;
-          kDebug(7113) << "(" << m_pid << ") Just a stale nonce value! "
+          kDebug() << "(" << m_pid << ") Just a stale nonce value! "
                         << "Retrying using the new nonce sent..." << endl;
         }
       }
@@ -5265,7 +5266,7 @@
       }
       else if ( m_request.disablePassDlg == false )
       {
-        kDebug( 7113 ) << "(" << m_pid << ") Prompting the user for \
authorization..." << endl; +        kDebug() << "(" << m_pid << ") Prompting the user \
for authorization..." << endl;  promptInfo( info );
         result = openPasswordDialog( info, errorMsg );
       }
@@ -5375,13 +5376,13 @@
   // see whether we can use the SPNEGO mechanism
   major_status = gss_indicate_mechs(&minor_status, &mech_set);
   if (GSS_ERROR(major_status)) {
-    kDebug(7113) << "(" << m_pid << ") gss_indicate_mechs failed: " << \
gssError(major_status, minor_status) << endl; +    kDebug() << "(" << m_pid << ") \
gss_indicate_mechs failed: " << gssError(major_status, minor_status) << endl;  } else \
{  for (i=0; i<mech_set->count && !found; i++) {
       tmp_oid = &mech_set->elements[i];
       if (tmp_oid->length == spnego_oid_desc.length &&
         !memcmp(tmp_oid->elements, spnego_oid_desc.elements, tmp_oid->length)) {
-        kDebug(7113) << "(" << m_pid << ") createNegotiateAuth: found SPNEGO mech" \
<< endl; +        kDebug() << "(" << m_pid << ") createNegotiateAuth: found SPNEGO \
mech" << endl;  found = 1;
         mech_oid = &spnego_oid_desc;
         break;
@@ -5404,7 +5405,7 @@
   input_token.length = 0;
 
   if (GSS_ERROR(major_status)) {
-    kDebug(7113) << "(" << m_pid << ") gss_import_name failed: " << \
gssError(major_status, minor_status) << endl; +    kDebug() << "(" << m_pid << ") \
gss_import_name failed: " << gssError(major_status, minor_status) << endl;  // reset \
the auth string so that subsequent methods aren't confused  \
m_strAuthorization.clear();  return QString();
@@ -5419,7 +5420,7 @@
 
 
   if (GSS_ERROR(major_status) || (output_token.length == 0)) {
-    kDebug(7113) << "(" << m_pid << ") gss_init_sec_context failed: " << \
gssError(major_status, minor_status) << endl; +    kDebug() << "(" << m_pid << ") \
gss_init_sec_context failed: " << gssError(major_status, minor_status) << endl;  \
gss_release_name(&minor_status, &server);  if (ctx != GSS_C_NO_CONTEXT) {
       gss_delete_sec_context(&minor_status, &ctx, GSS_C_NO_BUFFER);
@@ -5487,7 +5488,7 @@
     user = user.section( '\\', 1 );
   }
 
-  kDebug(7113) << "(" << m_pid << ") NTLM length: " << len << endl;
+  kDebug() << "(" << m_pid << ") NTLM length: " << len << endl;
   if ( user.isEmpty() || passwd.isEmpty() || len < 4 )
     return QString();
 
@@ -5572,7 +5573,7 @@
   }
   HA1 = md.hexDigest();
 
-  kDebug(7113) << "(" << m_pid << ") calculateResponse(): A1 => " << HA1 << endl;
+  kDebug() << "(" << m_pid << ") calculateResponse(): A1 => " << HA1 << endl;
 
   // Calcualte H(A2)
   authStr = info.method;
@@ -5587,7 +5588,7 @@
   md.update( authStr );
   HA2 = md.hexDigest();
 
-  kDebug(7113) << "(" << m_pid << ") calculateResponse(): A2 => "
+  kDebug() << "(" << m_pid << ") calculateResponse(): A2 => "
                 << HA2 << endl;
 
   // Calcualte the response.
@@ -5609,7 +5610,7 @@
   md.update( authStr );
   Response = md.hexDigest();
 
-  kDebug(7113) << "(" << m_pid << ") calculateResponse(): Response => "
+  kDebug() << "(" << m_pid << ") calculateResponse(): Response => "
                 << Response << endl;
 }
 
@@ -5831,19 +5832,19 @@
         break;
     }
 
-    kDebug(7113) << "(" << m_pid << ") createDigestAuth(): passed digest "
+    kDebug() << "(" << m_pid << ") createDigestAuth(): passed digest "
                      "authentication credential test: " << send << endl;
 
     if (!send)
       return QString();
   }
 
-  kDebug(7113) << "(" << m_pid << ") RESULT OF PARSING:" << endl;
-  kDebug(7113) << "(" << m_pid << ")   algorithm: " << info.algorithm << endl;
-  kDebug(7113) << "(" << m_pid << ")   realm:     " << info.realm << endl;
-  kDebug(7113) << "(" << m_pid << ")   nonce:     " << info.nonce << endl;
-  kDebug(7113) << "(" << m_pid << ")   opaque:    " << opaque << endl;
-  kDebug(7113) << "(" << m_pid << ")   qop:       " << info.qop << endl;
+  kDebug() << "(" << m_pid << ") RESULT OF PARSING:" << endl;
+  kDebug() << "(" << m_pid << ")   algorithm: " << info.algorithm << endl;
+  kDebug() << "(" << m_pid << ")   realm:     " << info.realm << endl;
+  kDebug() << "(" << m_pid << ")   nonce:     " << info.nonce << endl;
+  kDebug() << "(" << m_pid << ")   opaque:    " << opaque << endl;
+  kDebug() << "(" << m_pid << ")   qop:       " << info.qop << endl;
 
   // Calculate the response...
   calculateResponse( info, Response );
@@ -5941,13 +5942,13 @@
   /********* Only for debugging purpose... *********/
   if ( ProxyAuthentication != AUTH_None )
   {
-    kDebug(7113) << "(" << m_pid << ") Using Proxy Authentication: " << endl;
-    kDebug(7113) << "(" << m_pid << ")   HOST= " << m_proxyURL.host() << endl;
-    kDebug(7113) << "(" << m_pid << ")   PORT= " << m_proxyURL.port() << endl;
-    kDebug(7113) << "(" << m_pid << ")   USER= " << m_proxyURL.user() << endl;
-    kDebug(7113) << "(" << m_pid << ")   PASSWORD= [protected]" << endl;
-    kDebug(7113) << "(" << m_pid << ")   REALM= " << m_strProxyRealm << endl;
-    kDebug(7113) << "(" << m_pid << ")   EXTRA= " << m_strProxyAuthorization << \
endl; +    kDebug() << "(" << m_pid << ") Using Proxy Authentication: " << endl;
+    kDebug() << "(" << m_pid << ")   HOST= " << m_proxyURL.host() << endl;
+    kDebug() << "(" << m_pid << ")   PORT= " << m_proxyURL.port() << endl;
+    kDebug() << "(" << m_pid << ")   USER= " << m_proxyURL.user() << endl;
+    kDebug() << "(" << m_pid << ")   PASSWORD= [protected]" << endl;
+    kDebug() << "(" << m_pid << ")   REALM= " << m_strProxyRealm << endl;
+    kDebug() << "(" << m_pid << ")   EXTRA= " << m_strProxyAuthorization << endl;
   }
 
   switch ( ProxyAuthentication )



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic