@@ -4042,16 +4042,30 @@ static int accel_preload(const char *config)
4042
4042
return ret ;
4043
4043
}
4044
4044
4045
- size_t preload_ub_write (const char * str , size_t str_length )
4045
+ static size_t preload_ub_write (const char * str , size_t str_length )
4046
4046
{
4047
4047
return fwrite (str , 1 , str_length , stdout );
4048
4048
}
4049
4049
4050
- void preload_flush (void * server_context )
4050
+ static void preload_flush (void * server_context )
4051
4051
{
4052
4052
fflush (stdout );
4053
4053
}
4054
4054
4055
+ static int preload_header_handler (sapi_header_struct * h , sapi_header_op_enum op , sapi_headers_struct * s )
4056
+ {
4057
+ return 0 ;
4058
+ }
4059
+
4060
+ static int preload_send_headers (sapi_headers_struct * sapi_headers )
4061
+ {
4062
+ return SAPI_HEADER_SENT_SUCCESSFULLY ;
4063
+ }
4064
+
4065
+ static void preload_send_header (sapi_header_struct * sapi_header , void * server_context )
4066
+ {
4067
+ }
4068
+
4055
4069
static int accel_finish_startup (void )
4056
4070
{
4057
4071
if (!ZCG (enabled ) || !accel_startup_ok ) {
@@ -4060,6 +4074,8 @@ static int accel_finish_startup(void)
4060
4074
4061
4075
if (ZCG (accel_directives ).preload && * ZCG (accel_directives ).preload ) {
4062
4076
int ret = SUCCESS ;
4077
+ int rc ;
4078
+ int orig_error_reporting ;
4063
4079
4064
4080
int (* orig_activate )(TSRMLS_D ) = sapi_module .activate ;
4065
4081
int (* orig_deactivate )(TSRMLS_D ) = sapi_module .deactivate ;
@@ -4092,9 +4108,9 @@ static int accel_finish_startup(void)
4092
4108
sapi_module .activate = NULL ;
4093
4109
sapi_module .deactivate = NULL ;
4094
4110
sapi_module .register_server_variables = NULL ;
4095
- sapi_module .header_handler = NULL ;
4096
- sapi_module .send_headers = NULL ;
4097
- sapi_module .send_header = NULL ;
4111
+ sapi_module .header_handler = preload_header_handler ;
4112
+ sapi_module .send_headers = preload_send_headers ;
4113
+ sapi_module .send_header = preload_send_header ;
4098
4114
sapi_module .getenv = NULL ;
4099
4115
sapi_module .ub_write = preload_ub_write ;
4100
4116
sapi_module .flush = preload_flush ;
@@ -4104,7 +4120,15 @@ static int accel_finish_startup(void)
4104
4120
#ifdef ZEND_SIGNALS
4105
4121
SIGG (reset ) = 0 ;
4106
4122
#endif
4107
- if (php_request_startup () == SUCCESS ) {
4123
+
4124
+ orig_error_reporting = EG (error_reporting );
4125
+ EG (error_reporting ) = 0 ;
4126
+
4127
+ rc = php_request_startup ();
4128
+
4129
+ EG (error_reporting ) = orig_error_reporting ;
4130
+
4131
+ if (rc == SUCCESS ) {
4108
4132
4109
4133
/* don't send headers */
4110
4134
SG (headers_sent ) = 1 ;
0 commit comments