Skip to content

Commit

Permalink
fixed --php-app-bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
substa committed Dec 20, 2012
2 parents e4d5ca9 + 8536bc3 commit 17c8fff
Show file tree
Hide file tree
Showing 71 changed files with 2,316 additions and 2,515 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Expand Up @@ -6,10 +6,7 @@ compiler:

script:
- echo -e "\n\n>>> Building uWSGI binary"
- /usr/bin/python uwsgiconfig.py --build base
- echo -e "\n\n>>> Building python25 plugin"
- /usr/bin/python2.5 -V
- /usr/bin/python2.5 uwsgiconfig.py --plugin plugins/python base python25
- /usr/bin/python uwsgiconfig.py --build travis
- echo -e "\n\n>>> Building python26 plugin"
- /usr/bin/python2.6 -V
- /usr/bin/python2.6 uwsgiconfig.py --plugin plugins/python base python26
Expand Down Expand Up @@ -41,7 +38,7 @@ script:
before_install:
- sudo add-apt-repository -y ppa:fkrull/deadsnakes
- sudo apt-get update -qq
- sudo apt-get install -qqyf python2.5-dev python2.6-dev python2.7-dev python3.1-dev python3.2-dev python3.3-dev rubygems1.8 ruby1.8-dev ruby1.9.1-dev
- sudo apt-get install -qqyf python2.6-dev python2.7-dev python3.1-dev python3.2-dev python3.3-dev rubygems1.8 ruby1.8-dev ruby1.9.1-dev
- sudo apt-get install -qqyf libxml2-dev libpcre3-dev libcap2-dev
- sudo apt-get install -qqyf curl

13 changes: 13 additions & 0 deletions ChangeLog
@@ -1,5 +1,18 @@
*** current ***

* 1.5

- added --not-alarm-log
- support for TCP_FASTOPEN (Linux-only)
- improved emperor reloading
- added --get
- Legion subsystem
- emperor_zeromq plugin
- SNI support
- distributed SSL session cache

*** november 2012 ***

* 1.4

- gevent improvements
Expand Down
3 changes: 3 additions & 0 deletions buildconf/travis.ini
@@ -0,0 +1,3 @@
[uwsgi]
main_plugin =
inherit = base
12 changes: 9 additions & 3 deletions core/alarm.c
Expand Up @@ -136,7 +136,7 @@ static struct uwsgi_alarm_instance *uwsgi_alarm_get_instance(char *name) {
}


static int uwsgi_alarm_log_add(char *alarms, char *regexp) {
static int uwsgi_alarm_log_add(char *alarms, char *regexp, int negate) {

struct uwsgi_alarm_log *old_ual = NULL, *ual = uwsgi.alarm_logs;
while (ual) {
Expand All @@ -148,6 +148,7 @@ static int uwsgi_alarm_log_add(char *alarms, char *regexp) {
if (uwsgi_regexp_build(regexp, &ual->pattern, &ual->pattern_extra)) {
return -1;
}
ual->negate = negate;

if (old_ual) {
old_ual->next = ual;
Expand Down Expand Up @@ -223,7 +224,7 @@ void uwsgi_alarms_init() {
*space = 0;
char *regexp = space + 1;
// here the log-alarm is created
if (uwsgi_alarm_log_add(line, regexp)) {
if (uwsgi_alarm_log_add(line, regexp, usl->custom)) {
uwsgi_log("invalid log-alarm: %s\n", usl->value);
exit(1);
}
Expand All @@ -239,7 +240,12 @@ void uwsgi_alarm_log_check(char *msg, size_t len) {
struct uwsgi_alarm_log *ual = uwsgi.alarm_logs;
while (ual) {
if (uwsgi_regexp_match(ual->pattern, ual->pattern_extra, msg, len) >= 0) {
uwsgi_alarm_log_run(ual, msg, len);
if (!ual->negate) {
uwsgi_alarm_log_run(ual, msg, len);
}
else {
break;
}
}
ual = ual->next;
}
Expand Down
35 changes: 35 additions & 0 deletions core/buffer.c
Expand Up @@ -77,6 +77,41 @@ int uwsgi_buffer_append(struct uwsgi_buffer *ub, char *buf, size_t len) {
return 0;
}

int uwsgi_buffer_u16le(struct uwsgi_buffer *ub, uint16_t num) {
uint8_t buf[2];
buf[0] = (uint8_t) (num & 0xff);
buf[1] = (uint8_t) ((num >> 8) & 0xff);
return uwsgi_buffer_append(ub, (char *) buf, 2);
}

int uwsgi_buffer_num64(struct uwsgi_buffer *ub, int64_t num) {
char buf[sizeof(UMAX64_STR)+1];
int ret = snprintf(buf, sizeof(UMAX64_STR)+1, "%lld", (long long) num);
if (ret <= 0 || ret > (int) (sizeof(UMAX64_STR)+1)) {
return -1;
}
return uwsgi_buffer_append(ub, buf, ret);
}

int uwsgi_buffer_append_keyval(struct uwsgi_buffer *ub, char *key, uint16_t keylen, char *val, uint64_t vallen) {
if (uwsgi_buffer_u16le(ub, keylen)) return -1;
if (uwsgi_buffer_append(ub, key, keylen)) return -1;
if (uwsgi_buffer_u16le(ub, vallen)) return -1;
return uwsgi_buffer_append(ub, val, vallen);
}

int uwsgi_buffer_append_keynum(struct uwsgi_buffer *ub, char *key, uint16_t keylen, int64_t num) {
char buf[sizeof(UMAX64_STR)+1];
int ret = snprintf(buf, (sizeof(UMAX64_STR)+1), "%lld", (long long) num);
if (ret <= 0 || ret > (int) (sizeof(UMAX64_STR)+1)) {
return -1;
}
if (uwsgi_buffer_u16le(ub, keylen)) return -1;
if (uwsgi_buffer_append(ub, key, keylen)) return -1;
if (uwsgi_buffer_u16le(ub, ret)) return -1;
return uwsgi_buffer_append(ub, buf, ret);
}

void uwsgi_buffer_destroy(struct uwsgi_buffer *ub) {
if (ub->buf)
free(ub->buf);
Expand Down

2 comments on commit 17c8fff

@prymitive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks weird, wrong parent in this commit?

@unbit
Copy link
Owner

@unbit unbit commented on 17c8fff Dec 21, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i have made some mess from a customer account. Should be harmful (i hope)

Please sign in to comment.