]> git.kaiwu.me - nginx.git/commit
FastCGI: adjust buffer position when parsing incomplete records.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 9 Nov 2017 12:35:20 +0000 (15:35 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 9 Nov 2017 12:35:20 +0000 (15:35 +0300)
commitcfc8c28259b3fd59f2517ac4830a08e8a9925148
tree7f15156012d59a724150cb300a238e9e5c952480
parent9cb9ce78b1d81ccdbcd123ccc3dab295b836a174
FastCGI: adjust buffer position when parsing incomplete records.

Previously, nginx failed to move buffer position when parsing an incomplete
record header, and due to this wasn't be able to continue parsing once
remaining bytes of the record header were received.

This can affect response header parsing, potentially generating spurious errors
like "upstream sent unexpected FastCGI request id high byte: 1 while reading
response header from upstream".  While this is very unlikely, since usually
record headers are written in a single buffer, this still can happen in real
life, for example, if a record header will be split across two TCP packets
and the second packet will be delayed.

This does not affect non-buffered response body proxying, due to "buf->pos =
buf->last;" at the start of the ngx_http_fastcgi_non_buffered_filter()
function.  Also this does not affect buffered response body proxying, as
each input buffer is only passed to the filter once.
src/http/modules/ngx_http_fastcgi_module.c