# HG changeset patch # User Ralf Ertzinger # Date 1210702257 -7200 # Node ID 12aa69e560b28b791dc71c15bee52908d4eb36d9 # Parent 6fd05978fd4b32c045247657d2c70e270bafe455 - Ignore status codes other than 2xx for NE_OK diff -r 6fd05978fd4b -r 12aa69e560b2 src/neon/neon.c --- 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)); }