changeset 3139:647edbe263bd

neon: Don't bother trying to seek on a Twisted server. It lies about it's capabilities, which leads to failure. (Closes #56)
author William Pitcock <nenolod@atheme.org>
date Thu, 07 May 2009 11:43:21 -0500
parents 8e26022bb814
children 14ad75eeea4c
files src/neon/neon.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/neon/neon.c	Thu May 07 11:14:36 2009 -0500
+++ b/src/neon/neon.c	Thu May 07 11:43:21 2009 -0500
@@ -409,6 +409,13 @@
             continue;
         }
 
+        if (neon_strcmp(name, "server")) {
+            if (NULL != g_strrstr(value, "Twisted/")) {
+                _DEBUG("ugh. this is a twisted server, and therefore cannot REALLY seek: %s", value);
+                h->can_ranges = FALSE;
+            }
+        }
+
         if (neon_strcmp(name, "content-length")) {
             /*
              * The server sent us the content length. Parse and store.