- simplify request method info
- fix tests; run-tests ENV support has changed drastically
16 files changed:
-Copyright (c) 2004-2005, Michael Wallner <mike@iworks.at>.
+Copyright (c) 2004-2006, Michael Wallner <mike@iworks.at>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
All rights reserved.
Redistribution and use in source and binary forms, with or without
The date parser in file http_date_api.c is derived from the implementation
found in the original libcurl source, licensed under the following conditions:
The date parser in file http_date_api.c is derived from the implementation
found in the original libcurl source, licensed under the following conditions:
-Copyright (c) 1996 - 2005, Daniel Stenberg, <daniel@haxx.se>.
+Copyright (c) 1996 - 2006, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved.
Permission to use, copy, modify, and distribute this software for any purpose
All rights reserved.
Permission to use, copy, modify, and distribute this software for any purpose
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.
HTTP: with cURL request support], "yes")
PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support],
[ --with-http-zlib-compression[=LIBZDIR]
HTTP: with cURL request support], "yes")
PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support],
[ --with-http-zlib-compression[=LIBZDIR]
- HTTP: with zlib encodings support])
+ HTTP: with zlib encodings support], "yes")
PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing],
[ --with-http-magic-mime[=LIBMAGICDIR]
HTTP: with magic mime response content type guessing])
PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing],
[ --with-http-magic-mime[=LIBMAGICDIR]
HTTP: with magic mime response content type guessing])
# ifndef WONKY
"HttpResponse"
# endif
# ifndef WONKY
"HttpResponse"
# endif
+#endif
+ );
+ php_info_print_table_row(2, "Output Handlers", "ob_deflatehandler, ob_inflatehandler, ob_etaghandler");
+ php_info_print_table_row(2, "Stream Filters",
+#ifndef ZEND_ENGINE_2
+ "none"
+#else
+ "http.chunked_decode, http.chunked_encode, http.deflate, http.inflate"
- struct _entry {char *name; char *cnst;} *entry;
- phpstr *known_request_methods = phpstr_new();
phpstr *custom_request_methods = phpstr_new();
phpstr *custom_request_methods = phpstr_new();
+ phpstr *known_request_methods = phpstr_from_string(HTTP_KNOWN_METHODS, lenof(HTTP_KNOWN_METHODS));
+ http_request_method_entry **ptr = G->request.methods.custom.entries;
- for (i = HTTP_MIN_REQUEST_METHOD; i < HTTP_MAX_REQUEST_METHOD; ++i) {
- phpstr_appendl(known_request_methods, http_request_method_name(i));
- phpstr_appends(known_request_methods, ", ");
- }
for (i = 0; i < G->request.methods.custom.count; ++i) {
for (i = 0; i < G->request.methods.custom.count; ++i) {
- if ((entry = ((struct _entry **) G->request.methods.custom.entries)[i])) {
- phpstr_appendf(custom_request_methods, "%s, ", entry->name);
+ if (ptr[i]) {
+ phpstr_appendf(custom_request_methods, "%s, ", ptr[i]->name);
php_info_print_table_row(2, "Known", PHPSTR_VAL(known_request_methods));
php_info_print_table_row(2, "Custom",
PHPSTR_LEN(custom_request_methods) ? PHPSTR_VAL(custom_request_methods) : "none registered");
php_info_print_table_row(2, "Known", PHPSTR_VAL(known_request_methods));
php_info_print_table_row(2, "Custom",
PHPSTR_LEN(custom_request_methods) ? PHPSTR_VAL(custom_request_methods) : "none registered");
- php_info_print_table_row(2, "Allowed", strlen(HTTP_G(request).methods.allowed) ? HTTP_G(request).methods.allowed : "(ANY)");
+ php_info_print_table_row(2, "Allowed", strlen(G->request.methods.allowed) ? G->request.methods.allowed : "(ANY)");
phpstr_free(&known_request_methods);
phpstr_free(&custom_request_methods);
phpstr_free(&known_request_methods);
phpstr_free(&custom_request_methods);
/* {{{ void http_build_url(const php_url *, const php_url *, php_url **, char **, size_t *) */
PHP_HTTP_API void _http_build_url(const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC)
{
/* {{{ void http_build_url(const php_url *, const php_url *, php_url **, char **, size_t *) */
PHP_HTTP_API void _http_build_url(const php_url *old_url, const php_url *new_url, php_url **url_ptr, char **url_str, size_t *url_len TSRMLS_DC)
{
-#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
struct servent *se;
#endif
php_url *url = emalloc(sizeof(php_url));
struct servent *se;
#endif
php_url *url = emalloc(sizeof(php_url));
url->scheme = estrndup("https", lenof("https"));
break;
url->scheme = estrndup("https", lenof("https"));
break;
-#if !defined(PHP_WIN32) && !defined(HAVE_NETDB_H)
default:
#endif
case 80:
url->scheme = estrndup("http", lenof("http"));
break;
default:
#endif
case 80:
url->scheme = estrndup("http", lenof("http"));
break;
-#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
default:
if ((se = getservbyport(htons(url->port), "tcp")) && se->s_name) {
url->scheme = estrdup(se->s_name);
default:
if ((se = getservbyport(htons(url->port), "tcp")) && se->s_name) {
url->scheme = estrdup(se->s_name);
if (url->port) {
if ( ((url->port == 80) && !strcmp(url->scheme, "http"))
|| ((url->port ==443) && !strcmp(url->scheme, "https"))
if (url->port) {
if ( ((url->port == 80) && !strcmp(url->scheme, "http"))
|| ((url->port ==443) && !strcmp(url->scheme, "https"))
-#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
|| ((se = getservbyname(url->scheme, "tcp")) && se->s_port &&
(url->port == ntohs(se->s_port)))
#endif
|| ((se = getservbyname(url->scheme, "tcp")) && se->s_port &&
(url->port == ntohs(se->s_port)))
#endif
#ifdef HTTP_WANT_NETDB
# ifdef PHP_WIN32
#ifdef HTTP_WANT_NETDB
# ifdef PHP_WIN32
+# define HTTP_HAVE_NETDB
# include <winsock2.h>
# elif defined(HAVE_NETDB_H)
# include <winsock2.h>
# elif defined(HAVE_NETDB_H)
+# define HTTP_HAVE_NETDB
# include <netdb.h>
# endif
#endif
# include <netdb.h>
# endif
#endif
struct _http_globals_request {
struct _http_globals_request_methods {
char *allowed;
struct _http_globals_request {
struct _http_globals_request_methods {
char *allowed;
+ struct _http_globals_request_methods_custom {
int count;
void *entries;
} custom;
int count;
void *entries;
} custom;
<?php
include 'skip.inc';
?>
<?php
include 'skip.inc';
?>
---ENV--
-HTTP_ACCEPT=application/xml, application/xhtml+xml, text/html ; q = .8
-HTTP_ACCEPT_LANGUAGE=de-AT,de-DE;q=0.8,en-GB;q=0.3,en-US;q=0.2
-HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
--FILE--
<?php
echo "-TEST\n";
--FILE--
<?php
echo "-TEST\n";
+$_SERVER['HTTP_ACCEPT'] = 'application/xml, application/xhtml+xml, text/html ; q = .8';
+$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-AT,de-DE;q=0.8,en-GB;q=0.3,en-US;q=0.2';
+$_SERVER['HTTP_ACCEPT_CHARSET'] = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7';
$langs = array(
array('de', 'en', 'es'),
);
$langs = array(
array('de', 'en', 'es'),
);
include 'skip.inc';
checkcgi();
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=-5
+$_SERVER['HTTP_RANGE'] = 'bytes=-5';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=5-6
+$_SERVER['HTTP_RANGE'] = 'bytes=5-6';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=5981-
+$_SERVER['HTTP_RANGE'] = 'bytes=5981-';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=5990-6000
+$_SERVER['HTTP_RANGE'] = 'bytes=5990-6000';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
HTTP_RANGE=bytes=0-3, 4-5,9-11
--FILE--
<?php
HTTP_RANGE=bytes=0-3, 4-5,9-11
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=0-3, 4-5,9-11';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=0-3, 4-5,9-11
+$_SERVER['HTTP_RANGE'] = 'bytes=0-3, 4-5,9-11';
http_send_content_type('text/plain');
http_send_file('data.txt');
?>
http_send_content_type('text/plain');
http_send_file('data.txt');
?>
checkcgi();
checkmin(5.1);
?>
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=5-9
+$_SERVER['HTTP_RANGE'] = 'bytes=5-9';
http_send_file('data.txt');
?>
--EXPECTF--
http_send_file('data.txt');
?>
--EXPECTF--
checkcgi();
checkmin(5.1);
?>
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=-9
+$_SERVER['HTTP_RANGE'] = 'bytes=-9';
http_send_file('data.txt');
?>
--EXPECTF--
http_send_file('data.txt');
?>
--EXPECTF--
checkcgi();
checkmin(5.1);
?>
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=1000-
+$_SERVER['HTTP_RANGE'] = 'bytes=1000- ';
http_send_file('data.txt');
?>
--EXPECTF--
http_send_file('data.txt');
?>
--EXPECTF--
checkcgi();
checkmin(5.1);
?>
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=-1111
+$_SERVER['HTTP_RANGE'] = 'bytes=-1111';
http_send_file('data.txt');
?>
--EXPECTF--
http_send_file('data.txt');
?>
--EXPECTF--