if (SUCCESS == zend_hash_find(&SG(known_post_content_types), key_str, key_len, (void *) &post_entry)) {
zval *files = PG(http_globals)[TRACK_VARS_FILES];
- zend_is_auto_global(ZEND_STRL("_POST") TSRMLS_CC);
-
if (post_entry) {
SG(request_info).post_entry = post_entry;
PHP_HTTP_ARG_VAL(result_array, 1)
PHP_HTTP_END_ARGS;
-PHP_HTTP_EMPTY_ARGS(statPersistentHandles);
-
-PHP_HTTP_BEGIN_ARGS(cleanPersistentHandles, 0)
- PHP_HTTP_ARG_VAL(name, 0)
- PHP_HTTP_ARG_VAL(ident, 0)
-PHP_HTTP_END_ARGS;
-
static zend_class_entry *php_http_env_class_entry;
zend_class_entry *php_http_env_get_class_entry(void)
PHP_HTTP_ENV_ME(negotiateCharset)
PHP_HTTP_ENV_ME(negotiate)
- PHP_HTTP_ENV_ME(statPersistentHandles)
- PHP_HTTP_ENV_ME(cleanPersistentHandles)
-
EMPTY_FUNCTION_ENTRY
};
zend_object_value ov;
php_http_message_body_t *body = php_http_env_get_request_body(TSRMLS_C);
- if (SUCCESS == php_http_new(&ov, class_entry, (php_http_new_t) php_http_message_body_object_new_ex, php_http_message_body_get_class_entry(), php_http_message_body_copy(body, NULL, 0), NULL TSRMLS_CC)) {
+ if (SUCCESS == php_http_new(&ov, class_entry, (php_http_new_t) php_http_message_body_object_new_ex, php_http_message_body_get_class_entry(), php_http_message_body_init(&body, NULL TSRMLS_CC), NULL TSRMLS_CC)) {
RETVAL_OBJVAL(ov, 0);
}
}
}
}
-PHP_METHOD(HttpEnv, statPersistentHandles)
-{
- if (SUCCESS == zend_parse_parameters_none()) {
- object_init(return_value);
- if (php_http_persistent_handle_statall(HASH_OF(return_value) TSRMLS_CC)) {
- return;
- }
- zval_dtor(return_value);
- }
- RETURN_FALSE;
-}
-
-PHP_METHOD(HttpEnv, cleanPersistentHandles)
-{
- char *name_str = NULL, *ident_str = NULL;
- int name_len = 0, ident_len = 0;
-
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!", &name_str, &name_len, &ident_str, &ident_len)) {
- php_http_persistent_handle_cleanup(name_str, name_len, ident_str, ident_len TSRMLS_CC);
- }
-}
-
#ifdef PHP_HTTP_HAVE_JSON
#include "ext/json/php_json.h"
static SAPI_POST_HANDLER_FUNC(php_http_json_post_handler)
{
if (SG(request_info).raw_post_data) {
- php_json_decode(arg, SG(request_info).raw_post_data, SG(request_info).raw_post_data_length, 1, PG(max_input_nesting_level) TSRMLS_CC);
+ zval *zarg = arg;
+ zval_dtor(zarg);
+ ZVAL_NULL(zarg);
+ php_json_decode(zarg, SG(request_info).raw_post_data, SG(request_info).raw_post_data_length, 1, PG(max_input_nesting_level) TSRMLS_CC);
+ if (Z_TYPE_P(zarg) == IS_NULL) {
+ array_init(zarg);
+ }
}
}