[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_exceptions.h

2010-08-18 Thread Felipe Pena
felipe   Wed, 18 Aug 2010 22:08:36 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302461

Log:
- Reverted unintended modification

Changed paths:
U   php/php-src/trunk/Zend/zend_exceptions.h

Modified: php/php-src/trunk/Zend/zend_exceptions.h
===
--- php/php-src/trunk/Zend/zend_exceptions.h2010-08-18 21:32:43 UTC (rev 
302460)
+++ php/php-src/trunk/Zend/zend_exceptions.h2010-08-18 22:08:36 UTC (rev 
302461)
@@ -30,7 +30,7 @@
 ZEND_API void zend_exception_save(TSRMLS_D);
 ZEND_API void zend_exception_restore(TSRMLS_D);

-ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC);
+void zend_throw_exception_internal(zval *exception TSRMLS_DC);

 void zend_register_default_exception(TSRMLS_D);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/mysql/php_mysql.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/mysql/php_mysql.c trunk/ext/mysql/php_mysql.c

2010-08-18 Thread Ilia Alshanetsky
Does not seem like a security fix to me, so let's not put it into 5.2

On Wed, Aug 18, 2010 at 4:00 PM, Kalle Sommer Nielsen  wrote:
> kalle                                    Wed, 18 Aug 2010 20:00:18 +
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=302456
>
> Log:
> Fixed bug #52636 (php_mysql_fetch_hash writes long value into int)
>
> # Tested by rein at basefarm dot no
>
> Bug: http://bugs.php.net/52636 (Assigned) php_mysql_fetch_hash writes long 
> value into int
>
> Changed paths:
>    U   php/php-src/branches/PHP_5_2/NEWS
>    U   php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c
>    U   php/php-src/branches/PHP_5_3/NEWS
>    U   php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c
>    U   php/php-src/trunk/ext/mysql/php_mysql.c
>
> Modified: php/php-src/branches/PHP_5_2/NEWS
> ===
> --- php/php-src/branches/PHP_5_2/NEWS   2010-08-18 19:29:58 UTC (rev 302455)
> +++ php/php-src/branches/PHP_5_2/NEWS   2010-08-18 20:00:18 UTC (rev 302456)
> @@ -33,6 +33,8 @@
>   PDOStatement if instantiated directly instead of doing by the PDO methods.
>   (Felipe)
>
> +- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
> +  (Kalle, rein at basefarm dot no)
>  - Fixed bug #52317 (Segmentation fault when using mail() on a rhel 4.x (only 
> 64
>   bit)). (Adam)
>  - Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).
>
> Modified: php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c
> ===
> --- php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c  2010-08-18 19:29:58 
> UTC (rev 302455)
> +++ php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c  2010-08-18 20:00:18 
> UTC (rev 302456)
> @@ -1884,7 +1884,7 @@
>
>  /* {{{ php_mysql_fetch_hash
>  */
> -static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int 
> result_type, int expected_args, int into_object)
> +static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long 
> result_type, int expected_args, int into_object)
>  {
>        zval **result, **arg2;
>        MYSQL_RES *mysql_result;
>
> Modified: php/php-src/branches/PHP_5_3/NEWS
> ===
> --- php/php-src/branches/PHP_5_3/NEWS   2010-08-18 19:29:58 UTC (rev 302455)
> +++ php/php-src/branches/PHP_5_3/NEWS   2010-08-18 20:00:18 UTC (rev 302456)
> @@ -11,6 +11,8 @@
>   (Kalle)
>  - Changed the $context parameter on copy() to actually have an effect. 
> (Kalle)
>
> +- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
> +  (Kalle, rein at basefarm dot no)
>  - Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey)
>  - Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe)
>  - Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY 
> values).
>
> Modified: php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c
> ===
> --- php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c  2010-08-18 19:29:58 
> UTC (rev 302455)
> +++ php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c  2010-08-18 20:00:18 
> UTC (rev 302456)
> @@ -2006,7 +2006,7 @@
>
>  /* {{{ php_mysql_fetch_hash
>  */
> -static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int 
> result_type, int expected_args, int into_object)
> +static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long 
> result_type, int expected_args, int into_object)
>  {
>        MYSQL_RES *mysql_result;
>        zval            *res, *ctor_params = NULL;
>
> Modified: php/php-src/trunk/ext/mysql/php_mysql.c
> ===
> --- php/php-src/trunk/ext/mysql/php_mysql.c     2010-08-18 19:29:58 UTC (rev 
> 302455)
> +++ php/php-src/trunk/ext/mysql/php_mysql.c     2010-08-18 20:00:18 UTC (rev 
> 302456)
> @@ -2008,7 +2008,7 @@
>
>  /* {{{ php_mysql_fetch_hash
>  */
> -static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int 
> result_type, int expected_args, int into_object)
> +static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long 
> result_type, int expected_args, int into_object)
>  {
>        MYSQL_RES *mysql_result;
>        zval            *res, *ctor_params = NULL;
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/ PHP_5_2/NEWS PHP_5_3/NEWS

2010-08-18 Thread Kalle Sommer Nielsen
kalleWed, 18 Aug 2010 20:26:42 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302458

Log:
Use userland function name, not internal name for NEWS

Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-08-18 20:16:05 UTC (rev 302457)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-08-18 20:26:42 UTC (rev 302458)
@@ -1,7 +1,7 @@
 PHP
NEWS
 |||
 ?? ??? 2010, PHP 5.2.15
-- Fixed possible crash in php_mssql_get_column_content_without_type(). (Kalle)
+- Fixed possible crash in mssql_fetch_batch(). (Kalle)

 - Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
   (Kalle, rein at basefarm dot no)

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-18 20:16:05 UTC (rev 302457)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-18 20:26:42 UTC (rev 302458)
@@ -11,7 +11,7 @@
   (Kalle)
 - Changed the $context parameter on copy() to actually have an effect. (Kalle)

-- Fixed possible crash in php_mssql_get_column_content_without_type(). (Kalle)
+- Fixed possible crash in mssql_fetch_batch(). (Kalle)

 - Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
   (Kalle, rein at basefarm dot no)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/mssql/php_mssql.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/mssql/php_mssql.c trunk/ext/mssql/php_mssql.c

2010-08-18 Thread Kalle Sommer Nielsen
kalleWed, 18 Aug 2010 20:16:05 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302457

Log:
Fixed possible crash in php_mssql_get_column_content_without_type()

# Also fix NEWS entry in PHP_5_2 for previous commit

Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/mssql/php_mssql.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/mssql/php_mssql.c
U   php/php-src/trunk/ext/mssql/php_mssql.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-08-18 20:00:18 UTC (rev 302456)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-08-18 20:16:05 UTC (rev 302457)
@@ -1,6 +1,10 @@
 PHP
NEWS
 |||
 ?? ??? 2010, PHP 5.2.15
+- Fixed possible crash in php_mssql_get_column_content_without_type(). (Kalle)
+
+- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
+  (Kalle, rein at basefarm dot no)
 - Fixed bug #52436 (Compile error if systems do not have stdint.h)
   (Sriram Natarajan)
 - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
@@ -33,8 +37,6 @@
   PDOStatement if instantiated directly instead of doing by the PDO methods.
   (Felipe)

-- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
-  (Kalle, rein at basefarm dot no)
 - Fixed bug #52317 (Segmentation fault when using mail() on a rhel 4.x (only 64
   bit)). (Adam)
 - Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).

