@@ -267,7 +267,7 @@ static bool php_cli_server_get_system_time(char *buf) {
267
267
#endif
268
268
269
269
/* Destructor for php_cli_server_request->headers, this frees header value */
270
- static void char_ptr_dtor_p (zval * zv ) /* {{{ */
270
+ static void cli_header_value_dtor (zval * zv ) /* {{{ */
271
271
{
272
272
zend_string_release_ex (Z_STR_P (zv ), /* persistent */ true);
273
273
} /* }}} */
@@ -1335,7 +1335,7 @@ static void php_cli_server_request_ctor(php_cli_server_request *req) /* {{{ */
1335
1335
req -> path_info_len = 0 ;
1336
1336
req -> query_string = NULL ;
1337
1337
req -> query_string_len = 0 ;
1338
- zend_hash_init (& req -> headers , 0 , NULL , char_ptr_dtor_p , 1 );
1338
+ zend_hash_init (& req -> headers , 0 , NULL , cli_header_value_dtor , 1 );
1339
1339
/* No destructor is registered as the value pointed by is the same as for &req->headers */
1340
1340
zend_hash_init (& req -> headers_original_case , 0 , NULL , NULL , 1 );
1341
1341
req -> content = NULL ;
@@ -1876,7 +1876,8 @@ static void php_cli_server_client_ctor(php_cli_server_client *client, php_cli_se
1876
1876
client -> addr = addr ;
1877
1877
client -> addr_len = addr_len ;
1878
1878
1879
- // TODO Prevent realloc?
1879
+ // TODO To prevent the reallocation need to retrieve a persistent string
1880
+ // Create a new php_network_populate_name_from_sockaddr_ex() API with a persistent flag?
1880
1881
zend_string * tmp_addr = NULL ;
1881
1882
php_network_populate_name_from_sockaddr (addr , addr_len , & tmp_addr , NULL , 0 );
1882
1883
client -> addr_str = zend_string_dup (tmp_addr , /* persistent */ true);
0 commit comments