com php-src: basic fixes to sapi/fpm: sapi/fpm/fpm/fastcgi.c sapi/fpm/fpm/fpm_main.c sapi/fpm/fpm/fpm_php.c

From: Date: Tue, 24 Dec 2013 10:44:53 +0000
Subject: com php-src: basic fixes to sapi/fpm: sapi/fpm/fpm/fastcgi.c sapi/fpm/fpm/fpm_main.c sapi/fpm/fpm/fpm_php.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75445@lists.php.net to get a copy of this message
Commit: 87f348a1e709aade844838418023868154afa245 Author: Anatol Belski <ab@php.net> Tue, 24 Dec 2013 01:57:44 -0800 Parents: 4267b15630659c450562b3bc3d41e2e53ab23159 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=87f348a1e709aade844838418023868154afa245 Log: basic fixes to sapi/fpm Changed paths: M sapi/fpm/fpm/fastcgi.c M sapi/fpm/fpm/fpm_main.c M sapi/fpm/fpm/fpm_php.c Diff: diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index ec579ea..f15fe11 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -595,8 +595,8 @@ static int fcgi_read_request(fcgi_request *req) unsigned char *p = buf + sizeof(fcgi_header); HashPosition pos; char * str_index; - uint str_length; - ulong num_index; + php_size_t str_length; + php_uint_t num_index; int key_type; zval ** value; @@ -612,7 +612,7 @@ static int fcgi_read_request(fcgi_request *req) zend_hash_internal_pointer_reset_ex(req->env, &pos); while ((key_type = zend_hash_get_current_key_ex(req->env, &str_index, &str_length, &num_index, 0, &pos)) != HASH_KEY_NON_EXISTENT) { - int zlen; + php_size_t zlen; zend_hash_move_forward_ex(req->env, &pos); if (key_type != HASH_KEY_IS_STRING) { continue; @@ -621,7 +621,7 @@ static int fcgi_read_request(fcgi_request *req) continue; } --str_length; - zlen = Z_STRLEN_PP(value); + zlen = Z_STRSIZE_PP(value); if ((p + 4 + 4 + str_length + zlen) >= (buf + sizeof(buf))) { break; } @@ -1083,7 +1083,7 @@ void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, s zvalue = pemalloc(sizeof(*zvalue), 1); Z_TYPE_P(zvalue) = IS_STRING; Z_STRVAL_P(zvalue) = pestrndup(value, value_len, 1); - Z_STRLEN_P(zvalue) = value_len; + Z_STRSIZE_P(zvalue) = value_len; zend_hash_add(&fcgi_mgmt_vars, name, name_len + 1, &zvalue, sizeof(zvalue), NULL); } diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index e1c8ff0..978c749 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -295,7 +295,7 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length T #endif } -static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) +static php_size_t sapi_cgibin_ub_write(const char *str, php_size_t str_length TSRMLS_DC) { const char *ptr = str; uint remaining = str_length; @@ -494,7 +494,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) # define STDIN_FILENO 0 #endif -static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static php_size_t sapi_cgi_read_post(char *buffer, php_size_t count_bytes TSRMLS_DC) { uint read_bytes = 0; int tmp_read_bytes; @@ -569,8 +569,8 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) fcgi_request *request; HashPosition pos; char *var, **val; - uint var_len; - ulong idx; + php_size_t var_len; + php_uint_t idx; int filter_arg; @@ -607,7 +607,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) zend_hash_get_current_data_ex(request->env, (void **) &val, &pos) == SUCCESS; zend_hash_move_forward_ex(request->env, &pos) ) { - unsigned int new_val_len; + php_size_t new_val_len; if (sapi_module.input_filter(filter_arg, var, val, strlen(*val), &new_val_len TSRMLS_CC)) { php_register_variable_safe(var, *val, new_val_len, array_ptr TSRMLS_CC); @@ -617,7 +617,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) { - unsigned int php_self_len; + php_size_t php_self_len; char *php_self; /* In CGI mode, we consider the environment to be a part of the server @@ -627,9 +627,9 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) if (CGIG(fix_pathinfo)) { char *script_name = SG(request_info).request_uri; - unsigned int script_name_len = script_name ? strlen(script_name) : 0; + php_size_t script_name_len = script_name ? strlen(script_name) : 0; char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1 TSRMLS_CC); - unsigned int path_info_len = path_info ? strlen(path_info) : 0; + php_size_t path_info_len = path_info ? strlen(path_info) : 0; php_self_len = script_name_len + path_info_len; php_self = emalloc(php_self_len + 1); diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c index cd4d3ae..46c9c1c 100644 --- a/sapi/fpm/fpm/fpm_php.c +++ b/sapi/fpm/fpm/fpm_php.c @@ -23,7 +23,7 @@ static char **limit_extensions = NULL; -static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage TSRMLS_DC) /* {{{ */ +static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, php_int_t new_value_length, int mode, int stage TSRMLS_DC) /* {{{ */ { zend_ini_entry *ini_entry; char *duplicate; @@ -48,7 +48,7 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_ } /* }}} */ -static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC) /* {{{ */ +static void fpm_php_disable(char *value, int (*zend_disable)(char *, php_size_t TSRMLS_DC) TSRMLS_DC) /* {{{ */ { char *s = 0, *e = value; @@ -83,8 +83,8 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */ char *name = kv->key; char *value = kv->value; - int name_len = strlen(name); - int value_len = strlen(value); + php_size_t name_len = strlen(name); + php_size_t value_len = strlen(value); if (!strcmp(name, "extension") && *value) { zval zv; @@ -262,8 +262,8 @@ char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC) /* {{{ */ { zval **data, **tmp; char *string_key; - uint string_len; - ulong num_key; + php_size_t string_len; + php_uint_t num_key; if (!table || !key) { return NULL; }

« previous php.cvs (#75445) next »