Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_EVENT_PIPE_H_INCLUDED_
0009 #define _NGX_EVENT_PIPE_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 #include <ngx_event.h>
0015 
0016 
0017 typedef struct ngx_event_pipe_s  ngx_event_pipe_t;
0018 
0019 typedef ngx_int_t (*ngx_event_pipe_input_filter_pt)(ngx_event_pipe_t *p,
0020                                                     ngx_buf_t *buf);
0021 typedef ngx_int_t (*ngx_event_pipe_output_filter_pt)(void *data,
0022                                                      ngx_chain_t *chain);
0023 
0024 
0025 struct ngx_event_pipe_s {
0026     ngx_connection_t  *upstream;
0027     ngx_connection_t  *downstream;
0028 
0029     ngx_chain_t       *free_raw_bufs;
0030     ngx_chain_t       *in;
0031     ngx_chain_t      **last_in;
0032 
0033     ngx_chain_t       *writing;
0034 
0035     ngx_chain_t       *out;
0036     ngx_chain_t       *free;
0037     ngx_chain_t       *busy;
0038 
0039     /*
0040      * the input filter i.e. that moves HTTP/1.1 chunks
0041      * from the raw bufs to an incoming chain
0042      */
0043 
0044     ngx_event_pipe_input_filter_pt    input_filter;
0045     void                             *input_ctx;
0046 
0047     ngx_event_pipe_output_filter_pt   output_filter;
0048     void                             *output_ctx;
0049 
0050 #if (NGX_THREADS || NGX_COMPAT)
0051     ngx_int_t                       (*thread_handler)(ngx_thread_task_t *task,
0052                                                       ngx_file_t *file);
0053     void                             *thread_ctx;
0054     ngx_thread_task_t                *thread_task;
0055 #endif
0056 
0057     unsigned           read:1;
0058     unsigned           cacheable:1;
0059     unsigned           single_buf:1;
0060     unsigned           free_bufs:1;
0061     unsigned           upstream_done:1;
0062     unsigned           upstream_error:1;
0063     unsigned           upstream_eof:1;
0064     unsigned           upstream_blocked:1;
0065     unsigned           downstream_done:1;
0066     unsigned           downstream_error:1;
0067     unsigned           cyclic_temp_file:1;
0068     unsigned           aio:1;
0069 
0070     ngx_int_t          allocated;
0071     ngx_bufs_t         bufs;
0072     ngx_buf_tag_t      tag;
0073 
0074     ssize_t            busy_size;
0075 
0076     off_t              read_length;
0077     off_t              length;
0078 
0079     off_t              max_temp_file_size;
0080     ssize_t            temp_file_write_size;
0081 
0082     ngx_msec_t         read_timeout;
0083     ngx_msec_t         send_timeout;
0084     ssize_t            send_lowat;
0085 
0086     ngx_pool_t        *pool;
0087     ngx_log_t         *log;
0088 
0089     ngx_chain_t       *preread_bufs;
0090     size_t             preread_size;
0091     ngx_buf_t         *buf_to_file;
0092 
0093     size_t             limit_rate;
0094     time_t             start_sec;
0095 
0096     ngx_temp_file_t   *temp_file;
0097 
0098     /* STUB */ int     num;
0099 };
0100 
0101 
0102 ngx_int_t ngx_event_pipe(ngx_event_pipe_t *p, ngx_int_t do_write);
0103 ngx_int_t ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf);
0104 ngx_int_t ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b);
0105 
0106 
0107 #endif /* _NGX_EVENT_PIPE_H_INCLUDED_ */