- add missing constants to HttpDeflateStream
authorMichael Wallner <mike@php.net>
Tue, 27 Dec 2005 15:30:11 +0000 (15:30 +0000)
committerMichael Wallner <mike@php.net>
Tue, 27 Dec 2005 15:30:11 +0000 (15:30 +0000)
- add parse_url errors

http_deflatestream_object.c
http_functions.c
http_url_api.c

index f4e55325ef637053207c446f15b9fb0573002751..d5813f91a61dbcb202d715515efb7d39f3eeabd2 100644 (file)
@@ -122,6 +122,11 @@ static inline void _http_deflatestream_object_declare_default_properties(TSRMLS_
        DCL_CONST(long, "LEVEL_DEF", HTTP_DEFLATE_LEVEL_DEF);
        DCL_CONST(long, "LEVEL_MIN", HTTP_DEFLATE_LEVEL_MIN);
        DCL_CONST(long, "LEVEL_MAX", HTTP_DEFLATE_LEVEL_MAX);
+       DCL_CONST(long, "STRATEGY_DEF", HTTP_DEFLATE_STRATEGY_DEF);
+       DCL_CONST(long, "STRATEGY_FILT", HTTP_DEFLATE_STRATEGY_FILT);
+       DCL_CONST(long, "STRATEGY_HUFF", HTTP_DEFLATE_STRATEGY_HUFF);
+       DCL_CONST(long, "STRATEGY_RLE", HTTP_DEFLATE_STRATEGY_RLE);
+       DCL_CONST(long, "STRATEGY_FIXED", HTTP_DEFLATE_STRATEGY_FIXED);
 #endif
 }
 
index 41afd28e3733664ab0d7ad22e3f47fd2420002a1..7f7c4d68647ed9b37eae9a95612fe4f3c2a5d507 100644 (file)
@@ -66,7 +66,7 @@ PHP_FUNCTION(http_date)
 }
 /* }}} */
 
-/* {{{ proto string http_build_url(mixed url[, mixed parts[, array new_url]])
+/* {{{ proto string http_build_url(mixed url[, mixed parts[, array &new_url]])
  *
  * Returns the new URL as string on success or FALSE on failure.
  */
@@ -87,6 +87,7 @@ PHP_FUNCTION(http_build_url)
                } else {
                        convert_to_string(z_new_url);
                        if (!(new_url = php_url_parse_ex(Z_STRVAL_P(z_new_url), Z_STRLEN_P(z_new_url)))) {
+                               http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_new_url));
                                RETURN_FALSE;
                        }
                }
@@ -100,6 +101,7 @@ PHP_FUNCTION(http_build_url)
                        if (new_url) {
                                php_url_free(new_url);
                        }
+                       http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_old_url));
                        RETURN_FALSE;
                }
        }
@@ -601,8 +603,6 @@ PHP_FUNCTION(ob_etaghandler)
  * Provides a basic throttling mechanism, which will yield the current process
  * resp. thread until the entity has been completely sent, though.
  * 
- * Note: This doesn't really work with the FastCGI SAPI.
- *
  * Expects a double parameter specifying the seconds too sleep() after
  * each chunk sent.  Additionally accepts an optional int parameter
  * representing the chunk size in bytes.
index 53faf9506f5417440570c2053df5e9c139011258..2fde306a74154dee0f3ecdedb6b2fd08967b80ea 100644 (file)
@@ -37,6 +37,8 @@ PHP_HTTP_API char *_http_absolute_url(const char *url TSRMLS_DC)
        if (purl) {
                http_build_url(purl, NULL, NULL, &abs, NULL);
                php_url_free(purl);
+       } else {
+               http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", url);
        }
        
        return abs;