annotate auto/cc/acc @ 6949:ff0c8e11edbc

Simplified and improved sendfile() code on Linux. The ngx_linux_sendfile() function is now used for both normal sendfile() and sendfile in threads. The ngx_linux_sendfile_thread() function was modified to use the same interface as ngx_linux_sendfile(), and is simply called from ngx_linux_sendfile() when threads are enabled. Special return code NGX_DONE is used to indicate that a thread task was posted and no further actions are needed. If number of bytes sent is less that what we were sending, we now always retry sending. This is needed for sendfile() in threads as the number of bytes we are sending might have been changed since the thread task was posted. And this is also needed for Linux 4.3+, as sendfile() might be interrupted at any time and provides no indication if it was interrupted or not (ticket #1174).
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 28 Mar 2017 18:15:39 +0300
parents 9eefb38f0005
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
515
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 # Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 515
diff changeset
3 # Copyright (C) Nginx, Inc.
515
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 # aCC: HP ANSI C++ B3910B A.03.55.02
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 # C89 mode
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 CFLAGS="$CFLAGS -Ae"
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 CC_TEST_FLAGS="-Ae"
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 PCRE_OPT="$PCRE_OPT -Ae"
417a087c9c4d nginx-0.1.32-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 ZLIB_OPT="$ZLIB_OPT -Ae"