* we should just send the full entity if the range header si syntactically invalid
authorMichael Wallner <mike@php.net>
Fri, 11 Feb 2005 18:07:08 +0000 (18:07 +0000)
committerMichael Wallner <mike@php.net>
Fri, 11 Feb 2005 18:07:08 +0000 (18:07 +0000)
http_api.c

index 7904c5d9271ac295671787dc1fcced2f1b939a52..b195c1e8597758551bf8b60b44c741d7f17e913f 100644 (file)
@@ -1327,7 +1327,7 @@ PHP_HTTP_API http_range_status _http_get_request_ranges(zval *zranges,
 
        if (strncmp(range, "bytes=", strlen("bytes="))) {
                php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Range header misses bytes=");
-               return RANGE_ERR;
+               return RANGE_NO;
        }
 
        ptr = &begin;
@@ -1433,7 +1433,7 @@ PHP_HTTP_API http_range_status _http_get_request_ranges(zval *zranges,
                        break;
 
                        default:
-                               return RANGE_ERR;
+                               return RANGE_NO;
                        break;
                }
        } while (c != 0);
@@ -1765,24 +1765,24 @@ PHP_HTTP_API STATUS _http_parse_headers(char *header, int header_len, zval *arra
 
        while (header_len >= (line - begin)) {
                int value_len = 0;
-               
+
                switch (*line++)
                {
                        case 0:
                                --value_len; /* we don't have CR so value length is one char less */
                        case '\n':
                                if (colon && ((!(*line - 1)) || ((*line != ' ') && (*line != '\t')))) {
-                               
+
                                        /* skip empty key */
                                        if (header != colon) {
                                                char *key = estrndup(header, colon - header);
                                                value_len += line - colon - 1;
-                                                       
+
                                                /* skip leading ws */
                                                while (isspace(*(++colon))) --value_len;
                                                /* skip trailing ws */
                                                while (isspace(colon[value_len - 1])) --value_len;
-                                               
+
                                                if (value_len < 1) {
                                                        /* hm, empty header? */
                                                        add_assoc_stringl(array, key, "", 0, 0);
@@ -1791,7 +1791,7 @@ PHP_HTTP_API STATUS _http_parse_headers(char *header, int header_len, zval *arra
                                                }
                                                efree(key);
                                        }
-                                       
+
                                        colon = NULL;
                                        value_len = 0;
                                        header += line - header;
@@ -1813,7 +1813,7 @@ PHP_HTTP_API STATUS _http_parse_headers(char *header, int header_len, zval *arra
 PHP_HTTP_API void _http_get_request_headers(zval *array TSRMLS_DC)
 {
     char *key;
-    
+
     for (   zend_hash_internal_pointer_reset(HTTP_SERVER_VARS);
             zend_hash_get_current_key(HTTP_SERVER_VARS, &key, NULL, 0) != HASH_KEY_NON_EXISTANT;
             zend_hash_move_forward(HTTP_SERVER_VARS)) {