From kde-commits Sat Sep 01 17:35:28 2007 From: Dawit Alemayehu Date: Sat, 01 Sep 2007 17:35:28 +0000 To: kde-commits Subject: KDE/kdelibs/kioslave/http Message-Id: <1188668128.088933.26262.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=118866813817872 SVN commit 707382 by adawit: Forward the HTTP response header before processing it or it might never get sent at all M +21 -24 http.cpp --- trunk/KDE/kdelibs/kioslave/http/http.cpp #707381:707382 @@ -3341,6 +3341,9 @@ } while (!m_bEOF && (len || noHeader) && (headerSize < maxHeaderSize) && (gets(buffer, sizeof(buffer)-1))); + // Send the current response before processing starts or it + // might never get sent... + forwardHttpResponseHeader(); // Now process the HTTP/1.1 upgrade QStringList::Iterator opt = upgradeOffers.begin(); @@ -3482,31 +3485,27 @@ // We need to try to login again if we failed earlier if ( m_bUnauthorized ) { - if ( (m_responseCode == 401) || - (m_bUseProxy && (m_responseCode == 407)) - ) + if ( (m_responseCode == 401) || (m_bUseProxy && (m_responseCode == 407))) { - if ( getAuthorization() ) - { - // for NTLM Authentication we have to keep the connection open! - if ( Authentication == AUTH_NTLM && m_strAuthorization.length() > 4 ) - { - m_bKeepAlive = true; - readBody( true ); - } - else if (ProxyAuthentication == AUTH_NTLM && m_strProxyAuthorization.length() > 4) - { + if ( getAuthorization() ) + { + // for NTLM Authentication we have to keep the connection open! + if ( Authentication == AUTH_NTLM && m_strAuthorization.length() > 4 ) + { + m_bKeepAlive = true; readBody( true ); - } - else - httpCloseConnection(); - return false; // Try again. - } + } + else if (ProxyAuthentication == AUTH_NTLM && m_strProxyAuthorization.length() > 4) + { + readBody( true ); + } + else + httpCloseConnection(); + return false; // Try again. + } - if (m_bError) - return false; // Error out - - // Show error page... + if (m_bError) + return false; // Error out } m_bUnauthorized = false; } @@ -3720,8 +3719,6 @@ mimeType( m_strMimeType ); } - forwardHttpResponseHeader(); - if (m_request.method == HTTP_HEAD) return true;