mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-04 16:08:31 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d580705e71 | ||
|
|
93b0f72b11 | ||
|
|
8906d5d0c4 | ||
|
|
d56f16c56f | ||
|
|
a3caf36515 | ||
|
|
b6ed470ee8 | ||
|
|
22425fe92a | ||
|
|
37bc47cb82 | ||
|
|
35701f6ac6 | ||
|
|
fb23d4a8ae | ||
|
|
30c667d34f | ||
|
|
ff05c16577 | ||
|
|
9c4d563c72 |
@@ -407,6 +407,24 @@ static int uwsgi_hook_hostname(char *arg) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static int uwsgi_hook_unix_signal(char *arg) {
|
||||
char *space = strchr(arg, ' ');
|
||||
if (!space) {
|
||||
uwsgi_log("invalid unix_signal syntax, must be <signum> <func>\n");
|
||||
return -1;
|
||||
}
|
||||
*space = 0;
|
||||
int signum = atoi(arg);
|
||||
*space = ' ';
|
||||
void (*func)(int) = dlsym(RTLD_DEFAULT, space+1);
|
||||
if (!func) {
|
||||
uwsgi_log("unable to find function \"%s\"\n", space+1);
|
||||
return -1;
|
||||
}
|
||||
uwsgi_unix_signal(signum, func);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int uwsgi_hook_callint(char *arg) {
|
||||
char *space = strchr(arg, ' ');
|
||||
@@ -620,6 +638,8 @@ void uwsgi_register_base_hooks() {
|
||||
|
||||
uwsgi_register_hook("wait_for_socket", uwsgi_hook_wait_for_socket);
|
||||
|
||||
uwsgi_register_hook("unix_signal", uwsgi_hook_unix_signal);
|
||||
|
||||
// for testing
|
||||
uwsgi_register_hook("exit", uwsgi_hook_exit);
|
||||
uwsgi_register_hook("print", uwsgi_hook_print);
|
||||
|
||||
@@ -1511,6 +1511,7 @@ static void *logger_thread_loop(void *noarg) {
|
||||
if (uwsgi.req_log_master) {
|
||||
logpoll[1].events = POLLIN;
|
||||
logpoll[1].fd = uwsgi.shared->worker_req_log_pipe[0];
|
||||
logpolls++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+9
-8
@@ -258,17 +258,18 @@ static void master_check_listen_queue() {
|
||||
if (uwsgi_sock->queue > backlog) {
|
||||
backlog = uwsgi_sock->queue;
|
||||
}
|
||||
|
||||
if (uwsgi_sock->queue > 0 && uwsgi_sock->queue >= uwsgi_sock->max_queue) {
|
||||
uwsgi_log_verbose("*** uWSGI listen queue of socket \"%s\" (fd: %d) full !!! (%llu/%llu) ***\n", uwsgi_sock->name, uwsgi_sock->fd, (unsigned long long) uwsgi_sock->queue, (unsigned long long) uwsgi_sock->max_queue);
|
||||
}
|
||||
|
||||
if (uwsgi.alarm_backlog) {
|
||||
char buf[1024];
|
||||
int ret = snprintf(buf, 1024, "listen queue of socket \"%s\" (fd: %d) full !!! (%llu/%llu)", uwsgi_sock->name, uwsgi_sock->fd, (unsigned long long) uwsgi_sock->queue, (unsigned long long) uwsgi_sock->max_queue);
|
||||
if (ret > 0 && ret < 1024) {
|
||||
struct uwsgi_string_list *usl = NULL;
|
||||
uwsgi_foreach(usl, uwsgi.alarm_backlog) {
|
||||
uwsgi_alarm_trigger(usl->value, buf, ret);
|
||||
if (uwsgi.alarm_backlog) {
|
||||
char buf[1024];
|
||||
int ret = snprintf(buf, 1024, "listen queue of socket \"%s\" (fd: %d) full !!! (%llu/%llu)", uwsgi_sock->name, uwsgi_sock->fd, (unsigned long long) uwsgi_sock->queue, (unsigned long long) uwsgi_sock->max_queue);
|
||||
if (ret > 0 && ret < 1024) {
|
||||
struct uwsgi_string_list *usl = NULL;
|
||||
uwsgi_foreach(usl, uwsgi.alarm_backlog) {
|
||||
uwsgi_alarm_trigger(usl->value, buf, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -704,6 +704,7 @@ int uwsgi_respawn_worker(int wid) {
|
||||
for(i=0;i<uwsgi.cores;i++) {
|
||||
uwsgi.workers[uwsgi.mywid].cores[i].in_request = 0;
|
||||
memset(&uwsgi.workers[uwsgi.mywid].cores[i].req, 0, sizeof(struct wsgi_request));
|
||||
memset(uwsgi.workers[uwsgi.mywid].cores[i].buffer, 0, sizeof(struct uwsgi_header));
|
||||
}
|
||||
|
||||
uwsgi_fixup_fds(wid, 0, NULL);
|
||||
|
||||
@@ -710,6 +710,11 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) {
|
||||
|
||||
if (uwsgi.tcp_fast_open) {
|
||||
#ifdef TCP_FASTOPEN
|
||||
|
||||
#ifndef SOL_TCP
|
||||
#define SOL_TCP IPPROTO_TCP
|
||||
#endif
|
||||
|
||||
if (setsockopt(serverfd, SOL_TCP, TCP_FASTOPEN, (const void *) &uwsgi.tcp_fast_open, sizeof(int)) < 0) {
|
||||
uwsgi_error("TCP_FASTOPEN setsockopt()");
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ int uwsgi_cr_peer_del(struct corerouter_peer *peer) {
|
||||
if (peer->flush && !peer->is_flushing) {
|
||||
peer->is_flushing = 1;
|
||||
// on success, suspend the execution
|
||||
if (peer->flush(peer) >= 0) return -1;
|
||||
if (peer->flush(peer) > 0) return -1;
|
||||
}
|
||||
struct corerouter_peer *prev = peer->prev;
|
||||
struct corerouter_peer *next = peer->next;
|
||||
|
||||
@@ -222,8 +222,8 @@ static ssize_t fr_instance_connected(struct corerouter_peer *peer) {
|
||||
peer->can_retry = 0;
|
||||
|
||||
// fix modifiers
|
||||
peer->in->buf[0] = peer->modifier1;
|
||||
peer->in->buf[3] = peer->modifier2;
|
||||
peer->session->main_peer->in->buf[0] = peer->modifier1;
|
||||
peer->session->main_peer->in->buf[3] = peer->modifier2;
|
||||
|
||||
// prepare to write the uwsgi packet
|
||||
peer->out = peer->session->main_peer->in;
|
||||
|
||||
@@ -320,7 +320,8 @@ ssize_t hr_ssl_write(struct corerouter_peer *main_peer) {
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_cr_error(main_peer, "hr_ssl_write()");
|
||||
if (errno != 0)
|
||||
uwsgi_cr_error(main_peer, "hr_ssl_write()");
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SSL && uwsgi.ssl_verbose) {
|
||||
@@ -380,7 +381,8 @@ ssize_t hr_ssl_read(struct corerouter_peer *main_peer) {
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_cr_error(main_peer, "hr_ssl_read()");
|
||||
if (errno != 0)
|
||||
uwsgi_cr_error(main_peer, "hr_ssl_read()");
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SSL && uwsgi.ssl_verbose) {
|
||||
@@ -420,7 +422,8 @@ ssize_t hr_ssl_shutdown(struct corerouter_peer *peer) {
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_cr_error(peer, "hr_ssl_shutdown()");
|
||||
if (errno != 0)
|
||||
uwsgi_cr_error(peer, "hr_ssl_shutdown()");
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SSL && uwsgi.ssl_verbose) {
|
||||
|
||||
@@ -285,7 +285,7 @@ nonworker:
|
||||
uwsgi_log("[perl] WARNING !!! unable to build uwsgi::opt hash !!!\n");
|
||||
goto end;
|
||||
}
|
||||
if (SvTYPE(SvRV(*value)) == SVt_PVAV) {
|
||||
if (SvROK(*value) && SvTYPE(SvRV(*value)) == SVt_PVAV) {
|
||||
if (uwsgi.exported_opts[i]->value == NULL) {
|
||||
av_push((AV *)SvRV(*value), newSViv(1));
|
||||
}
|
||||
|
||||
@@ -250,7 +250,8 @@ static ssize_t sr_write(struct corerouter_peer *main_peer) {
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_cr_error(main_peer, "sr_write()");
|
||||
if (errno != 0)
|
||||
uwsgi_cr_error(main_peer, "sr_write()");
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SSL && uwsgi.ssl_verbose) {
|
||||
@@ -332,7 +333,8 @@ static ssize_t sr_read(struct corerouter_peer *main_peer) {
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_cr_error(main_peer, "sr_ssl_read()");
|
||||
if (errno != 0)
|
||||
uwsgi_cr_error(main_peer, "sr_ssl_read()");
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SSL && uwsgi.ssl_verbose) {
|
||||
|
||||
+4
-2
@@ -287,7 +287,8 @@ retry:
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_error("uwsgi_proto_ssl_write()/SSL_write()");
|
||||
if (errno != 0)
|
||||
uwsgi_error("uwsgi_proto_ssl_write()/SSL_write()");
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -383,7 +384,8 @@ retry:
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_error("uwsgi_proto_ssl_read_body()/SSL_read()");
|
||||
if (errno != 0)
|
||||
uwsgi_error("uwsgi_proto_ssl_read_body()/SSL_read()");
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
+2
-1
@@ -760,7 +760,8 @@ retry:
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_error("uwsgi_proto_https_parser()/SSL_read()");
|
||||
if (errno != 0)
|
||||
uwsgi_error("uwsgi_proto_https_parser()/SSL_read()");
|
||||
}
|
||||
return -1;
|
||||
empty:
|
||||
|
||||
+2
-1
@@ -83,7 +83,8 @@ retry:
|
||||
}
|
||||
|
||||
else if (err == SSL_ERROR_SYSCALL) {
|
||||
uwsgi_error("uwsgi_proto_suwsgi_parser()/SSL_read()");
|
||||
if (errno != 0)
|
||||
uwsgi_error("uwsgi_proto_suwsgi_parser()/SSL_read()");
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
||||
s.name = 'uwsgi'
|
||||
s.license = 'GPL-2'
|
||||
s.version = `python -c "import uwsgiconfig as uc; print uc.uwsgi_version"`.sub(/-dev-.*/,'')
|
||||
s.date = '2015-07-01'
|
||||
s.date = '2015-10-07'
|
||||
s.summary = "uWSGI"
|
||||
s.description = "The uWSGI server for Ruby/Rack"
|
||||
s.authors = ["Unbit"]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# uWSGI build system
|
||||
|
||||
uwsgi_version = '2.0.11'
|
||||
uwsgi_version = '2.0.11.2'
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
Reference in New Issue
Block a user