Modified: php/php-src/branches/PHP_5_2/ext/mssql/php_mssql.c
===
--- php/php-src/branches/PHP_5_2/ext/mssql/php_mssql.c  2010-08-18 20:00:18 UTC 
(rev 302456)
+++ php/php-src/branches/PHP_5_2/ext/mssql/php_mssql.c  2010-08-18 20:16:05 UTC 
(rev 302457)
@@ -979,6 +979,14 @@
unsigned char *res_buf;
int res_length = dbdatlen(mssql_ptr->link, offset);

+   if (res_length == 0) {
+   ZVAL_NULL(result);
+   return;
+   } else if (res_length < 0) {
+   ZVAL_FALSE(result);
+   return;
+   }
+
res_buf = (unsigned char *) emalloc(res_length+1);
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
memcpy(res_buf, bin, res_length);

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-18 20:00:18 UTC (rev 302456)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-18 20:16:05 UTC (rev 302457)
@@ -11,6 +11,8 @@
   (Kalle)
 - Changed the $context parameter on copy() to actually have an effect. (Kalle)

+- Fixed possible crash in php_mssql_get_column_content_without_type(). (Kalle)
+
 - Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
   (Kalle, rein at basefarm dot no)
 - Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey)

Modified: php/php-src/branches/PHP_5_3/ext/mssql/php_mssql.c
===
--- php/php-src/branches/PHP_5_3/ext/mssql/php_mssql.c  2010-08-18 20:00:18 UTC 
(rev 302456)
+++ php/php-src/branches/PHP_5_3/ext/mssql/php_mssql.c  2010-08-18 20:16:05 UTC 
(rev 302457)
@@ -1059,6 +1059,14 @@
unsigned char *res_buf;
int res_length = dbdatlen(mssql_ptr->link, offset);

