#include "ngx_http_xslt2_filter_module.h"
#include <download/ngx_http_download_module.h>
Go to the source code of this file.
Functions | |
static void * | ngx_http_xslt2_filter_create_conf (ngx_conf_t *cf) |
Nginx module configuration. | |
static char * | ngx_http_xslt2_filter_merge_conf (ngx_conf_t *cf, void *parent, void *child) |
Nginx module configuration. | |
static ngx_int_t | ngx_http_xslt2_filter_init (ngx_conf_t *cf) |
Filter initialization. | |
static void | ngx_http_xslt2_filter_exit (ngx_cycle_t *cycle) |
Filter exit. | |
static ngx_int_t | ngx_http_xslt2_send (ngx_http_request_t *r, ngx_chain_t *in, ngx_int_t total_len) |
Sends the result to the client. | |
static void | ngx_http_xslt2_cleanup (void *cln_data) |
Release allocated resources from the module and other related. | |
static ngx_int_t | ngx_http_xslt2_header_filter (ngx_http_request_t *r) |
XSLT2 header filter. | |
static ngx_int_t | ngx_http_xslt2_body_filter (ngx_http_request_t *r, ngx_chain_t *in) |
xslt2 body filter. | |
ngx_int_t | ngx_http_xslt2_process_data (ngx_http_request_t *r) |
Processes output data packs. | |
static void | ngx_http_xslt2_fast_handler (ngx_http_request_t *r) |
Pushes the data out to client and finalizes request. | |
ngx_int_t | ngx_http_xslt2_finalize_with_error (ngx_http_request_t *r, ngx_int_t err, char *msg,...) |
Finalizes request and generates an appropriate error page. | |
Variables | |
static ngx_str_t | ngx_http_xslt2_default_types [] |
HTTP content types accepted by XSLT2 module. | |
static ngx_command_t | ngx_http_xslt2_filter_commands [] |
Nginx config file commands configuration. | |
static ngx_http_module_t | ngx_http_xslt2_filter_module_ctx |
Nginx module context. | |
ngx_module_t | ngx_http_xslt2_filter_module |
Nginx module settings. | |
static ngx_http_output_header_filter_pt | ngx_http_next_header_filter |
static ngx_http_output_body_filter_pt | ngx_http_next_body_filter |
static ngx_int_t ngx_http_xslt2_body_filter | ( | ngx_http_request_t * | r, | |
ngx_chain_t * | in | |||
) | [static] |
xslt2 body filter.
If xslt2 enabled then processes input chain. Inputs are shared between the respective modules.
r | nginx http request | |
in | data input chain |
Definition at line 188 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_filter_ctx_t::async, ngx_http_xslt2_filter_ctx_t::done, ngx_http_next_body_filter, ngx_http_xslt2_filter_module, ngx_http_xslt2_xml_add_data_chunk(), ngx_http_xslt2_xml_create_new(), and ngx_http_xslt2_filter_ctx_t::xml_data.
Referenced by ngx_http_xslt2_filter_init().
static void ngx_http_xslt2_cleanup | ( | void * | cln_data | ) | [static] |
Release allocated resources from the module and other related.
cln_data | module context |
Definition at line 329 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_xml_cleanup(), and ngx_http_xslt2_filter_ctx_t::xml_data.
Referenced by ngx_http_xslt2_header_filter().
static void ngx_http_xslt2_fast_handler | ( | ngx_http_request_t * | r | ) | [static] |
Pushes the data out to client and finalizes request.
It's called by nginx core when socket is ready to accept more data.
r | nginx http request |
Definition at line 308 of file ngx_http_xslt2_filter_module.c.
Referenced by ngx_http_xslt2_send().
static void * ngx_http_xslt2_filter_create_conf | ( | ngx_conf_t * | cf | ) | [static] |
Nginx module configuration.
cf | config |
Definition at line 538 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_filter_loc_conf_t::cache_expire, ngx_http_xslt2_filter_loc_conf_t::cache_timeout, ngx_http_xslt2_filter_loc_conf_t::download_timeout, and ngx_http_xslt2_filter_loc_conf_t::enabled.
static void ngx_http_xslt2_filter_exit | ( | ngx_cycle_t * | cycle | ) | [static] |
Filter exit.
cycle | nginx cycle pointer |
Definition at line 612 of file ngx_http_xslt2_filter_module.c.
static ngx_int_t ngx_http_xslt2_filter_init | ( | ngx_conf_t * | cf | ) | [static] |
Filter initialization.
cf | config |
Definition at line 591 of file ngx_http_xslt2_filter_module.c.
References ngx_http_next_body_filter, ngx_http_next_header_filter, ngx_http_xslt2_body_filter(), and ngx_http_xslt2_header_filter().
static char * ngx_http_xslt2_filter_merge_conf | ( | ngx_conf_t * | cf, | |
void * | parent, | |||
void * | child | |||
) | [static] |
Nginx module configuration.
cf | config | |
parent | previous config | |
child | config |
Definition at line 564 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_filter_loc_conf_t::cache_expire, ngx_http_xslt2_filter_loc_conf_t::cache_timeout, ngx_http_xslt2_filter_loc_conf_t::download_timeout, ngx_http_xslt2_filter_loc_conf_t::enabled, ngx_http_xslt2_default_types, ngx_http_xslt2_filter_loc_conf_t::types, and ngx_http_xslt2_filter_loc_conf_t::types_keys.
ngx_int_t ngx_http_xslt2_finalize_with_error | ( | ngx_http_request_t * | r, | |
ngx_int_t | err, | |||
char * | msg, | |||
... | ||||
) |
Finalizes request and generates an appropriate error page.
If err is greater than 0, then the page will be generated with your msg, otherwise the standard nginx 503 page.
r | nginx http request | |
err | error code | |
msg | error page message |
Definition at line 351 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_send().
Referenced by ngx_http_xslt2_xml_add_data_chunk(), ngx_http_xslt2_xml_apply_stylesheets(), ngx_http_xslt2_xml_download_handler(), ngx_http_xslt2_xml_get_external_stylesheet(), ngx_http_xslt2_xml_get_local_stylesheet(), ngx_http_xslt2_xml_mxcache_get_handler(), and ngx_http_xslt2_xml_return_original().
static ngx_int_t ngx_http_xslt2_header_filter | ( | ngx_http_request_t * | r | ) | [static] |
XSLT2 header filter.
If xslt2 enabled captures headers.
r | nginx http request |
Definition at line 135 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_filter_loc_conf_t::enabled, ngx_http_next_header_filter, ngx_http_xslt2_cleanup(), ngx_http_xslt2_filter_module, and ngx_http_xslt2_filter_loc_conf_t::types.
Referenced by ngx_http_xslt2_filter_init().
ngx_int_t ngx_http_xslt2_process_data | ( | ngx_http_request_t * | r | ) |
Processes output data packs.
Passes through the queue and performs actions specific to the data type.
r | nginx http request |
Definition at line 280 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_xml_data_t::buffer_chain, ngx_http_xslt2_xml_data_t::done, ngx_http_xslt2_filter_module, ngx_http_xslt2_send(), ngx_http_xslt2_xml_data_t::res_len, and ngx_http_xslt2_filter_ctx_t::xml_data.
Referenced by ngx_http_xslt2_xml_apply_stylesheets(), and ngx_http_xslt2_xml_return_original().
ngx_int_t ngx_http_xslt2_send | ( | ngx_http_request_t * | r, | |
ngx_chain_t * | in, | |||
ngx_int_t | total_len | |||
) | [static] |
Sends the result to the client.
Configures or runs the fast handler.
r | nginx http request | |
in | data chain | |
total_len | data len |
Definition at line 449 of file ngx_http_xslt2_filter_module.c.
References ngx_http_xslt2_filter_ctx_t::async, ngx_http_xslt2_filter_ctx_t::done, ngx_http_next_body_filter, ngx_http_next_header_filter, ngx_http_xslt2_fast_handler(), and ngx_http_xslt2_filter_module.
Referenced by ngx_http_xslt2_finalize_with_error(), and ngx_http_xslt2_process_data().
ngx_http_output_body_filter_pt ngx_http_next_body_filter [static] |
Definition at line 124 of file ngx_http_xslt2_filter_module.c.
Referenced by ngx_http_xslt2_body_filter(), ngx_http_xslt2_filter_init(), and ngx_http_xslt2_send().
ngx_http_output_header_filter_pt ngx_http_next_header_filter [static] |
Definition at line 123 of file ngx_http_xslt2_filter_module.c.
Referenced by ngx_http_xslt2_filter_init(), ngx_http_xslt2_header_filter(), and ngx_http_xslt2_send().
ngx_str_t ngx_http_xslt2_default_types[] [static] |
{
ngx_string("text/xml"),
ngx_null_string
}
HTTP content types accepted by XSLT2 module.
Definition at line 43 of file ngx_http_xslt2_filter_module.c.
Referenced by ngx_http_xslt2_filter_merge_conf().
ngx_command_t ngx_http_xslt2_filter_commands[] [static] |
Nginx config file commands configuration.
Definition at line 49 of file ngx_http_xslt2_filter_module.c.
ngx_module_t ngx_http_xslt2_filter_module |
{ NGX_MODULE_V1, &ngx_http_xslt2_filter_module_ctx, ngx_http_xslt2_filter_commands, NGX_HTTP_MODULE, NULL, NULL, NULL, NULL, NULL, ngx_http_xslt2_filter_exit, ngx_http_xslt2_filter_exit, NGX_MODULE_V1_PADDING }
Nginx module settings.
Definition at line 105 of file ngx_http_xslt2_filter_module.c.
Referenced by ngx_http_xslt2_body_filter(), ngx_http_xslt2_header_filter(), ngx_http_xslt2_process_data(), and ngx_http_xslt2_send().
ngx_http_module_t ngx_http_xslt2_filter_module_ctx [static] |
{ NULL, ngx_http_xslt2_filter_init, NULL, NULL, NULL, NULL, ngx_http_xslt2_filter_create_conf, ngx_http_xslt2_filter_merge_conf }
Nginx module context.
Definition at line 90 of file ngx_http_xslt2_filter_module.c.