unsigned int (*input_filter_init)(void);
};
-
struct _sapi_post_entry {
char *content_type;
uint content_type_len;
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 */
#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;
}
}
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);
}
*/
#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) + \
static const zend_function_entry additional_functions[] = {
ZEND_FE(dl, arginfo_dl)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
/* {{{ php_cgi_usage
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 = {
#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
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
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) /* {{{ */
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;
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;
}
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 {
p += to_read - 1;
}
- if (to_read == parser->content_length) {
+ if (to_read == (size_t)parser->content_length) {
state = s_chunk_data_almost_done;
}
/* 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 != '/') {
/* 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);
#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. */
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 = {
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))
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;
}
void fpm_scoreboard_free(struct fpm_scoreboard_s *scoreboard) /* {{{ */
{
- int i;
+ unsigned int i;
if (!scoreboard) {
zlog(ZLOG_ERROR, "**scoreboard is NULL");
return;
}
- if (child_index < 0 || child_index >= scoreboard->nprocs) {
+ if (child_index < 0 || (unsigned int)child_index >= scoreboard->nprocs) {
return;
}
}
/* 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;
}
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;
}
}
/* 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;
}
*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;
/* 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;
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