Mercurial > hg > nginx
annotate auto/lib/libxslt/conf @ 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 | f7e79596baf2 |
children |
rev | line source |
---|---|
2139 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
2139 | 4 |
5 | |
6 ngx_feature="libxslt" | |
7 ngx_feature_name= | |
8 ngx_feature_run=no | |
9 ngx_feature_incs="#include <libxml/parser.h> | |
10 #include <libxml/tree.h> | |
11 #include <libxslt/xslt.h> | |
12 #include <libxslt/xsltInternals.h> | |
13 #include <libxslt/transform.h> | |
14 #include <libxslt/xsltutils.h>" | |
15 ngx_feature_path="/usr/include/libxml2" | |
16 ngx_feature_libs="-lxml2 -lxslt" | |
17 ngx_feature_test="xmlParserCtxtPtr ctxt = NULL; | |
18 xsltStylesheetPtr sheet = NULL; | |
7327
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
6383
diff
changeset
|
19 xmlDocPtr doc = NULL; |
f7e79596baf2
Configure: fixed compiler warnings with "-Wall -Wextra".
Sergey Kandaurov <pluknet@nginx.com>
parents:
6383
diff
changeset
|
20 xmlParseChunk(ctxt, NULL, 0, 0); |
2139 | 21 xsltApplyStylesheet(sheet, doc, NULL);" |
22 . auto/feature | |
23 | |
24 | |
25 if [ $ngx_found = no ]; then | |
26 | |
27 # FreeBSD port | |
28 | |
29 ngx_feature="libxslt in /usr/local/" | |
30 ngx_feature_path="/usr/local/include/libxml2 /usr/local/include" | |
31 | |
32 if [ $NGX_RPATH = YES ]; then | |
33 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lxml2 -lxslt" | |
34 else | |
35 ngx_feature_libs="-L/usr/local/lib -lxml2 -lxslt" | |
36 fi | |
37 | |
38 . auto/feature | |
39 fi | |
40 | |
41 | |
42 if [ $ngx_found = no ]; then | |
43 | |
44 # NetBSD port | |
45 | |
46 ngx_feature="libxslt in /usr/pkg/" | |
47 ngx_feature_path="/usr/pkg/include/libxml2 /usr/pkg/include" | |
48 | |
49 if [ $NGX_RPATH = YES ]; then | |
50 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lxml2 -lxslt" | |
51 else | |
52 ngx_feature_libs="-L/usr/pkg/lib -lxml2 -lxslt" | |
53 fi | |
54 | |
55 . auto/feature | |
56 fi | |
57 | |
58 | |
59 if [ $ngx_found = no ]; then | |
60 | |
61 # MacPorts | |
62 | |
63 ngx_feature="libxslt in /opt/local/" | |
64 ngx_feature_path="/opt/local/include/libxml2 /opt/local/include" | |
65 | |
66 if [ $NGX_RPATH = YES ]; then | |
67 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lxml2 -lxslt" | |
68 else | |
69 ngx_feature_libs="-L/opt/local/lib -lxml2 -lxslt" | |
70 fi | |
71 | |
72 . auto/feature | |
73 fi | |
74 | |
75 | |
76 if [ $ngx_found = yes ]; then | |
2173 | 77 |
2139 | 78 CORE_INCS="$CORE_INCS $ngx_feature_path" |
6383 | 79 |
80 if [ $USE_LIBXSLT = YES ]; then | |
81 CORE_LIBS="$CORE_LIBS $ngx_feature_libs" | |
82 fi | |
83 | |
84 NGX_LIB_LIBXSLT=$ngx_feature_libs | |
2173 | 85 |
86 else | |
87 | |
88 cat << END | |
89 | |
90 $0: error: the HTTP XSLT module requires the libxml2/libxslt | |
91 libraries. You can either do not enable the module or install the libraries. | |
92 | |
93 END | |
94 | |
95 exit 1 | |
2139 | 96 fi |
2299 | 97 |
98 | |
99 ngx_feature="libexslt" | |
100 ngx_feature_name=NGX_HAVE_EXSLT | |
101 ngx_feature_run=no | |
102 ngx_feature_incs="#include <libexslt/exslt.h>" | |
103 ngx_feature_path="/usr/include/libxml2" | |
104 ngx_feature_libs="-lexslt" | |
105 ngx_feature_test="exsltRegisterAll();" | |
106 . auto/feature | |
107 | |
108 if [ $ngx_found = no ]; then | |
109 | |
110 # FreeBSD port | |
111 | |
112 ngx_feature="libexslt in /usr/local/" | |
113 ngx_feature_path="/usr/local/include/libxml2 /usr/local/include" | |
114 | |
115 if [ $NGX_RPATH = YES ]; then | |
116 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lexslt" | |
117 else | |
118 ngx_feature_libs="-L/usr/local/lib -lexslt" | |
119 fi | |
120 | |
121 . auto/feature | |
122 fi | |
123 | |
124 | |
125 if [ $ngx_found = no ]; then | |
126 | |
127 # NetBSD port | |
128 | |
129 ngx_feature="libexslt in /usr/pkg/" | |
130 ngx_feature_path="/usr/pkg/include/libxml2 /usr/local/include" | |
131 | |
132 if [ $NGX_RPATH = YES ]; then | |
133 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lexslt" | |
134 else | |
135 ngx_feature_libs="-L/usr/pkg/lib -lexslt" | |
136 fi | |
137 | |
138 . auto/feature | |
139 fi | |
140 | |
141 | |
142 if [ $ngx_found = no ]; then | |
143 | |
144 # MacPorts | |
145 | |
146 ngx_feature="libexslt in /opt/local/" | |
147 ngx_feature_path="/opt/local/include/libxml2 /opt/local/include" | |
148 | |
149 if [ $NGX_RPATH = YES ]; then | |
150 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lexslt" | |
151 else | |
152 ngx_feature_libs="-L/opt/local/lib -lexslt" | |
153 fi | |
154 | |
155 . auto/feature | |
156 fi | |
157 | |
158 | |
159 if [ $ngx_found = yes ]; then | |
6383 | 160 if [ $USE_LIBXSLT = YES ]; then |
161 CORE_LIBS="$CORE_LIBS -lexslt" | |
162 fi | |
163 | |
164 NGX_LIB_LIBXSLT="$NGX_LIB_LIBXSLT -lexslt" | |
2299 | 165 fi |