From 26cae831399720fffa80c3976e6315b5d906c550 Mon Sep 17 00:00:00 2001 From: "roberto@sirius" Date: Wed, 15 Dec 2010 18:37:56 +0100 Subject: [PATCH] build fix without udp --- buildconf/unbit.ini | 2 +- master.c | 5 ++++- uwsgi.c | 9 ++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/buildconf/unbit.ini b/buildconf/unbit.ini index d4da1320..c397f240 100644 --- a/buildconf/unbit.ini +++ b/buildconf/unbit.ini @@ -25,4 +25,4 @@ xml_implementation = libxml2 plugins = bin_name = /opt/unbit/bin/uwsgi plugin_dir = /opt/unbit/uwsgi_plugins -embedded_plugins = +embedded_plugins = python diff --git a/master.c b/master.c index ec604017..6f69f90c 100644 --- a/master.c +++ b/master.c @@ -71,7 +71,6 @@ void master_loop(char **argv, char **environ) { socklen_t udp_len; char udp_client_addr[16]; int udp_managed = 0; - int rlen; int udp_fd = -1 ; char *cluster_opt_buf = NULL; @@ -84,6 +83,7 @@ void master_loop(char **argv, char **environ) { #endif int i,j; + int rlen; int check_interval = 1; @@ -529,6 +529,7 @@ void master_loop(char **argv, char **environ) { uwsgi.workers[i].last_running_time = uwsgi.workers[i].running_time; } +#ifdef UWSGI_UDP // check for cluster nodes for (i = 0; i < MAX_CLUSTER_NODES; i++) { struct uwsgi_cluster_node *ucn = &uwsgi.shared->nodes[i]; @@ -561,6 +562,8 @@ void master_loop(char **argv, char **environ) { continue; +#endif + } #ifdef UWSGI_SPOOLER /* reload the spooler */ diff --git a/uwsgi.c b/uwsgi.c index ab4b3f09..c53a82c1 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -575,10 +575,12 @@ int main(int argc, char *argv[], char *envp[]) //parse environ parse_sys_envs(environ); +#ifdef UWSGI_UDP // get cluster configuration - uwsgi_log("CLUSTER: %s\n", uwsgi.cluster); if (uwsgi.cluster != NULL) { // get multicast socket + + uwsgi_log("CLUSTER: %s\n", uwsgi.cluster); uwsgi.cluster_fd = uwsgi_cluster_join(uwsgi.cluster); // ask for cluster options only if bot pre-existent options are set @@ -612,6 +614,7 @@ options_parsed: uwsgi_cluster_add_me(); } +#endif #ifdef UWSGI_PROXY if (uwsgi.proxy_add_me) { @@ -1547,12 +1550,14 @@ end: case 0: return 1; +#ifdef UWSGI_UDP case LONG_ARGS_CLUSTER_RELOAD: send_udp_message(98, optarg, "", 0); break; case LONG_ARGS_CLUSTER_LOG: uwsgi_stdin_sendto(optarg, 96, 0); break; +#endif case LONG_ARGS_VHOSTHOST: uwsgi.vhost = 1; uwsgi.vhost_host = 1; @@ -2280,6 +2285,7 @@ void manage_string_opt(char *key, uint16_t keylen, char *val, uint16_t vallen, v } } +#ifdef UWSGI_UDP int uwsgi_cluster_add_me() { const char *key1 = "hostname"; @@ -2390,6 +2396,7 @@ void uwsgi_stdin_sendto(char *socket_name, uint8_t modifier1, uint8_t modifier2) } } +#endif char *uwsgi_cluster_best_node() {