summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php5.c
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2010-03-12 10:28:59 +0000
committerJani Taskinen <jani@php.net>2010-03-12 10:28:59 +0000
commitaf49e58f5155383a440041c77cc1ecbaf507fde7 (patch)
tree01ffe64d6f78450fb828f73d0e1e59f3cc7c8c76 /sapi/apache/mod_php5.c
parentea539c8b88c9278363b6de0b39446e4e8e043391 (diff)
downloadphp-git-af49e58f5155383a440041c77cc1ecbaf507fde7.tar.gz
- Reverted r296062 and r296065
Diffstat (limited to 'sapi/apache/mod_php5.c')
-rw-r--r--sapi/apache/mod_php5.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 815fd48f6f..9711e3fa70 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -95,7 +95,7 @@ static void php_save_umask(void)
static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
{
int ret=0;
-
+
if (SG(server_context)) {
ret = rwrite(str, str_length, (request_rec *) SG(server_context));
}
@@ -137,7 +137,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
if (!SG(read_post_bytes) && !ap_should_client_block(r)) {
return total_read_bytes;
}
-
+
handler = signal(SIGPIPE, SIG_IGN);
while (total_read_bytes<count_bytes) {
hard_timeout("Read POST information", r); /* start timeout timer */
@@ -148,7 +148,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
}
total_read_bytes += read_bytes;
}
- signal(SIGPIPE, handler);
+ signal(SIGPIPE, handler);
return total_read_bytes;
}
/* }}} */
@@ -332,15 +332,15 @@ static void php_apache_request_shutdown(void *dummy)
{
TSRMLS_FETCH();
- php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC);
+ php_output_set_status(0 TSRMLS_CC);
if (AP(in_request)) {
AP(in_request) = 0;
php_request_shutdown(dummy);
}
- SG(server_context) = NULL;
- /*
- * The server context (request) is NOT invalid by the time
- * run_cleanups() is called
+ SG(server_context) = NULL;
+ /*
+ * The server context (request) is NOT invalid by the time
+ * run_cleanups() is called
*/
}
/* }}} */
@@ -349,7 +349,7 @@ static void php_apache_request_shutdown(void *dummy)
*/
static int php_apache_sapi_activate(TSRMLS_D)
{
- request_rec *r = (request_rec *) SG(server_context);
+ request_rec *r = (request_rec *) SG(server_context);
/*
* For the Apache module version, this bit of code registers a cleanup
@@ -357,7 +357,7 @@ static int php_apache_sapi_activate(TSRMLS_D)
* We need this because at any point in our code we can be interrupted
* and that may happen before we have had time to free our memory.
* The php_request_shutdown function needs to free all outstanding allocated
- * memory.
+ * memory.
*/
block_alarms();
register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec);
@@ -401,7 +401,7 @@ static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
int fd;
fd = r->connection->client->fd;
-
+
if (fd >= 0) {
if (nfd) *nfd = fd;
return SUCCESS;
@@ -416,9 +416,9 @@ static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
static int sapi_apache_force_http_10(TSRMLS_D)
{
request_rec *r = SG(server_context);
-
+
r->proto_num = HTTP_VERSION(1,0);
-
+
return SUCCESS;
}
/* }}} */
@@ -464,7 +464,7 @@ static void sapi_apache_child_terminate(TSRMLS_D)
static sapi_module_struct apache_sapi_module = {
"apache", /* name */
"Apache", /* pretty name */
-
+
php_apache_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
@@ -579,8 +579,8 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_
*/
static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
{
+
char *mimetype;
-
if (SG(default_mimetype) || SG(default_charset)) {
/* Assume output will be of the default MIME type. Individual
scripts may change this later. */
@@ -628,7 +628,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
if (per_dir_conf) {
zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
}
-
+
/* If PHP parser engine has been turned off with an "engine off"
* directive, then decline to handle this request
*/
@@ -696,8 +696,9 @@ static int send_parsed_php(request_rec * r)
{
int result = send_php(r, 0, NULL);
TSRMLS_FETCH();
-
- ap_table_setn(r->notes, "mod_php_memory_usage", ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC)));
+
+ ap_table_setn(r->notes, "mod_php_memory_usage",
+ ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC)));
return result;
}
@@ -859,7 +860,7 @@ static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *
bool_val[0] = '0';
}
bool_val[1] = 0;
-
+
return php_apache_value_handler_ex(cmd, conf, arg1, bool_val, mode);
}
/* }}} */
@@ -925,7 +926,7 @@ static void apache_php_module_shutdown_wrapper(void)
#if MODULE_MAGIC_NUMBER >= 19970728
/* This function is only called on server exit if the apache API
- * child_exit handler exists, so shutdown globally
+ * child_exit handler exists, so shutdown globally
*/
sapi_shutdown();
#endif