+   if (res_length == 0) {
+   ZVAL_NULL(result);
+   return;
+   } else if (res_length < 0) {
+   ZVAL_FALSE(result);
+   return;
+   }
+
res_buf = (unsigned char *) emalloc(res_length+1);
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
res_buf[res_length] = '\0';

Modified: php/php-src/trunk/ext/mssql/php_mssql.c
===
--- php/php-src/trunk/ext/mssql/php_mssql.c 2010-08-18 20:00:18 UTC (rev 
302456)
+++ php/php-src/trunk/ext/mssql/php_mssql.c 2010-08-18 20:16:05 UTC (rev 
302457)
@@ -1059,6 +1059,14 @@
unsigned char *res_buf;
int res_length = dbdatlen(mssql_ptr->link, offset);

+   if (res_length == 0) {
+   ZVAL_NULL(result);
+   return;
+   } else if (res_length < 0) {
+   ZVAL_FALSE(result);
+   return;
+   }
+
res_buf = (unsigned char *) emalloc(res_length+1);
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/mysql/php_mysql.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/mysql/php_mysql.c trunk/ext/mysql/php_mysql.c

2010-08-18 Thread Kalle Sommer Nielsen
kalleWed, 18 Aug 2010 20:00:18 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302456

Log:
Fixed bug #52636 (php_mysql_fetch_hash writes long value into int)

# Tested by rein at basefarm dot no

Bug: http://bugs.php.net/52636 (Assigned) php_mysql_fetch_hash writes long 
value into int
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c
U   php/php-src/trunk/ext/mysql/php_mysql.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-08-18 19:29:58 UTC (rev 302455)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-08-18 20:00:18 UTC (rev 302456)
@@ -33,6 +33,8 @@
   PDOStatement if instantiated directly instead of doing by the PDO methods.
   (Felipe)

+- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
+  (Kalle, rein at basefarm dot no)
 - Fixed bug #52317 (Segmentation fault when using mail() on a rhel 4.x (only 64
   bit)). (Adam)
 - Fixed bug #52238 (Crash when an Exception occured in iterator_to_array).

Modified: php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c
===
--- php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c  2010-08-18 19:29:58 UTC 
(rev 302455)
+++ php/php-src/branches/PHP_5_2/ext/mysql/php_mysql.c  2010-08-18 20:00:18 UTC 
(rev 302456)
@@ -1884,7 +1884,7 @@

 /* {{{ php_mysql_fetch_hash
  */
-static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int 
result_type, int expected_args, int into_object)
+static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long 
result_type, int expected_args, int into_object)
 {
zval **result, **arg2;
MYSQL_RES *mysql_result;

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-18 19:29:58 UTC (rev 302455)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-18 20:00:18 UTC (rev 302456)
@@ -11,6 +11,8 @@
   (Kalle)
 - Changed the $context parameter on copy() to actually have an effect. (Kalle)

+- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
+  (Kalle, rein at basefarm dot no)
 - Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey)
 - Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe)
 - Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values).

Modified: php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c
===
--- php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c  2010-08-18 19:29:58 UTC 
(rev 302455)
+++ php/php-src/branches/PHP_5_3/ext/mysql/php_mysql.c  2010-08-18 20:00:18 UTC 
(rev 302456)
@@ -2006,7 +2006,7 @@

 /* {{{ php_mysql_fetch_hash
  */
