annotate docs/text/LICENSE @ 4195:35f4997c08ce

Fix for socket leak with "aio sendfile" and "limit_rate". Second aio post happened when timer set by limit_rate expired while we have aio request in flight, resulting in "second aio post" alert and socket leak. The patch adds actual protection from aio calls with r->aio already set to aio sendfile code in ngx_http_copy_filter(). This should fix other cases as well, e.g. when sending buffered to disk upstream replies while still talking to upstream. The ngx_http_writer() is also fixed to handle the above case (though it's mostly optimization now). Reported by Oleksandr V. Typlyns'kyi.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 11 Oct 2011 18:00:23 +0000
parents 1df5620b9cd6
children 618e4c2f4acd 4919fb357a5d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1 /*
3847
1df5620b9cd6 2011 year
Igor Sysoev <igor@sysoev.ru>
parents: 3407
diff changeset
2 * Copyright (C) 2002-2011 Igor Sysoev
450
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 *
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 * Redistribution and use in source and binary forms, with or without
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 * modification, are permitted provided that the following conditions
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 * are met:
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 * 1. Redistributions of source code must retain the above copyright
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 * notice, this list of conditions and the following disclaimer.
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 * 2. Redistributions in binary form must reproduce the above copyright
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer in the
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 * documentation and/or other materials provided with the distribution.
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 *
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 * SUCH DAMAGE.
551102312e19 nginx-0.1.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 */