Skip to content

Commit

Permalink
refactored post limit management
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto@natty32 committed Apr 5, 2011
1 parent 703cad6 commit b0db67d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions plugins/python/wsgi_handlers.c
Expand Up @@ -266,14 +266,6 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) {
}


if (uwsgi.limit_post) {
if (wsgi_req->post_cl > uwsgi.limit_post) {
uwsgi_log("Invalid (too big) CONTENT_LENGTH. skip.\n");
return -1;
}
}


if (!up.ignore_script_name) {

if (!wsgi_req->script_name)
Expand Down
7 changes: 7 additions & 0 deletions protocol.c
Expand Up @@ -675,6 +675,13 @@ int uwsgi_parse_vars(struct wsgi_request *wsgi_req) {
}
else if (!uwsgi_strncmp("CONTENT_LENGTH", 14, wsgi_req->hvec[wsgi_req->var_cnt].iov_base, wsgi_req->hvec[wsgi_req->var_cnt].iov_len)) {
wsgi_req->post_cl = get_content_length(ptrbuf, strsize);
if (uwsgi.limit_post) {
if (wsgi_req->post_cl > uwsgi.limit_post) {
uwsgi_log("Invalid (too big) CONTENT_LENGTH. skip.\n");
return -1;
}
}

}

if (wsgi_req->var_cnt < uwsgi.vec_size - (4 + 1)) {
Expand Down

0 comments on commit b0db67d

Please sign in to comment.