From d421f8708983df4bab1f9069e87cda94e1d4aeea Mon Sep 17 00:00:00 2001 From: spiralman Date: Sat, 15 Mar 2003 16:19:51 +0000 Subject: HttpFactory::data() now returns 0 if there is a 404 error (previously, if there was a 404 error on an image, the browser would get stuck in an infinite loop). also, fixed html detection --- (limited to 'noncore') diff --git a/noncore/net/ubrowser/httpfactory.cpp b/noncore/net/ubrowser/httpfactory.cpp index 4ace4cb..b37e9f9 100644 --- a/noncore/net/ubrowser/httpfactory.cpp +++ b/noncore/net/ubrowser/httpfactory.cpp @@ -223,7 +223,7 @@ const QByteArray HttpFactory::processResponse( int sockfd, bool &isText ) const { isText = true; printf( "HttpFactory::processResponse: content type text\n" ); - if( currentLine.contains( "html", false ) ) + if( currentLine.contains( "html", false ) >= 1) { browser->setTextFormat(Qt::RichText); printf( "HttpFactory::processResponse: content type html\n" ); @@ -243,6 +243,12 @@ const QByteArray HttpFactory::processResponse( int sockfd, bool &isText ) const printf( "HttpFactory::processResponse: content length: %d\n", dataLength ); } + if( currentLine.contains( "404", false ) >= 1 ) + { + printf( "HttpFactory::processResponse: 404 error\n" ); + return 0; + } + currentLine = ""; printf("HttpFactory::processResponse: reseting currentLine: %s\n", currentLine.latin1() ); } -- cgit v0.9.0.2