Skip to content

Commit

Permalink
fixed stupid bug in wsgi.input readline
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto@goyle committed Jun 22, 2011
1 parent 27b86f1 commit 41f2982
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/python/wsgi_handlers.c
Expand Up @@ -44,8 +44,9 @@ PyObject *uwsgi_Input_getline(uwsgi_Input *self) {
return res;
}
}
res = PyString_FromStringAndSize(ptr + self->readline_pos, self->readline_size - self->readline_pos);
self->readline_pos = 0;
return PyString_FromStringAndSize(ptr + self->readline_pos, self->readline_size - self->readline_pos);
return res;
}


Expand Down Expand Up @@ -74,7 +75,7 @@ PyObject *uwsgi_Input_getline(uwsgi_Input *self) {

for(i=0;i<(size_t)rlen;i++) {
if (self->readline[i] == '\n') {
res = PyString_FromStringAndSize(self->readline, i);
res = PyString_FromStringAndSize(self->readline, i+1);
self->readline_pos+= i+1;
if (self->readline_pos >= self->readline_size) self->readline_pos = 0;
return res;
Expand Down

0 comments on commit 41f2982

Please sign in to comment.