annotate docs/html/index.html @ 6893:a3e6d660b179 stable-1.10

Fixed trailer construction with limit on FreeBSD and macOS. The ngx_chain_coalesce_file() function may produce more bytes to send then requested in the limit passed, as it aligns the last file position to send to memory page boundary. As a result, (limit - send) may become negative. This resulted in big positive number when converted to size_t while calling ngx_output_chain_to_iovec(). Another part of the problem is in ngx_chain_coalesce_file(): it changes cl to the next chain link even if the current buffer is only partially sent due to limit. Therefore, if a file buffer was not expected to be fully sent due to limit, and was followed by a memory buffer, nginx called sendfile() with a part of the file buffer, and the memory buffer in trailer. If there were enough room in the socket buffer, this resulted in a part of the file buffer being skipped, and corresponding part of the memory buffer sent instead. The bug was introduced in 8e903522c17a (1.7.8). Configurations affected are ones using limits, that is, limit_rate and/or sendfile_max_chunk, and memory buffers after file ones (may happen when using subrequests or with proxying with disk buffering). Fix is to explicitly check if (send < limit) before constructing trailer with ngx_output_chain_to_iovec(). Additionally, ngx_chain_coalesce_file() was modified to preserve unfinished file buffers in cl.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 20 Jan 2017 21:12:48 +0300
parents ed470a7bf7fd
children 67c68cd973b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4834
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
1 <!DOCTYPE html>
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 <html>
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 <head>
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 <title>Welcome to nginx!</title>
4834
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
5 <style>
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
6 body {
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
7 width: 35em;
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
8 margin: 0 auto;
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
9 font-family: Tahoma, Verdana, Arial, sans-serif;
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
10 }
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
11 </style>
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 </head>
4834
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
13 <body>
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
14 <h1>Welcome to nginx!</h1>
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
15 <p>If you see this page, the nginx web server is successfully installed and
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
16 working. Further configuration is required.</p>
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
17
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
18 <p>For online documentation and support please refer to
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
19 <a href="http://nginx.org/">nginx.org</a>.<br/>
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
20 Commercial support is available at
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
21 <a href="http://nginx.com/">nginx.com</a>.</p>
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
22
ed470a7bf7fd Improved welcome page.
Valentin Bartenev <vbart@nginx.com>
parents: 450
diff changeset
23 <p><em>Thank you for using nginx.</em></p>
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 </body>
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 </html>