-static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int 
result_type, int expected_args, int into_object)
+static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long 
result_type, int expected_args, int into_object)
 {
MYSQL_RES *mysql_result;
zval*res, *ctor_params = NULL;

Modified: php/php-src/trunk/ext/mysql/php_mysql.c
===
--- php/php-src/trunk/ext/mysql/php_mysql.c 2010-08-18 19:29:58 UTC (rev 
302455)
+++ php/php-src/trunk/ext/mysql/php_mysql.c 2010-08-18 20:00:18 UTC (rev 
302456)
@@ -2008,7 +2008,7 @@

 /* {{{ php_mysql_fetch_hash
  */
-static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int 
result_type, int expected_args, int into_object)
+static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long 
result_type, int expected_args, int into_object)
 {
MYSQL_RES *mysql_result;
zval*res, *ctor_params = NULL;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/trunk/sapi/cgi/ fastcgi.c

2010-08-18 Thread Kalle Sommer Nielsen
kalleWed, 18 Aug 2010 18:00:33 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302451

Log:
Nuke compiler warning, wrong fix that shouldn't have been in the previously 
commit

Changed paths:
U   php/php-src/trunk/sapi/cgi/fastcgi.c

Modified: php/php-src/trunk/sapi/cgi/fastcgi.c
===
--- php/php-src/trunk/sapi/cgi/fastcgi.c2010-08-18 16:54:47 UTC (rev 
302450)
+++ php/php-src/trunk/sapi/cgi/fastcgi.c2010-08-18 18:00:33 UTC (rev 
302451)
@@ -848,7 +848,7 @@
val_len |= *p++;
}
if (UNEXPECTED(name_len + val_len < 0) ||
-   UNEXPECTED((unsigned char *) (name_len + val_len) > end - 
p)) {
+   UNEXPECTED(name_len + val_len > (unsigned int) (end - p))) {
/* Malformated request */
ret = 0;
break;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend_globals.h Zend/zend_ini.c Zend/zend_ini.h Zend/zend_vm_def.h Zend/zend_vm_execute.h

2010-08-18 Thread Dmitry Stogov
dmitry   Wed, 18 Aug 2010 13:58:13 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302442

Log:
improved performance of @ (silence) operator

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/Zend/zend_globals.h
U   php/php-src/trunk/Zend/zend_ini.c
U   php/php-src/trunk/Zend/zend_ini.h
U   php/php-src/trunk/Zend/zend_vm_def.h
U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2010-08-18 13:34:40 UTC (rev 302441)
+++ php/php-src/trunk/NEWS	2010-08-18 13:58:13 UTC (rev 302442)
@@ -26,6 +26,7 @@
 flag any more. Thit is very rare and useless case. ZEND_FREE might be
 required after them instead.
   . improved performance of FastCGI request parsing
+  . improved performance of @ (silence) operator
 - Added concept of interned strings. All strings constants known at compile
   time are allocated in a single copy and never changed. (Dmitry)
 - Added an optimization which saves memory and emalloc/efree calls for empty

Modified: php/php-src/trunk/Zend/zend_globals.h
===
--- php/php-src/trunk/Zend/zend_globals.h	2010-08-18 13:34:40 UTC (rev 302441)
+++ php/php-src/trunk/Zend/zend_globals.h	2010-08-18 13:58:13 UTC (rev 302442)
@@ -69,7 +69,9 @@
 } zend_declarables;

 typedef struct _zend_vm_stack *zend_vm_stack;
+typedef struct _zend_ini_entry zend_ini_entry;

+
 struct _zend_compiler_globals {
 	zend_stack bp_stack;
 	zend_stack switch_cond_stack;
@@ -248,6 +250,7 @@

 	HashTable *ini_directives;
 	HashTable *modified_ini_directives;
+	zend_ini_entry *error_reporting_ini_entry;

 	zend_objects_store objects_store;
 	zval *exception, *prev_exception;

Modified: php/php-src/trunk/Zend/zend_ini.c
===
--- php/php-src/trunk/Zend/zend_ini.c	2010-08-18 13:34:40 UTC (rev 302441)
+++ php/php-src/trunk/Zend/zend_ini.c	2010-08-18 13:58:13 UTC (rev 302442)
@@ -92,6 +92,7 @@

 	EG(ini_directives) = registered_zend_ini_directives;
 	EG(modified_ini_directives) = NULL;
+	EG(error_reporting_ini_entry) = NULL;
 	if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0) == FAILURE) {
 		return FAILURE;
 	}
@@ -133,6 +134,7 @@
 	zend_ini_entry ini_entry;

 	EG(modified_ini_directives) = NULL;
