From 5d91bda8feb054cb1756409813051c73abebedd4 Mon Sep 17 00:00:00 2001 From: vspader Date: Thu, 5 Mar 2009 08:09:02 -0800 Subject: [PATCH] Cleaned up HTTP code a little. --- Plugins/HTTPSource/HTTPSource.mm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Plugins/HTTPSource/HTTPSource.mm b/Plugins/HTTPSource/HTTPSource.mm index ec40e231e..256e142a8 100644 --- a/Plugins/HTTPSource/HTTPSource.mm +++ b/Plugins/HTTPSource/HTTPSource.mm @@ -25,10 +25,13 @@ _get->addheader("Accept:*/*"); _get->connect([[url absoluteString] UTF8String]); - for(;;) - { + for(;;) { int status = _get->get_status(); - if (status < 0 || status > 1) break; + + if (status < 0 || status > 1) { + break; + } + if (_get->run() < 0) { return 0; } @@ -40,8 +43,6 @@ return NO; } - // length = _get.content_length(); - const char *mimeType = _get->getheader("content-type"); if (NULL != mimeType) { _mimeType = [[NSString alloc] initWithUTF8String:mimeType];