-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
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
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 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])
# 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"
#endif
);
}
{
int i;
getGlobals(G);
- struct _entry {char *name; char *cnst;} *entry;
- phpstr *known_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) {
- 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, "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);
/* {{{ 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)
+#ifdef HTTP_HAVE_NETDB
struct servent *se;
#endif
php_url *url = emalloc(sizeof(php_url));
url->scheme = estrndup("https", lenof("https"));
break;
-#if !defined(PHP_WIN32) && !defined(HAVE_NETDB_H)
+#ifndef HTTP_HAVE_NETDB
default:
#endif
case 80:
url->scheme = estrndup("http", lenof("http"));
break;
-#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
+#ifdef HTTP_HAVE_NETDB
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 defined(PHP_WIN32) || defined(HAVE_NETDB_H)
+#ifdef HTTP_HAVE_NETDB
|| ((se = getservbyname(url->scheme, "tcp")) && se->s_port &&
(url->port == ntohs(se->s_port)))
#endif
#ifdef HTTP_WANT_NETDB
# ifdef PHP_WIN32
+# define HTTP_HAVE_NETDB
# include <winsock2.h>
# elif defined(HAVE_NETDB_H)
+# define HTTP_HAVE_NETDB
# include <netdb.h>
# endif
#endif
struct _http_globals_request {
struct _http_globals_request_methods {
char *allowed;
- struct {
+ struct _http_globals_request_methods_custom {
int count;
void *entries;
} custom;
<?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";
+$_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'),
);
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=-5
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=-5';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=5-6
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=5-6';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=5981-
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=5981-';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-HTTP_RANGE=bytes=5990-6000
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=5990-6000';
http_send_content_type('text/plain');
http_send_data(str_repeat('123abc', 1000));
?>
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));
?>
include 'skip.inc';
checkcgi();
?>
---ENV--
-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_file('data.txt');
?>
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=5-9
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=5-9';
http_send_file('data.txt');
?>
--EXPECTF--
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=-9
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=-9';
http_send_file('data.txt');
?>
--EXPECTF--
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=1000-
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=1000- ';
http_send_file('data.txt');
?>
--EXPECTF--
checkcgi();
checkmin(5.1);
?>
---ENV--
-HTTP_RANGE=bytes=-1111
--FILE--
<?php
+$_SERVER['HTTP_RANGE'] = 'bytes=-1111';
http_send_file('data.txt');
?>
--EXPECTF--