Re: [PHP-DEV] How to handle error in sapi

2016-11-25 Thread Zheng SHAO
> php_apache_sapi_read_post() is invoked very early on > (php_module_startup > sapi_activate > sapi_read_post_data), and > therefore we are too early at initialization that you cannot really > throw an exception to the user. What you can do however is to call > php_apache_sapi_log_message() and try

Re: [PHP-DEV] How to handle error in sapi

2016-11-24 Thread Kalle Sommer Nielsen
Hi Zheng 2016-11-25 6:40 GMT+01:00 Zheng Shao : > I'm confused by how to handle an error inside php_apache_sapi_read_post, > shoud I throw a zend_throw_exception or use a global flag for error handling? php_apache_sapi_read_post() is invoked very early on (php_module_startup > sapi_activate > sa

[PHP-DEV] How to handle error in sapi

2016-11-24 Thread Zheng Shao
Hi, I'm working on fix this bug (https://bugs.php.net/bug.php?id=61471) both on PHP-7 and PHP-5.6. The problem is `ap_get_brigade` will return an error when connection timeout happened. in `sapi/apache2handler/sapi_apache2.c`: static int php_apache_sapi_read_post(char *buf, uint count_bytes TS