-rw-r--r-- | noncore/net/ubrowser/httpfactory.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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 | |||
@@ -220,13 +220,13 @@ const QByteArray HttpFactory::processResponse( int sockfd, bool &isText ) const | |||
220 | } | 220 | } |
221 | 221 | ||
222 | if( currentLine.contains( "Content-Type: text", false ) >= 1 ) | 222 | if( currentLine.contains( "Content-Type: text", false ) >= 1 ) |
223 | { | 223 | { |
224 | isText = true; | 224 | isText = true; |
225 | printf( "HttpFactory::processResponse: content type text\n" ); | 225 | printf( "HttpFactory::processResponse: content type text\n" ); |
226 | if( currentLine.contains( "html", false ) ) | 226 | if( currentLine.contains( "html", false ) >= 1) |
227 | { | 227 | { |
228 | browser->setTextFormat(Qt::RichText); | 228 | browser->setTextFormat(Qt::RichText); |
229 | printf( "HttpFactory::processResponse: content type html\n" ); | 229 | printf( "HttpFactory::processResponse: content type html\n" ); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
@@ -240,12 +240,18 @@ const QByteArray HttpFactory::processResponse( int sockfd, bool &isText ) const | |||
240 | { | 240 | { |
241 | currentLine.remove( 0, 16 ); | 241 | currentLine.remove( 0, 16 ); |
242 | dataLength = currentLine.toInt(); | 242 | dataLength = currentLine.toInt(); |
243 | printf( "HttpFactory::processResponse: content length: %d\n", dataLength ); | 243 | printf( "HttpFactory::processResponse: content length: %d\n", dataLength ); |
244 | } | 244 | } |
245 | 245 | ||
246 | if( currentLine.contains( "404", false ) >= 1 ) | ||
247 | { | ||
248 | printf( "HttpFactory::processResponse: 404 error\n" ); | ||
249 | return 0; | ||
250 | } | ||
251 | |||
246 | currentLine = ""; | 252 | currentLine = ""; |
247 | printf("HttpFactory::processResponse: reseting currentLine: %s\n", currentLine.latin1() ); | 253 | printf("HttpFactory::processResponse: reseting currentLine: %s\n", currentLine.latin1() ); |
248 | } | 254 | } |
249 | } | 255 | } |
250 | } | 256 | } |
251 | 257 | ||