]> git.kaiwu.me - nginx.git/commitdiff
Core: fixed ngx_write_chain_to_file() with IOV_MAX reached.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 26 Nov 2012 21:19:57 +0000 (21:19 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 26 Nov 2012 21:19:57 +0000 (21:19 +0000)
Catched by dav_chunked.t on Solaris.  In released versions this might
potentially result in corruption of complex protocol responses if they
were written to disk and there were more distinct buffers than IOV_MAX
in a single write.

src/os/unix/ngx_files.c

index 65d2320b282509893995536dbe9bbbc81a75ae9e..4fdf884fc65c25572f4ddccd344e0399a4e819b9 100644 (file)
@@ -246,6 +246,7 @@ ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *cl, off_t offset,
 
         file->sys_offset += n;
         file->offset += n;
+        offset += n;
         total += n;
 
     } while (cl);