Browse Source

[core] fix chunked decoding from backend (fixes #3044)

(thx flynn)

x-ref:
  "Socket errors after update to version 1.4.56"
  https://redmine.lighttpd.net/issues/3044
master
Glenn Strauss 1 year ago
parent
commit
163cb8be28
  1. 9
      src/http_chunk.c

9
src/http_chunk.c

@ -420,6 +420,7 @@ http_chunk_decode_append_data (request_st * const r, const char *mem, off_t len)
len -= hsz;
te_chunked += 2; /*(for trailing "\r\n" after chunked data)*/
if (0 == len) break;
}
if (te_chunked >= 2) {
@ -437,7 +438,13 @@ http_chunk_decode_append_data (request_st * const r, const char *mem, off_t len)
len -= 2;
te_chunked = 0;
}
else if (len == 1 && mem[0] != '\r') return -1;
else if (len == 1) {
if (mem[0] != '\r') return -1;
/*++mem;*/
/*--len;*/
te_chunked = 1;
break;
}
}
}
else if (1 == te_chunked) {

Loading…
Cancel
Save