+	EG(error_reporting_ini_entry) = NULL;
 	EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable));
 	if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) {
 		return FAILURE;

Modified: php/php-src/trunk/Zend/zend_ini.h
===
--- php/php-src/trunk/Zend/zend_ini.h	2010-08-18 13:34:40 UTC (rev 302441)
+++ php/php-src/trunk/Zend/zend_ini.h	2010-08-18 13:58:13 UTC (rev 302442)
@@ -57,8 +57,6 @@

 #endif

-typedef struct _zend_ini_entry zend_ini_entry;
-
 #define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
 #define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)


Modified: php/php-src/trunk/Zend/zend_vm_def.h
===
--- php/php-src/trunk/Zend/zend_vm_def.h	2010-08-18 13:34:40 UTC (rev 302441)
+++ php/php-src/trunk/Zend/zend_vm_def.h	2010-08-18 13:58:13 UTC (rev 302442)
@@ -4520,7 +4520,30 @@
 	}

 	if (EG(error_reporting)) {
-		zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
+		do {
+			EG(error_reporting) = 0;
+			if (!EG(error_reporting_ini_entry)) {
+if (UNEXPECTED(zend_hash_find(EG(ini_directives), "error_reporting", sizeof("error_reporting"), (void **) &EG(error_reporting_ini_entry)) == FAILURE)) {
+	break;
+}
+			}
+			if (!EG(error_reporting_ini_entry)->modified) {
+if (!EG(modified_ini_directives)) {
+	ALLOC_HASHTABLE(EG(modified_ini_directives));
+	zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
+}
+if (EXPECTED(zend_hash_add(EG(modified_ini_directives), "error_reporting", sizeof("error_reporting"), &EG(error_reporting_ini_entry), sizeof(zend_ini_entry*), NULL) == SUCCESS)) {
+	EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value;
+	EG(error_reporting_ini_entry)->orig_value_length = EG(error_reporting_ini_entry)->value_length;
+	EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
+	EG(error_reporting_ini_entry)->modified = 1;
+}
+			} else if (EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) {
+efree(EG(error_reporting_ini_entry)->value);
+			}
+			EG(error_reporting_ini_entry)->value = estrndup("0", sizeof("0

[PHP-CVS] svn: /php/php-src/trunk/ ext/standard/basic_functions.c main/SAPI.h main/main.c sapi/apache/mod_php5.c sapi/apache2filter/sapi_apache2.c sapi/apache2handler/sapi_apache2.c sapi/apache_hooks/

2010-08-18 Thread Kalle Sommer Nielsen
kalleWed, 18 Aug 2010 13:34:40 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302441

Log:
Pass the TSRMS pointers to sapi_module_struct.log_message, this saves some 
TSRMLS_FETCH() calls in a few of our SAPI's

Changed paths:
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/main/SAPI.h
U   php/php-src/trunk/main/main.c
U   php/php-src/trunk/sapi/apache/mod_php5.c
U   php/php-src/trunk/sapi/apache2filter/sapi_apache2.c
U   php/php-src/trunk/sapi/apache2handler/sapi_apache2.c
U   php/php-src/trunk/sapi/apache_hooks/mod_php5.c
U   php/php-src/trunk/sapi/cgi/cgi_main.c
U   php/php-src/trunk/sapi/cli/php_cli.c
U   php/php-src/trunk/sapi/continuity/capi.c
U   php/php-src/trunk/sapi/embed/php_embed.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_main.c
U   php/php-src/trunk/sapi/litespeed/lsapi_main.c
U   php/php-src/trunk/sapi/nsapi/nsapi.c

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c	2010-08-18 12:59:52 UTC (rev 302440)
+++ php/php-src/trunk/ext/standard/basic_functions.c	2010-08-18 13:34:40 UTC (rev 302441)
@@ -4633,7 +4633,7 @@

 		case 4: /* send to SAPI */
 			if (sapi_module.log_message) {
-sapi_module.log_message(message);
+sapi_module.log_message(message TSRMLS_CC);
 			} else {
 return FAILURE;
 			}

Modified: php/php-src/trunk/main/SAPI.h
===
--- php/php-src/trunk/main/SAPI.h	2010-08-18 12:59:52 UTC (rev 302440)
+++ php/php-src/trunk/main/SAPI.h	2010-08-18 13:34:40 UTC (rev 302441)
@@ -237,7 +237,7 @@
 	char *(*read_cookies)(TSRMLS_D);

 	void (*register_server_variables)(zval *track_vars_array TSRMLS_DC);
-	void (*log_message)(char *message);
+	void (*log_message)(char *message TSRMLS_DC);
 	time_t (*get_request_time)(TSRMLS_D);
 	void (*terminate_process)(TSRMLS_D);


Modified: php/php-src/trunk/main/main.c
===
--- php/php-src/trunk/main/main.c	2010-08-18 12:59:52 UTC (rev 302440)
+++ php/php-src/trunk/main/main.c	2010-08-18 13:34:40 UTC (rev 302441)
@@ -567,7 +567,7 @@
 	/* Otherwise fall back to the default logging location, if we have one */

 	if (sapi_module.log_message) {
-		sapi_module.log_message(log_message);
+		sapi_module.log_message(log_message TSRMLS_CC);
 	}
 	PG(in_error_log) = 0;
 }

Modified: php/php-src/trunk/sapi/apache/mod_php5.c
===
--- php/php-src/trunk/sapi/apache/mod_php5.c	2010-08-18 12:59:52 UTC (rev 302440)
+++ php/php-src/trunk/sapi/apache/mod_php5.c	2010-08-18 13:34:40 UTC (rev 302441)
@@ -307,10 +307,8 @@

 /* {{{ php_apache_log_message
  */
-static void php_apache_log_message(char *message)
+static void php_apache_log_message(char *message TSRMLS_DC)
 {
-	TSRMLS_FETCH();
-
 	if (SG(server_context)) {
 #if MODULE_MAGIC_NUMBER >= 19970831
 		aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, "%s", message);

Modified: php/php-src/trunk/sapi/apache2filter/sapi_apache2.c
===
--- php/php-src/trunk/sapi/apache2filter/sapi_apache2.c	2010-08-18 12:59:52 UTC (rev 302440)
+++ php/php-src/trunk/sapi/apache2filter/sapi_apache2.c	2010-08-18 13:34:40 UTC (rev 302441)
@@ -282,10 +282,9 @@
 	}
 }

-static void php_apache_sapi_log_message(char *msg)
+static void php_apache_sapi_log_message(char *msg TSRMLS_DC)
 {
 	php_struct *ctx;
-	TSRMLS_FETCH();

 	ctx = SG(server_context);


Modified: php/php-src/trunk/sapi/apache2handler/sapi_apache2.c
===
--- php/php-src/trunk/sapi/apache2handler/sapi_apache2.c	2010-08-18 12:59:52 UTC (rev 302440)
+++ php/php-src/trunk/sapi/apache2handler/sapi_apache2.c	2010-08-18 13:34:40 UTC (rev 302441)
@@ -313,10 +313,9 @@
 	}
 }

-static void php_apache_sapi_log_message(char *msg)
+static void php_apache_sapi_log_message(char *msg TSRMLS_DC)
 {
 	php_struct *ctx;
-	TSRMLS_FETCH();

 	ctx = SG(server_context);

@@ -327,12 +326,12 @@
 	}
 }

-static void php_apache_sapi_log_message_ex(char *msg, request_rec *r)
+static void php_apache_sapi_log_message_ex(char *msg, request_rec *r TSRMLS_DC)
 {
 	if (r) {
 		ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename);
 	} else {
-		php_apache_sapi_log_message(msg);
+		php_apache_sapi_log_message(msg TSRMLS_CC);
 	}
 }

@@ -589,12 +588,12 @@
 	}

 	if (r->finfo.filetype == 0) {
-		php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r);
+		php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r TSRMLS_CC);
 		PHPAP_INI_OFF;
 		return HTTP_NOT_FOUND;
 	}
 	if (r->finfo.filetype == APR_DIR) {
-		php_apache_sapi_log_message_ex("attempt to invo

[PHP-CVS] svn: /php/php-src/trunk/sapi/cgi/ cgi_main.c fastcgi.c fastcgi.h

2010-08-18 Thread Kalle Sommer Nielsen
kalleWed, 18 Aug 2010 12:59:52 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302440

Log:
Use the TSRMLS_DC/TSRMLS_CC macros instead of TSRMLS_FETCH()

Changed paths:
U   php/php-src/trunk/sapi/cgi/cgi_main.c
U   php/php-src/trunk/sapi/cgi/fastcgi.c
U   php/php-src/trunk/sapi/cgi/fastcgi.h

Modified: php/php-src/trunk/sapi/cgi/cgi_main.c
===
--- php/php-src/trunk/sapi/cgi/cgi_main.c   2010-08-18 12:12:29 UTC (rev 
302439)
+++ php/php-src/trunk/sapi/cgi/cgi_main.c   2010-08-18 12:59:52 UTC (rev 
302440)
@@ -587,14 +587,12 @@
return sapi_cgibin_getenv((char *) "HTTP_COOKIE", 
sizeof("HTTP_COOKIE")-1 TSRMLS_CC);
 }

-static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, 
unsigned int val_len, void *arg)
+static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, 
unsigned int val_len, void *arg TSRMLS_DC)
 {
zval *array_ptr = (zval*)arg;
-   int filter_arg;
+   int filter_arg = (array_ptr == 
PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
unsigned int new_val_len;
-   TSRMLS_FETCH();

-   filter_arg = (array_ptr == 
PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
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);
}
@@ -633,7 +631,7 @@

/* turn off magic_quotes while importing environment variables 
*/
PG(magic_quotes_gpc) = 0;
-   fcgi_loadenv(request, cgi_php_load_env_var, array_ptr);
+   fcgi_loadenv(request, cgi_php_load_env_var, array_ptr 
TSRMLS_CC);
PG(magic_quotes_gpc) = magic_quotes_gpc;
}
 }

