php-server-software

This commit is contained in:
roberto@colossus
2012-02-23 18:16:18 +01:00
parent 4ebb9d7b46
commit ded065ef38
5 changed files with 20 additions and 5 deletions
+2
View File
@@ -321,9 +321,11 @@ int master_loop(char **argv, char **environ) {
#endif
event_queue_add_fd_read(uwsgi.master_queue, uwsgi.shared->worker_signal_pipe[0]);
#ifdef UWSGI_SPOOLER
if (uwsgi.spoolers) {
event_queue_add_fd_read(uwsgi.master_queue, uwsgi.shared->spooler_signal_pipe[0]);
}
#endif
if (uwsgi.mules_cnt > 0) {
event_queue_add_fd_read(uwsgi.master_queue, uwsgi.shared->mule_signal_pipe[0]);
+10 -1
View File
@@ -22,6 +22,8 @@ struct uwsgi_php {
struct uwsgi_string_list *set;
char *docroot;
size_t ini_size;
char *server_software;
size_t server_software_len;
} uphp;
void uwsgi_opt_php_ini(char *opt, char *value, void *foobar) {
@@ -39,6 +41,7 @@ struct uwsgi_option uwsgi_php_options[] = {
{"php-docroot", required_argument, 0, "force php DOCUMENT_ROOT", uwsgi_opt_set_str, &uphp.docroot, 0},
{"php-allowed-docroot", required_argument, 0, "list the allowed document roots", uwsgi_opt_add_string_list, &uphp.allowed_docroot, 0},
{"php-allowed-ext", required_argument, 0, "list the allowed php file extensions", uwsgi_opt_add_string_list, &uphp.allowed_ext, 0},
{"php-server-software", required_argument, 0, "force php SERVER_SOFTWARE", uwsgi_opt_set_str, &uphp.server_software, 0},
{0, 0, 0, 0, 0, 0, 0},
};
@@ -248,7 +251,13 @@ static void sapi_uwsgi_register_variables(zval *track_vars_array TSRMLS_DC)
struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
php_import_environment_variables(track_vars_array TSRMLS_CC);
php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, track_vars_array TSRMLS_CC);
if (uphp.server_software) {
if (!uphp.server_software_len) uphp.server_software_len = strlen(uphp.server_software);
php_register_variable_safe("SERVER_SOFTWARE", uphp.server_software, uphp.server_software_len, track_vars_array TSRMLS_CC);
}
else {
php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, track_vars_array TSRMLS_CC);
}
for (i = 0; i < wsgi_req->var_cnt; i += 2) {
php_register_variable_safe( estrndup(wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len),
-2
View File
@@ -122,7 +122,6 @@ time_t parse_http_date(char *date, uint16_t len) {
}
#ifdef UWSGI_UDP
ssize_t send_udp_message(uint8_t modifier1, uint8_t modifier2, char *host, char *message, uint16_t message_size) {
int fd;
@@ -180,7 +179,6 @@ ssize_t send_udp_message(uint8_t modifier1, uint8_t modifier2, char *host, char
return ret;
}
#endif
int uwsgi_enqueue_message(char *host, int port, uint8_t modifier1, uint8_t modifier2, char *message, int size, int timeout) {
+8
View File
@@ -1554,7 +1554,9 @@ int main(int argc, char *argv[], char *envp[]) {
if (uwsgi.show_config) show_config();
// call cluster initialization procedures
#ifdef UWSGI_MULTICAST
cluster_setup();
#endif
if (uwsgi.binary_path == uwsgi.argv[0]) {
uwsgi.binary_path = uwsgi_str(uwsgi.argv[0]);
@@ -2342,7 +2344,11 @@ skipzero:
}
#endif
#ifdef UWSGI_UDP
if (!uwsgi.sockets && !uwsgi.gateways_cnt && !uwsgi.no_server && !uwsgi.udp_socket && !uwsgi.emperor_dir && !uwsgi.command_mode) {
#else
if (!uwsgi.sockets && !uwsgi.gateways_cnt && !uwsgi.no_server && !uwsgi.emperor_dir && !uwsgi.command_mode) {
#endif
uwsgi_log("The -s/--socket option is missing and stdin is not a socket.\n");
exit(1);
}
@@ -3423,6 +3429,7 @@ void uwsgi_opt_print(char *opt, char *value, void *str) {
fprintf(stdout, "%s\n", value);
}
#ifdef UWSGI_SPOOLER
void uwsgi_opt_add_spooler(char *opt, char *directory, void *none) {
if (access(directory, R_OK | W_OK | X_OK)) {
@@ -3432,6 +3439,7 @@ void uwsgi_opt_add_spooler(char *opt, char *directory, void *none) {
uwsgi_new_spooler(directory);
}
#endif
void uwsgi_opt_set_uid(char *opt, char *value, void *none) {
-2
View File
@@ -1864,9 +1864,7 @@ uint32_t uwsgi_swap32(uint32_t);
uint64_t uwsgi_swap64(uint64_t);
#endif
#ifdef UWSGI_UDP
ssize_t send_udp_message(uint8_t, uint8_t, char *, char *, uint16_t);
#endif
int uwsgi_parse_packet(struct wsgi_request *, int);
int uwsgi_parse_vars(struct wsgi_request *);