changeset 2566:12aa69e560b2

- Ignore status codes other than 2xx for NE_OK
author Ralf Ertzinger <ralf@skytale.net>
date Tue, 13 May 2008 20:10:57 +0200
parents 6fd05978fd4b
children a9d6ce7b8c68 6fd8ca4b7b17
files src/neon/neon.c
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/neon/neon.c	Tue May 13 20:07:10 2008 +0200
+++ b/src/neon/neon.c	Tue May 13 20:10:57 2008 +0200
@@ -571,13 +571,15 @@
 
     switch (ret) {
         case NE_OK:
-            /* URL opened OK */
-            _DEBUG("<%p> URL opened OK", handle);
-            handle->content_start = startbyte;
-            handle->pos = startbyte;
-            handle_headers(handle);
-            _LEAVE 0;
-            break;
+            if ((status->code > 199) && (status->code < 300)) {
+                /* URL opened OK */
+                _DEBUG("<%p> URL opened OK", handle);
+                handle->content_start = startbyte;
+                handle->pos = startbyte;
+                handle_headers(handle);
+                _LEAVE 0;
+                break;
+            }
 
         case NE_REDIRECT:
             /* We hit a redirect. Handle it. */
@@ -597,7 +599,7 @@
 
         default:
             /* Something went wrong. */
-            _ERROR("<%p> Could not open URL: %d", handle, ret);
+            _ERROR("<%p> Could not open URL: %d (%d)", handle, ret, status->code);
             if (1 == ret) {
                 _ERROR("<%p> neon error string: %s", handle, ne_get_error(handle->session));
             }