post file upload: dont lose sight of end of upload just because we hit end of incoming post data
This commit is contained in:
parent
9d061e1efd
commit
56826dbfd7
1 changed files with 3 additions and 2 deletions
|
@ -2203,13 +2203,14 @@ static int
|
|||
lws_urldecode_s_process(struct lws_urldecode_stateful *s, const char *in, int len)
|
||||
{
|
||||
int n, m, hit = 0;
|
||||
char sum = 0, c;
|
||||
char sum = 0, c, was_end = 0;
|
||||
|
||||
while (len--) {
|
||||
if (s->pos == s->out_len - s->mp - 1) {
|
||||
if (s->output(s->data, s->name, &s->out, s->pos, 0))
|
||||
return -1;
|
||||
|
||||
was_end = s->pos;
|
||||
s->pos = 0;
|
||||
}
|
||||
switch (s->state) {
|
||||
|
@ -2295,7 +2296,7 @@ retry_as_first:
|
|||
s->mp = 0;
|
||||
s->state = MT_IGNORE1;
|
||||
|
||||
if (s->pos)
|
||||
if (s->pos || was_end)
|
||||
if (s->output(s->data, s->name,
|
||||
&s->out, s->pos, 1))
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue