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_HTTP_SSI_FILTER_H_INCLUDED_
0009 #define _NGX_HTTP_SSI_FILTER_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 #include <ngx_http.h>
0015 
0016 
0017 #define NGX_HTTP_SSI_MAX_PARAMS       16
0018 
0019 #define NGX_HTTP_SSI_COMMAND_LEN      32
0020 #define NGX_HTTP_SSI_PARAM_LEN        32
0021 #define NGX_HTTP_SSI_PARAMS_N         4
0022 
0023 
0024 #define NGX_HTTP_SSI_COND_IF          1
0025 #define NGX_HTTP_SSI_COND_ELSE        2
0026 
0027 
0028 #define NGX_HTTP_SSI_NO_ENCODING      0
0029 #define NGX_HTTP_SSI_URL_ENCODING     1
0030 #define NGX_HTTP_SSI_ENTITY_ENCODING  2
0031 
0032 
0033 typedef struct {
0034     ngx_hash_t                hash;
0035     ngx_hash_keys_arrays_t    commands;
0036 } ngx_http_ssi_main_conf_t;
0037 
0038 
0039 typedef struct {
0040     ngx_buf_t                *buf;
0041 
0042     u_char                   *pos;
0043     u_char                   *copy_start;
0044     u_char                   *copy_end;
0045 
0046     ngx_uint_t                key;
0047     ngx_str_t                 command;
0048     ngx_array_t               params;
0049     ngx_table_elt_t          *param;
0050     ngx_table_elt_t           params_array[NGX_HTTP_SSI_PARAMS_N];
0051 
0052     ngx_chain_t              *in;
0053     ngx_chain_t              *out;
0054     ngx_chain_t             **last_out;
0055     ngx_chain_t              *busy;
0056     ngx_chain_t              *free;
0057 
0058     ngx_uint_t                state;
0059     ngx_uint_t                saved_state;
0060     size_t                    saved;
0061     size_t                    looked;
0062 
0063     size_t                    value_len;
0064 
0065     ngx_list_t               *variables;
0066     ngx_array_t              *blocks;
0067 
0068 #if (NGX_PCRE)
0069     ngx_uint_t                ncaptures;
0070     int                      *captures;
0071     u_char                   *captures_data;
0072 #endif
0073 
0074     unsigned                  conditional:2;
0075     unsigned                  encoding:2;
0076     unsigned                  block:1;
0077     unsigned                  output:1;
0078     unsigned                  output_chosen:1;
0079 
0080     ngx_http_request_t       *wait;
0081     void                     *value_buf;
0082     ngx_str_t                 timefmt;
0083     ngx_str_t                 errmsg;
0084 } ngx_http_ssi_ctx_t;
0085 
0086 
0087 typedef ngx_int_t (*ngx_http_ssi_command_pt) (ngx_http_request_t *r,
0088     ngx_http_ssi_ctx_t *ctx, ngx_str_t **);
0089 
0090 
0091 typedef struct {
0092     ngx_str_t                 name;
0093     ngx_uint_t                index;
0094 
0095     unsigned                  mandatory:1;
0096     unsigned                  multiple:1;
0097 } ngx_http_ssi_param_t;
0098 
0099 
0100 typedef struct {
0101     ngx_str_t                 name;
0102     ngx_http_ssi_command_pt   handler;
0103     ngx_http_ssi_param_t     *params;
0104 
0105     unsigned                  conditional:2;
0106     unsigned                  block:1;
0107     unsigned                  flush:1;
0108 } ngx_http_ssi_command_t;
0109 
0110 
0111 extern ngx_module_t  ngx_http_ssi_filter_module;
0112 
0113 
0114 #endif /* _NGX_HTTP_SSI_FILTER_H_INCLUDED_ */