Modified: php/php-src/trunk/sapi/cgi/fastcgi.c
===
--- php/php-src/trunk/sapi/cgi/fastcgi.c2010-08-18 12:12:29 UTC (rev 
302439)
+++ php/php-src/trunk/sapi/cgi/fastcgi.c2010-08-18 12:59:52 UTC (rev 
302440)
@@ -322,13 +322,13 @@
return NULL;
 }

-static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg)
+static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg 
TSRMLS_DC)
 {
fcgi_hash_bucket *p = h->list;

while (p) {
if (EXPECTED(p->val != NULL)) {
-   func(p->var, p->var_len, p->val, p->val_len, arg);
+   func(p->var, p->var_len, p->val, p->val_len, arg 
TSRMLS_CC);
}
p = p->list_next;
}
@@ -848,7 +848,7 @@
val_len |= *p++;
}
if (UNEXPECTED(name_len + val_len < 0) ||
-   UNEXPECTED(name_len + val_len > end - p)) {
+   UNEXPECTED((unsigned char *) (name_len + val_len) > end - 
p)) {
/* Malformated request */
ret = 0;
break;
@@ -1435,9 +1435,9 @@
return NULL;
 }

-void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array)
+void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array 
TSRMLS_DC)
 {
-   fcgi_hash_apply(&req->env, func, array);
+   fcgi_hash_apply(&req->env, func, array TSRMLS_CC);
 }

 #ifdef _WIN32

Modified: php/php-src/trunk/sapi/cgi/fastcgi.h
===
--- php/php-src/trunk/sapi/cgi/fastcgi.h2010-08-18 12:12:29 UTC (rev 
302439)
+++ php/php-src/trunk/sapi/cgi/fastcgi.h2010-08-18 12:59:52 UTC (rev 
302440)
@@ -91,7 +91,7 @@

 /* FastCGI client API */

-typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, 
unsigned int val_len, void *arg);
+typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, 
unsigned int val_len, void *arg TSRMLS_DC);

 typedef struct _fcgi_request fcgi_request;

@@ -107,7 +107,7 @@

 char* fcgi_getenv(fcgi_request *req, const char* var, int var_len);
 char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val);
-void  fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array);
+void  fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array 
TSRMLS_DC);

 int fcgi_read(fcgi_request *req, char *str, int len);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_exceptions.c

2010-08-18 Thread Kalle Sommer Nielsen
Hi Dmitry

2010/8/18 Dmitry Stogov :
> dmitry                                   Wed, 18 Aug 2010 09:45:52 +
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=302426
>
> Log:
> Revert unintended modification

Remember to update the header file, else it breaks linkage.

-- 
regards,

Kalle Sommer Nielsen
ka...@php.net

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_exceptions.c

2010-08-18 Thread Dmitry Stogov
dmitry   Wed, 18 Aug 2010 09:45:52 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302426

Log:
Revert unintended modification

Changed paths:
U   php/php-src/trunk/Zend/zend_exceptions.c

Modified: php/php-src/trunk/Zend/zend_exceptions.c
===
--- php/php-src/trunk/Zend/zend_exceptions.c2010-08-18 08:44:10 UTC (rev 
302425)
+++ php/php-src/trunk/Zend/zend_exceptions.c2010-08-18 09:45:52 UTC (rev 
302426)
@@ -81,7 +81,7 @@
 }
 /* }}} */

-ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ 
*/
+void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
 {
 #ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/trunk/ NEWS sapi/cgi/cgi_main.c sapi/cgi/fastcgi.c sapi/cgi/fastcgi.h

2010-08-18 Thread Dmitry Stogov
dmitry   Wed, 18 Aug 2010 08:22:41 +

Revision: http://svn.php.net/viewvc?view=revision&revision=302424

Log:
improved performance of FastCGI request parsing

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/sapi/cgi/cgi_main.c
U   php/php-src/trunk/sapi/cgi/fastcgi.c
U   php/php-src/trunk/sapi/cgi/fastcgi.h

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2010-08-18 03:50:38 UTC (rev 302423)
+++ php/php-src/trunk/NEWS	2010-08-18 08:22:41 UTC (rev 302424)
@@ -25,6 +25,7 @@
   . ZEND_FETCH_*_R operations simplified and can't be used with EXT_TYPE_UNUSED
 flag any more. Thit is very rare and useless case. ZEND_FREE might be
 required after them instead.
+  . improved performance of FastCGI request parsing
 - Added concept of interned strings. All strings constants known at compile
   time are allocated in a single copy and never changed. (Dmitry)
 - Added an optimization which saves memory and emalloc/efree calls for empty

Modified: php/php-src/trunk/sapi/cgi/cgi_main.c
===
--- php/php-src/trunk/sapi/cgi/cgi_main.c	2010-08-18 03:50:38 UTC (rev 302423)
+++ php/php-src/trunk/sapi/cgi/cgi_main.c	2010-08-18 08:22:41 UTC (rev 302424)
@@ -587,6 +587,17 @@
 	return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE")-1 TSRMLS_CC);
 }

+static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg)
+{
+	zval *array_ptr = (zval*)arg;
+	int filter_arg = (array_ptr == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
+	unsigned int 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);
+	}
+}
+
 void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
 {
 	if (PG(http_globals)[TRACK_VARS_ENV] &&
@@ -616,26 +627,11 @@

 	if (fcgi_is_fastcgi()) {
 		fcgi_request *request = (fcgi_request*) SG(server_context);
-		HashPosition pos;
 		int magic_quotes_gpc = PG(magic_quotes_gpc);
-		char *var, **val;
-		uint var_len;
-		ulong idx;
-		int filter_arg = (array_ptr == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;

 		/* turn off magic_quotes while importing environment variables */
 		PG(magic_quotes_gpc) = 0;
-		for (zend_hash_internal_pointer_reset_ex(&request->env, &pos);
-			zend_hash_get_current_key_ex(&request->env, &var, &var_len, &idx, 0, &pos) == HASH_KEY_IS_STRING &&
-			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;
-
-			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);
-			}
-		}
+		fcgi_loadenv(request, cgi_php_load_env_var, array_ptr);
 		PG(magic_quotes_gpc) = magic_quotes_gpc;
 	}
 }
@@ -1100,8 +1096,10 @@
 		char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC);
 		char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 TSRMLS_CC);

+#ifdef PHP_WIN32
 		/* Hack for buggy IIS that sets incorrect PATH_INFO */
 		char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE")-1 TSRMLS_CC);
+
 		if (env_server_software &&
 			env_script_name &&
 			env_path_info &&
@@ -1115,6 +1113,7 @@
 			}
 			env_path_info = _sapi_cgibin_putenv("PATH_INFO", env_path_info TSRMLS_CC);
 		}
+#endif

 		if (CGIG(fix_pathinfo)) {
 			struct stat st;
@@ -1488,7 +1487,7 @@
 	int fastcgi = fcgi_is_fastcgi();
 	char *bindpath = NULL;
 	int fcgi_fd = 0;
-	fcgi_request request;
+	fcgi_request *request = NULL;
 	int repeats = 1;
 	int benchmark = 0;
 #if HAVE_GETTIMEOFDAY
@@ -1689,7 +1688,7 @@
 		php_import_environment_variables = cgi_php_import_environment_variables;

 		/* library is already initialized, now init our request */
-		fcgi_init_request(&request, fcgi_fd);
+		request = fcgi_init_request(fcgi_fd);

 #ifndef PHP_WIN32
 	/* Pre-fork, if required */
@@ -1810,6 +1809,9 @@
 	break;
 case 'h':
 case '?':
+	if (request) {
+		fcgi_destroy_request(request);
+	}
 	fcgi_shutdown();
 	no_headers = 1;
 	SG(headers_sent) = 1;
@@ -1831,8 +1833,8 @@
 			fcgi_impersonate();
 		}
 #endif
-		while (!fastcgi || fcgi_accept_request(&request) >= 0) {
-			SG(server_context) = (void *) &request;
+		while (!fastcgi || fcgi_accept_request(request) >= 0) {
+			SG(server_context) = fastcgi ? (void *) request : (void *) 1;
 			init_request_info(TSRMLS_C);
 			CG(interactive) = 0;

@@ -2026,7 +2028,7 @@
 			 * get path_translated */
 			if (php_request_startup(TSRMLS_C) == FAILURE) {
 if (fastcgi) {
-	fcgi_finish_request(&request, 1);
+	fcgi_finish_request(