mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-04 16:08:31 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d4172a271 | ||
|
|
e842a181aa | ||
|
|
1ba0935579 | ||
|
|
920d1e5cfe | ||
|
|
473b4f1e57 | ||
|
|
b5c19bc1f8 | ||
|
|
79222adfe7 | ||
|
|
8b90efc567 | ||
|
|
4667eedc2b | ||
|
|
752252c9e4 | ||
|
|
6d91b7317d | ||
|
|
cddd1148fd | ||
|
|
c2096e8373 | ||
|
|
4f57ef33af | ||
|
|
aa34beade1 | ||
|
|
1149e60125 | ||
|
|
7def85636e | ||
|
|
d44692b268 | ||
|
|
46322b84b4 | ||
|
|
5785c61a13 | ||
|
|
594880fb46 | ||
|
|
4373306f78 |
+2
-1
@@ -1746,7 +1746,8 @@ void emperor_send_stats(int fd) {
|
||||
goto end0;
|
||||
struct uwsgi_emperor_scanner *ues = emperor_scanners;
|
||||
while (ues) {
|
||||
uwsgi_stats_str(us, ues->arg);
|
||||
if (uwsgi_stats_str(us, ues->arg))
|
||||
goto end0;
|
||||
ues = ues->next;
|
||||
if (ues) {
|
||||
if (uwsgi_stats_comma(us))
|
||||
|
||||
+4
-1
@@ -737,6 +737,7 @@ void uwsgi_legion_add(struct uwsgi_legion *ul) {
|
||||
|
||||
int uwsgi_legion_announce(struct uwsgi_legion *ul) {
|
||||
struct uwsgi_buffer *ub = uwsgi_buffer_new(4096);
|
||||
unsigned char *encrypted = NULL;
|
||||
|
||||
if (uwsgi_buffer_append_keyval(ub, "legion", 6, ul->legion, ul->legion_len))
|
||||
goto err;
|
||||
@@ -769,7 +770,7 @@ int uwsgi_legion_announce(struct uwsgi_legion *ul) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
unsigned char *encrypted = uwsgi_malloc(ub->pos + 4 + EVP_MAX_BLOCK_LENGTH);
|
||||
encrypted = uwsgi_malloc(ub->pos + 4 + EVP_MAX_BLOCK_LENGTH);
|
||||
if (EVP_EncryptInit_ex(ul->encrypt_ctx, NULL, NULL, NULL, NULL) <= 0) {
|
||||
uwsgi_error("[uwsgi-legion] EVP_EncryptInit_ex()");
|
||||
goto err;
|
||||
@@ -808,6 +809,7 @@ int uwsgi_legion_announce(struct uwsgi_legion *ul) {
|
||||
return 0;
|
||||
err:
|
||||
uwsgi_buffer_destroy(ub);
|
||||
free(encrypted);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -824,6 +826,7 @@ void uwsgi_opt_legion_mcast(char *opt, char *value, void *foobar) {
|
||||
exit(1);
|
||||
}
|
||||
uwsgi_legion_register_node(ul, uwsgi_str(ul->addr));
|
||||
free(legion);
|
||||
}
|
||||
|
||||
void uwsgi_opt_legion_node(char *opt, char *value, void *foobar) {
|
||||
|
||||
@@ -972,6 +972,9 @@ struct uwsgi_stats *uwsgi_master_generate_stats() {
|
||||
if (uwsgi_stats_keylong_comma(us, "queue", (unsigned long long) uwsgi_sock->queue))
|
||||
goto end;
|
||||
|
||||
if (uwsgi_stats_keylong_comma(us, "max_queue", (unsigned long long) uwsgi_sock->max_queue))
|
||||
goto end;
|
||||
|
||||
if (uwsgi_stats_keylong_comma(us, "shared", (unsigned long long) uwsgi_sock->shared))
|
||||
goto end;
|
||||
|
||||
|
||||
+2
-1
@@ -450,7 +450,8 @@ int uwsgi_real_file_serve(struct wsgi_request *wsgi_req, char *real_filename, si
|
||||
if (wsgi_req->if_modified_since_len) {
|
||||
time_t ims = parse_http_date(wsgi_req->if_modified_since, wsgi_req->if_modified_since_len);
|
||||
if (st->st_mtime <= ims) {
|
||||
uwsgi_response_prepare_headers(wsgi_req, "304 Not Modified", 16);
|
||||
if (uwsgi_response_prepare_headers(wsgi_req, "304 Not Modified", 16))
|
||||
return -1;
|
||||
return uwsgi_response_write_headers_do(wsgi_req);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -855,9 +855,8 @@ void uwsgi_subscribe(char *subscription, uint8_t cmd) {
|
||||
}
|
||||
keysize++;
|
||||
}
|
||||
|
||||
free(lines);
|
||||
}
|
||||
free(lines);
|
||||
}
|
||||
else {
|
||||
modifier1 = strchr(subscription_key + 1, ',');
|
||||
|
||||
@@ -99,6 +99,7 @@ static struct uwsgi_option uwsgi_base_options[] = {
|
||||
{"set-ph", required_argument, 0, "set a placeholder", uwsgi_opt_set_placeholder, (void *) 1, UWSGI_OPT_IMMEDIATE},
|
||||
{"get", required_argument, 0, "print the specified option value and exit", uwsgi_opt_add_string_list, &uwsgi.get_list, UWSGI_OPT_NO_INITIAL},
|
||||
{"declare-option", required_argument, 0, "declare a new uWSGI custom option", uwsgi_opt_add_custom_option, NULL, UWSGI_OPT_IMMEDIATE},
|
||||
{"declare-option2", required_argument, 0, "declare a new uWSGI custom option (non-immediate)", uwsgi_opt_add_custom_option, NULL, 0},
|
||||
|
||||
{"for", required_argument, 0, "(opt logic) for cycle", uwsgi_opt_logic, (void *) uwsgi_logic_opt_for, UWSGI_OPT_IMMEDIATE},
|
||||
{"for-glob", required_argument, 0, "(opt logic) for cycle (expand glob)", uwsgi_opt_logic, (void *) uwsgi_logic_opt_for_glob, UWSGI_OPT_IMMEDIATE},
|
||||
|
||||
+3
-5
@@ -226,7 +226,7 @@ void uwsgi_yaml_config(char *file, char *magic_table[]) {
|
||||
current_depth = depth;
|
||||
// end the parsing cycle
|
||||
if (in_uwsgi_section)
|
||||
goto exit;
|
||||
return;
|
||||
}
|
||||
else if (depth > current_depth && !in_uwsgi_section) {
|
||||
goto next;
|
||||
@@ -240,7 +240,7 @@ void uwsgi_yaml_config(char *file, char *magic_table[]) {
|
||||
// skip list and {} defined dict
|
||||
if (key[0] == '-' || key[0] == '[' || key[0] == '{') {
|
||||
if (in_uwsgi_section)
|
||||
goto exit;
|
||||
return;
|
||||
goto next;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void uwsgi_yaml_config(char *file, char *magic_table[]) {
|
||||
val = strstr(key, ":\t");
|
||||
}
|
||||
if (!val)
|
||||
goto exit;
|
||||
return;
|
||||
// get the right key
|
||||
val[0] = 0;
|
||||
// yeah overengeneering....
|
||||
@@ -282,8 +282,6 @@ next:
|
||||
|
||||
if (colon) colon[0] = ':';
|
||||
|
||||
exit:
|
||||
free(yaml);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+4
-1
@@ -61,6 +61,7 @@ void linux_namespace_start(void *argv) {
|
||||
for (;;) {
|
||||
char stack[PTHREAD_STACK_MIN];
|
||||
int waitpid_status;
|
||||
char *pid_str = NULL;
|
||||
uwsgi_log("*** jailing uWSGI in %s ***\n", uwsgi.ns);
|
||||
int clone_flags = SIGCHLD | CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWIPC | CLONE_NEWNS;
|
||||
if (uwsgi.ns_net) {
|
||||
@@ -77,10 +78,12 @@ void linux_namespace_start(void *argv) {
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
pid_str = uwsgi_num2str((int) pid);
|
||||
// run the post-jail scripts
|
||||
if (setenv("UWSGI_JAIL_PID", uwsgi_num2str((int) pid), 1)) {
|
||||
if (setenv("UWSGI_JAIL_PID", pid_str, 1)) {
|
||||
uwsgi_error("setenv()");
|
||||
}
|
||||
free(pid_str);
|
||||
uwsgi_hooks_run(uwsgi.hook_post_jail, "post-jail", 1);
|
||||
struct uwsgi_string_list *usl = uwsgi.exec_post_jail;
|
||||
while(usl) {
|
||||
|
||||
+5
-1
@@ -618,6 +618,9 @@ ssize_t http_parse(struct corerouter_peer *main_peer) {
|
||||
|
||||
// is it http body ?
|
||||
if (hr->rnrn == 4) {
|
||||
// something bad happened in keepalive mode...
|
||||
if (!main_peer->session->peers) return -1;
|
||||
|
||||
if (hr->content_length == 0 && !hr->raw_body) {
|
||||
// ignore data...
|
||||
main_peer->in->pos = 0;
|
||||
@@ -871,7 +874,8 @@ int http_alloc_session(struct uwsgi_corerouter *ucr, struct uwsgi_gateway_socket
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
uwsgi_cr_set_hooks(cs->main_peer, cs->main_peer->last_hook_read, NULL);
|
||||
if (uwsgi_cr_set_hooks(cs->main_peer, cs->main_peer->last_hook_read, NULL))
|
||||
return -1;
|
||||
cs->close = hr_session_close;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -798,7 +798,8 @@ static int uwsgi_lua_request(struct wsgi_request *wsgi_req) {
|
||||
// send status
|
||||
if (lua_type(L, -3) == LUA_TSTRING || lua_type(L, -3) == LUA_TNUMBER) {
|
||||
http = lua_tolstring(L, -3, &slen);
|
||||
uwsgi_response_prepare_headers(wsgi_req, (char *) http, slen);
|
||||
if (uwsgi_response_prepare_headers(wsgi_req, (char *) http, slen))
|
||||
goto clear2;
|
||||
}
|
||||
else {
|
||||
uwsgi_log("[uwsgi-lua] invalid response status !!!\n");
|
||||
|
||||
@@ -92,11 +92,13 @@ static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers)
|
||||
int hrc = SG(sapi_headers).http_response_code;
|
||||
if (!hrc) hrc = 200;
|
||||
uwsgi_num2str2n(hrc, status, 4);
|
||||
uwsgi_response_prepare_headers(wsgi_req, status, 3);
|
||||
if (uwsgi_response_prepare_headers(wsgi_req, status, 3))
|
||||
return SAPI_HEADER_SEND_FAILED;
|
||||
}
|
||||
else {
|
||||
char *sl = SG(sapi_headers).http_status_line;
|
||||
uwsgi_response_prepare_headers(wsgi_req, sl + 9 , strlen(sl + 9));
|
||||
if (uwsgi_response_prepare_headers(wsgi_req, sl + 9 , strlen(sl + 9)))
|
||||
return SAPI_HEADER_SEND_FAILED;
|
||||
}
|
||||
|
||||
h = zend_llist_get_first_ex(&sapi_headers->headers, &pos);
|
||||
|
||||
@@ -1795,7 +1795,8 @@ static void uwsgi_python_harakiri(int wid) {
|
||||
if (up.tracebacker) {
|
||||
|
||||
char buf[8192];
|
||||
char *address = uwsgi_concat2(up.tracebacker, uwsgi_num2str(wid));
|
||||
char *wid_str = uwsgi_num2str(wid);
|
||||
char *address = uwsgi_concat2(up.tracebacker, wid_str);
|
||||
|
||||
int fd = uwsgi_connect(address, -1, 0);
|
||||
if (fd < 1)
|
||||
@@ -1814,6 +1815,7 @@ static void uwsgi_python_harakiri(int wid) {
|
||||
cleanup:
|
||||
close(fd);
|
||||
exit:
|
||||
free(wid_str);
|
||||
free(address);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,12 @@ void *uwsgi_python_tracebacker_thread(void *foobar) {
|
||||
int current_defer_accept = uwsgi.no_defer_accept;
|
||||
uwsgi.no_defer_accept = 1;
|
||||
int fd = bind_to_unix(sock_path, uwsgi.listen_queue, uwsgi.chmod_socket, uwsgi.abstract_socket);
|
||||
if (fd < 0) {
|
||||
uwsgi.no_defer_accept = current_defer_accept;
|
||||
free(str_wid);
|
||||
free(sock_path);
|
||||
return NULL;
|
||||
}
|
||||
uwsgi.no_defer_accept = current_defer_accept;
|
||||
|
||||
PyObject *traceback_module = PyImport_ImportModule("traceback");
|
||||
|
||||
@@ -362,7 +362,8 @@ static int sslrouter_alloc_session(struct uwsgi_corerouter *ucr, struct uwsgi_ga
|
||||
SSL_set_fd(sr->ssl, cs->main_peer->fd);
|
||||
SSL_set_accept_state(sr->ssl);
|
||||
|
||||
uwsgi_cr_set_hooks(cs->main_peer, sr_read, NULL);
|
||||
if (uwsgi_cr_set_hooks(cs->main_peer, sr_read, NULL))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+5
-4
@@ -134,6 +134,7 @@ static int uwsgi_request_xslt(struct wsgi_request *wsgi_req) {
|
||||
size_t stylesheet_len = 0;
|
||||
|
||||
char *params = NULL;
|
||||
xmlDoc *doc = NULL;
|
||||
|
||||
if (uwsgi_parse_vars(wsgi_req)) {
|
||||
return -1;
|
||||
@@ -271,16 +272,16 @@ static int uwsgi_request_xslt(struct wsgi_request *wsgi_req) {
|
||||
return UWSGI_OK;
|
||||
|
||||
apply:
|
||||
if (wsgi_req->query_string_len > 0) {
|
||||
params = uwsgi_concat2n(wsgi_req->query_string, wsgi_req->query_string_len, "", 0);
|
||||
}
|
||||
// we have both the file and the stylesheet, let's run the engine
|
||||
xmlDoc *doc = xmlParseFile(xmlfile);
|
||||
doc = xmlParseFile(xmlfile);
|
||||
free(xmlfile);
|
||||
if (!doc) {
|
||||
uwsgi_500(wsgi_req);
|
||||
return UWSGI_OK;
|
||||
}
|
||||
if (wsgi_req->query_string_len > 0) {
|
||||
params = uwsgi_concat2n(wsgi_req->query_string, wsgi_req->query_string_len, "", 0);
|
||||
}
|
||||
output = uwsgi_xslt_apply(doc, stylesheet, params, &output_rlen);
|
||||
xmlFreeDoc(doc);
|
||||
if (params) free(params);
|
||||
|
||||
+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 = '2013-12-11'
|
||||
s.date = '2013-12-30'
|
||||
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-rc1'
|
||||
uwsgi_version = '2.0'
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
Reference in New Issue
Block a user