Mercurial > hg > nginx-site
comparison xml/en/docs/dev/development_guide.xml @ 2422:eca8e37a34ef
Fixed typos.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Tue, 20 Aug 2019 17:21:27 +0300 |
parents | bd026d5898b8 |
children | 621ffbc159b6 |
comparison
equal
deleted
inserted
replaced
2421:d741fcb6d36c | 2422:eca8e37a34ef |
---|---|
658 /* some error */ | 658 /* some error */ |
659 ngx_log_error(NGX_LOG_ALERT, log, 0, ngx_regex_exec_n " failed: %i", n); | 659 ngx_log_error(NGX_LOG_ALERT, log, 0, ngx_regex_exec_n " failed: %i", n); |
660 } | 660 } |
661 </programlisting> | 661 </programlisting> |
662 The arguments to <literal>ngx_regex_exec()</literal> are the compiled regular | 662 The arguments to <literal>ngx_regex_exec()</literal> are the compiled regular |
663 expression <literal>re</literal>, the string to match <literal>s</literal>, | 663 expression <literal>re</literal>, the string to match <literal>input</literal>, |
664 an optional array of integers to hold any <literal>captures</literal> that are | 664 an optional array of integers to hold any <literal>captures</literal> that are |
665 found, and the array's <literal>size</literal>. | 665 found, and the array's <literal>size</literal>. |
666 The size of the <literal>captures</literal> array must be a multiple of three, | 666 The size of the <literal>captures</literal> array must be a multiple of three, |
667 as required by the | 667 as required by the |
668 <link url="http://www.pcre.org/original/doc/html/pcreapi.html">PCRE API</link>. | 668 <link url="http://www.pcre.org/original/doc/html/pcreapi.html">PCRE API</link>. |
669 In the example, the size is calculated from the total number of captures plus | 669 In the example, the size is calculated from the total number of captures plus |
670 <literal>1</literal>one for the matched string itself. | 670 one for the matched string itself. |
671 </para> | 671 </para> |
672 | 672 |
673 <para> | 673 <para> |
674 If there are matches, captures can be accessed as follows: | 674 If there are matches, captures can be accessed as follows: |
675 <programlisting> | 675 <programlisting> |
1286 integer key from a string. | 1286 integer key from a string. |
1287 There are two generic key-creation functions: | 1287 There are two generic key-creation functions: |
1288 <literal>ngx_hash_key(data, len)</literal> and | 1288 <literal>ngx_hash_key(data, len)</literal> and |
1289 <literal>ngx_hash_key_lc(data, len)</literal>. | 1289 <literal>ngx_hash_key_lc(data, len)</literal>. |
1290 The latter converts a string to all lowercase characters, so the passed string | 1290 The latter converts a string to all lowercase characters, so the passed string |
1291 must be writeable. | 1291 must be writable. |
1292 If that is not true, pass the <literal>NGX_HASH_READONLY_KEY</literal> flag | 1292 If that is not true, pass the <literal>NGX_HASH_READONLY_KEY</literal> flag |
1293 to the function, initializing the key array (see below). | 1293 to the function, initializing the key array (see below). |
1294 </para> | 1294 </para> |
1295 | 1295 |
1296 <para> | 1296 <para> |
2613 An event can be posted which means that its handler will be called at some | 2613 An event can be posted which means that its handler will be called at some |
2614 point later within the current event loop iteration. | 2614 point later within the current event loop iteration. |
2615 Posting events is a good practice for simplifying code and escaping stack | 2615 Posting events is a good practice for simplifying code and escaping stack |
2616 overflows. | 2616 overflows. |
2617 Posted events are held in a post queue. | 2617 Posted events are held in a post queue. |
2618 The <literal>ngx_post_event(ev, q)</literal> mscro posts the event | 2618 The <literal>ngx_post_event(ev, q)</literal> macro posts the event |
2619 <literal>ev</literal> to the post queue <literal>q</literal>. | 2619 <literal>ev</literal> to the post queue <literal>q</literal>. |
2620 The <literal>ngx_delete_posted_event(ev)</literal> macro deletes the event | 2620 The <literal>ngx_delete_posted_event(ev)</literal> macro deletes the event |
2621 <literal>ev</literal> from the queue it's currently posted in. | 2621 <literal>ev</literal> from the queue it's currently posted in. |
2622 Normally, events are posted to the <literal>ngx_posted_events</literal> queue, | 2622 Normally, events are posted to the <literal>ngx_posted_events</literal> queue, |
2623 which is processed late in the event loop — after all I/O and timer | 2623 which is processed late in the event loop — after all I/O and timer |
3809 <list type="bullet"> | 3809 <list type="bullet"> |
3810 | 3810 |
3811 <listitem> | 3811 <listitem> |
3812 <literal>ngx_event_accept()</literal> accepts a client TCP connection. | 3812 <literal>ngx_event_accept()</literal> accepts a client TCP connection. |
3813 This handler is called in response to a read notification on a listen socket. | 3813 This handler is called in response to a read notification on a listen socket. |
3814 A new <literal>ngx_connecton_t</literal> object is created at this stage | 3814 A new <literal>ngx_connection_t</literal> object is created at this stage |
3815 to wrap the newly accepted client socket. | 3815 to wrap the newly accepted client socket. |
3816 Each nginx listener provides a handler to pass the new connection object to. | 3816 Each nginx listener provides a handler to pass the new connection object to. |
3817 For HTTP connections it's <literal>ngx_http_init_connection(c)</literal>. | 3817 For HTTP connections it's <literal>ngx_http_init_connection(c)</literal>. |
3818 </listitem> | 3818 </listitem> |
3819 | 3819 |