Compare commits

..
13 Commits
Author SHA1 Message Date
Unbit d580705e71 prepare for 2.0.11.2 2015-10-07 06:34:01 +02:00
Ragnar Rova 93b0f72b11 OSX 10.11 supports TCP_FASTOPEN
But does not define SOL_TCP.
IPPROTO_TCP is the equivalent.

xrmx: Backport from b608eb1772
Fix #1056
2015-10-03 15:59:14 +02:00
Unbit 8906d5d0c4 attempt to fix http parser 2015-09-16 16:05:43 +02:00
Roberto De Ioris d56f16c56f fixed req threaded logger 2015-08-27 05:46:00 +02:00
Unbit a3caf36515 backported fix for fastrouter subscriptions modifiers 2015-08-04 09:49:04 +02:00
Roberto De Ioris b6ed470ee8 bump minor version to 2.0.11.2 2015-08-02 07:52:37 +02:00
Roberto De Ioris 22425fe92a fixed alarm backlog 2015-08-02 07:45:43 +02:00
Unbit 37bc47cb82 uWSGI 2.0.11.1 2015-07-19 08:17:07 +02:00
Unbit 35701f6ac6 fixed #963 2015-07-19 08:11:06 +02:00
Roberto De Ioris fb23d4a8ae Merge branch 'uwsgi-2.0' of https://github.com/unbit/uwsgi into uwsgi-2.0 2015-07-13 13:25:23 +02:00
Unbit 30c667d34f added unix signal registration hook 2015-07-06 16:11:53 +02:00
Roberto De Ioris ff05c16577 Merge branch 'uwsgi-2.0' of https://github.com/unbit/uwsgi into uwsgi-2.0 2015-07-01 08:51:04 +02:00
Fabrizio Gennari 9c4d563c72 Check whether *value is indeed an SvRV before casting it 2015-07-01 06:12:54 +02:00
15 changed files with 60 additions and 23 deletions
+20
View File
@@ -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);
+1
View File
@@ -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
View File
@@ -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);
}
}
}
}
+1
View File
@@ -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);
+5
View File
@@ -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()");
}
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;
+6 -3
View File
@@ -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) {
+1 -1
View File
@@ -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));
}
+4 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -1,6 +1,6 @@
# uWSGI build system
uwsgi_version = '2.0.11'
uwsgi_version = '2.0.11.2'
import os
import re