annotate auto/lib/make @ 7583:efd71d49bde0

Events: available bytes calculation via ioctl(FIONREAD). This makes it possible to avoid looping for a long time while working with a fast enough peer when data are added to the socket buffer faster than we are able to read and process them (ticket #1431). This is basically what we already do on FreeBSD with kqueue, where information about the number of bytes in the socket buffer is returned by the kevent() call. With other event methods rev->available is now set to -1 when the socket is ready for reading. Later in ngx_recv() and ngx_recv_chain(), if full buffer is received, real number of bytes in the socket buffer is retrieved using ioctl(FIONREAD). Reading more than this number of bytes ensures that even with edge-triggered event methods the event will be triggered again, so it is safe to stop processing of the socket and switch to other connections. Using ioctl(FIONREAD) only after reading a full buffer is an optimization. With this approach we only call ioctl(FIONREAD) when there are at least two recv()/readv() calls.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 17 Oct 2019 16:02:19 +0300
parents 9eefb38f0005
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
444
42d11f017717 nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents: 399
diff changeset
1
42d11f017717 nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents: 399
diff changeset
2 # Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 3363
diff changeset
3 # Copyright (C) Nginx, Inc.
444
42d11f017717 nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents: 399
diff changeset
4
286
fc8dc489247e nginx-0.0.2-2004-03-12-00:34:52 import
Igor Sysoev <igor@sysoev.ru>
parents: 282
diff changeset
5
320
d621239c30f7 nginx-0.0.3-2004-04-18-23:06:02 import
Igor Sysoev <igor@sysoev.ru>
parents: 297
diff changeset
6 if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then
286
fc8dc489247e nginx-0.0.2-2004-03-12-00:34:52 import
Igor Sysoev <igor@sysoev.ru>
parents: 282
diff changeset
7 . auto/lib/pcre/make
fc8dc489247e nginx-0.0.2-2004-03-12-00:34:52 import
Igor Sysoev <igor@sysoev.ru>
parents: 282
diff changeset
8 fi
195
8dee38ea9117 nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9
399
4e21d1291a14 nginx-0.0.7-2004-07-25-22:34:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 320
diff changeset
10 if [ $OPENSSL != NONE -a $OPENSSL != NO -a $OPENSSL != YES ]; then
4e21d1291a14 nginx-0.0.7-2004-07-25-22:34:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 320
diff changeset
11 . auto/lib/openssl/make
4e21d1291a14 nginx-0.0.7-2004-07-25-22:34:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 320
diff changeset
12 fi
4e21d1291a14 nginx-0.0.7-2004-07-25-22:34:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 320
diff changeset
13
320
d621239c30f7 nginx-0.0.3-2004-04-18-23:06:02 import
Igor Sysoev <igor@sysoev.ru>
parents: 297
diff changeset
14 if [ $ZLIB != NONE -a $ZLIB != NO -a $ZLIB != YES ]; then
282
30310107dbc9 nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents: 274
diff changeset
15 . auto/lib/zlib/make
30310107dbc9 nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents: 274
diff changeset
16 fi
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
17
3363
b4aa418af6ef libatomic_ops support
Igor Sysoev <igor@sysoev.ru>
parents: 653
diff changeset
18 if [ $NGX_LIBATOMIC != NO -a $NGX_LIBATOMIC != YES ]; then
b4aa418af6ef libatomic_ops support
Igor Sysoev <igor@sysoev.ru>
parents: 653
diff changeset
19 . auto/lib/libatomic/make
b4aa418af6ef libatomic_ops support
Igor Sysoev <igor@sysoev.ru>
parents: 653
diff changeset
20 fi
b4aa418af6ef libatomic_ops support
Igor Sysoev <igor@sysoev.ru>
parents: 653
diff changeset
21
6419
39a806ccf21e Dynamic modules: perl.
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
22 if [ $USE_PERL != NO ]; then
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
23 . auto/lib/perl/make
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
24 fi