summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/SAPI.h19
-rw-r--r--main/fastcgi.c4
-rw-r--r--main/fastcgi.h2
-rw-r--r--sapi/cgi/cgi_main.c4
-rw-r--r--sapi/cli/php_cli.c8
-rw-r--r--sapi/cli/php_cli_server.c12
-rw-r--r--sapi/cli/php_http_parser.c2
-rw-r--r--sapi/fpm/fpm/fpm_conf.c6
-rw-r--r--sapi/fpm/fpm/fpm_main.c2
-rw-r--r--sapi/fpm/fpm/fpm_scoreboard.c16
-rw-r--r--sapi/fpm/fpm/fpm_status.c3
-rw-r--r--sapi/litespeed/lsapi_main.c9
12 files changed, 51 insertions, 36 deletions
diff --git a/main/SAPI.h b/main/SAPI.h
index d9163729a5..d52835b7b1 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -272,7 +272,6 @@ struct _sapi_module_struct {
unsigned int (*input_filter_init)(void);
};
-
struct _sapi_post_entry {
char *content_type;
uint content_type_len;
@@ -305,7 +304,23 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data);
SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter);
END_EXTERN_C()
-#define STANDARD_SAPI_MODULE_PROPERTIES
+#define STANDARD_SAPI_MODULE_PROPERTIES \
+ NULL, /* php_ini_path_override */ \
+ NULL, /* default_post_reader */ \
+ NULL, /* treat_data */ \
+ NULL, /* executable_location */ \
+ 0, /* php_ini_ignore */ \
+ 0, /* php_ini_ignore_cwd */ \
+ NULL, /* get_fd */ \
+ NULL, /* force_http_10 */ \
+ NULL, /* get_target_uid */ \
+ NULL, /* get_target_gid */ \
+ NULL, /* input_filter */ \
+ NULL, /* ini_defaults */ \
+ 0, /* phpinfo_as_text; */ \
+ NULL, /* ini_entries; */ \
+ NULL, /* additional_functions */ \
+ NULL /* input_filter_init */
#endif /* SAPI_H */
diff --git a/main/fastcgi.c b/main/fastcgi.c
index 8fc7d6a968..3f2efc86f1 100644
--- a/main/fastcgi.c
+++ b/main/fastcgi.c
@@ -734,7 +734,7 @@ int fcgi_listen(const char *path, int backlog)
#else
int path_len = strlen(path);
- if (path_len >= sizeof(sa.sa_unix.sun_path)) {
+ if (path_len >= (int)sizeof(sa.sa_unix.sun_path)) {
fcgi_log(FCGI_ERROR, "Listening socket's path name is too long.\n");
return -1;
}
@@ -1587,7 +1587,7 @@ int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int l
}
memcpy(req->out_pos, str, len);
req->out_pos += len;
- } else if (len - limit < sizeof(req->out_buf) - sizeof(fcgi_header)) {
+ } else if (len - limit < (int)(sizeof(req->out_buf) - sizeof(fcgi_header))) {
if (!req->out_hdr) {
open_packet(req, type);
}
diff --git a/main/fastcgi.h b/main/fastcgi.h
index 4e96d9195c..d22c91fdd8 100644
--- a/main/fastcgi.h
+++ b/main/fastcgi.h
@@ -31,7 +31,7 @@
*/
#define FCGI_HASH_FUNC(var, var_len) \
- (UNEXPECTED(var_len < 3) ? var_len : \
+ (UNEXPECTED(var_len < 3) ? (unsigned int)var_len : \
(((unsigned int)var[3]) << 2) + \
(((unsigned int)var[var_len-2]) << 4) + \
(((unsigned int)var[var_len-1]) << 2) + \
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 01ab2ad098..8a263e59f6 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -969,7 +969,7 @@ ZEND_END_ARG_INFO()
static const zend_function_entry additional_functions[] = {
ZEND_FE(dl, arginfo_dl)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
/* {{{ php_cgi_usage
@@ -1716,7 +1716,7 @@ const zend_function_entry cgi_functions[] = {
PHP_FE(apache_request_headers, arginfo_no_args)
PHP_FE(apache_response_headers, arginfo_no_args)
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
static zend_module_entry cgi_module_entry = {
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 8a9f50eccc..9c80ffd4ad 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -271,11 +271,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length) /*
#endif
if (cli_shell_callbacks.cli_shell_write) {
- size_t shell_wrote;
- shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length);
- if (shell_wrote > -1) {
- return shell_wrote;
- }
+ cli_shell_callbacks.cli_shell_write(str, str_length);
}
#ifdef PHP_WRITE_STDOUT
@@ -491,7 +487,7 @@ static const zend_function_entry additional_functions[] = {
ZEND_FE(dl, arginfo_dl)
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
/* {{{ php_cli_usage
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 453fe82998..8f3ca54beb 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -482,7 +482,7 @@ const zend_function_entry server_additional_functions[] = {
PHP_FE(apache_request_headers, arginfo_no_args)
PHP_FE(apache_response_headers, arginfo_no_args)
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */
@@ -1005,7 +1005,11 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
if (nbytes_sent < 0) {
*nbytes_sent_total = _nbytes_sent_total;
return php_socket_errno();
+#ifdef PHP_WIN32
} else if (nbytes_sent == chunk->data.heap.len) {
+#else
+ } else if (nbytes_sent == (ssize_t)chunk->data.heap.len) {
+#endif
php_cli_server_chunk_dtor(chunk);
pefree(chunk, 1);
sender->buffer.first = next;
@@ -1028,7 +1032,11 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
if (nbytes_sent < 0) {
*nbytes_sent_total = _nbytes_sent_total;
return php_socket_errno();
+#ifdef PHP_WIN32
} else if (nbytes_sent == chunk->data.immortal.len) {
+#else
+ } else if (nbytes_sent == (ssize_t)chunk->data.immortal.len) {
+#endif
php_cli_server_chunk_dtor(chunk);
pefree(chunk, 1);
sender->buffer.first = next;
@@ -1705,7 +1713,7 @@ static int php_cli_server_client_read_request(php_cli_server_client *client, cha
}
client->parser.data = client;
nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read);
- if (nbytes_consumed != nbytes_read) {
+ if (nbytes_consumed != (size_t)nbytes_read) {
if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
*errstr = estrdup("Unsupported SSL request");
} else {
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index 5f8eb3ce0b..59361d0911 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -1539,7 +1539,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
p += to_read - 1;
}
- if (to_read == parser->content_length) {
+ if (to_read == (size_t)parser->content_length) {
state = s_chunk_data_almost_done;
}
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 2a92fb25a7..8aa76f0e1c 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -857,7 +857,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
/* status */
if (wp->config->pm_status_path && *wp->config->pm_status_path) {
- int i;
+ size_t i;
char *status = wp->config->pm_status_path;
if (*status != '/') {
@@ -881,7 +881,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
/* ping */
if (wp->config->ping_path && *wp->config->ping_path) {
char *ping = wp->config->ping_path;
- int i;
+ size_t i;
if (*ping != '/') {
zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' must start with a '/'", wp->config->name, ping);
@@ -1254,7 +1254,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg) /* {{{ */
#ifdef HAVE_GLOB
glob_t g;
#endif
- int i;
+ size_t i;
if (!inc || !arg) return;
if (*error) return; /* We got already an error. Switch to the end. */
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 6dc8343fe6..a3b0cc9840 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1549,7 +1549,7 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
static const zend_function_entry cgi_fcgi_sapi_functions[] = {
PHP_FE(fastcgi_finish_request, NULL)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
static zend_module_entry cgi_module_entry = {
diff --git a/sapi/fpm/fpm/fpm_scoreboard.c b/sapi/fpm/fpm/fpm_scoreboard.c
index eabab8f8e6..dcc9e43f42 100644
--- a/sapi/fpm/fpm/fpm_scoreboard.c
+++ b/sapi/fpm/fpm/fpm_scoreboard.c
@@ -25,7 +25,7 @@ static float fpm_scoreboard_tick;
int fpm_scoreboard_init_main() /* {{{ */
{
struct fpm_worker_pool_s *wp;
- int i;
+ unsigned int i;
#ifdef HAVE_TIMES
#if (defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK))
@@ -173,7 +173,7 @@ struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_get(struct fpm_scoreboard_s *s
child_index = fpm_scoreboard_i;
}
- if (child_index < 0 || child_index >= scoreboard->nprocs) {
+ if (child_index < 0 || (unsigned int)child_index >= scoreboard->nprocs) {
return NULL;
}
@@ -233,7 +233,7 @@ void fpm_scoreboard_proc_release(struct fpm_scoreboard_proc_s *proc) /* {{{ */
void fpm_scoreboard_free(struct fpm_scoreboard_s *scoreboard) /* {{{ */
{
- int i;
+ unsigned int i;
if (!scoreboard) {
zlog(ZLOG_ERROR, "**scoreboard is NULL");
@@ -270,7 +270,7 @@ void fpm_scoreboard_proc_free(struct fpm_scoreboard_s *scoreboard, int child_ind
return;
}
- if (child_index < 0 || child_index >= scoreboard->nprocs) {
+ if (child_index < 0 || (unsigned int)child_index >= scoreboard->nprocs) {
return;
}
@@ -292,7 +292,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
}
/* first try the slot which is supposed to be free */
- if (scoreboard->free_proc >= 0 && scoreboard->free_proc < scoreboard->nprocs) {
+ if (scoreboard->free_proc >= 0 && (unsigned int)scoreboard->free_proc < scoreboard->nprocs) {
if (scoreboard->procs[scoreboard->free_proc] && !scoreboard->procs[scoreboard->free_proc]->used) {
i = scoreboard->free_proc;
}
@@ -300,7 +300,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
if (i < 0) { /* the supposed free slot is not, let's search for a free slot */
zlog(ZLOG_DEBUG, "[pool %s] the proc->free_slot was not free. Let's search", scoreboard->pool);
- for (i = 0; i < scoreboard->nprocs; i++) {
+ for (i = 0; i < (int)scoreboard->nprocs; i++) {
if (scoreboard->procs[i] && !scoreboard->procs[i]->used) { /* found */
break;
}
@@ -308,7 +308,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
}
/* no free slot */
- if (i < 0 || i >= scoreboard->nprocs) {
+ if (i < 0 || i >= (int)scoreboard->nprocs) {
zlog(ZLOG_ERROR, "[pool %s] no free scoreboard slot", scoreboard->pool);
return -1;
}
@@ -317,7 +317,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
*child_index = i;
/* supposed next slot is free */
- if (i + 1 >= scoreboard->nprocs) {
+ if (i + 1 >= (int)scoreboard->nprocs) {
scoreboard->free_proc = 0;
} else {
scoreboard->free_proc = i + 1;
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index 3e82face3c..42d7d7bae0 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -386,7 +386,8 @@ int fpm_status_handle_request(void) /* {{{ */
/* no need to test the var 'full' */
if (full_syntax) {
- int i, first;
+ unsigned int i;
+ int first;
zend_string *tmp_query_string;
char *query_string;
struct timeval duration, now;
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index da7ca2c30c..7c8c4746fb 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -442,13 +442,8 @@ static sapi_module_struct lsapi_sapi_module =
sapi_lsapi_register_variables, /* register server variables */
sapi_lsapi_log_message, /* Log message */
-
- NULL, /* php.ini path override */
- NULL, /* default post reader */
- NULL, /* treat data */
- NULL, /* executable location */
-
- 0, /* php.ini ignore */
+ NULL, /* Get request time */
+ NULL, /* Child terminate */
STANDARD_SAPI_MODULE_PROPERTIES