src/http/modules/xslt2/ngx_http_xslt2_filter_module.c File Reference

#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

Function Documentation

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.

Parameters:
r nginx http request
in data input chain
Returns:
NGX_OK or NGX_ERROR in case of error

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.

Parameters:
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.

Parameters:
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]
static void ngx_http_xslt2_filter_exit ( ngx_cycle_t *  cycle  )  [static]

Filter exit.

Parameters:
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.

Parameters:
cf config
Returns:
NGX_OK

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]
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.

Parameters:
r nginx http request
err error code
msg error page message
Returns:
NGX_ERROR

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.

Parameters:
r nginx http request
Returns:
NGX_*

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.

Parameters:
r nginx http request
Returns:
NGX_OK if all data processed, NGX_ERROR on error, or NGX_DONE if not all data are ready

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.

Parameters:
r nginx http request
in data chain
total_len data len
Returns:
result of ngx_http_next_body_filter

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().


Variable Documentation

ngx_http_output_body_filter_pt ngx_http_next_body_filter [static]
ngx_http_output_header_filter_pt ngx_http_next_header_filter [static]
ngx_str_t ngx_http_xslt2_default_types[] [static]
Initial value:
 {
        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.

Initial value:
 {
        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]
Initial value:

Nginx module context.

Definition at line 90 of file ngx_http_xslt2_filter_module.c.


Generated on Mon Oct 12 14:03:36 2009 for XXSLT by  doxygen 1.6.1