diff options
| author | Vladimir Homutov <vl@nginx.com> | 2016-09-15 14:56:02 +0300 |
|---|---|---|
| committer | Vladimir Homutov <vl@nginx.com> | 2016-09-15 14:56:02 +0300 |
| commit | 704446127e310d8b0a4e9d5ddf655d5684846fce (patch) | |
| tree | f27efe1175a27a05d8d541893536d9eb4e921cf9 /src/stream/ngx_stream.h | |
| parent | 05a455ff21aa7afd938bd45444e5d9c6d42b6c4c (diff) | |
| download | nginx-704446127e310d8b0a4e9d5ddf655d5684846fce.tar.gz nginx-704446127e310d8b0a4e9d5ddf655d5684846fce.tar.bz2 | |
Stream: preread phase.
In this phase, head of a stream is read and analysed before proceeding to the
content phase. Amount of data read is controlled by the module implementing
the phase, but not more than defined by the "preread_buffer_size" directive.
The time spent on processing preread is controlled by the "preread_timeout"
directive.
The typical preread phase module will parse the beginning of a stream and set
variable that may be used by the content phase, for example to make routing
decision.
Diffstat (limited to '')
| -rw-r--r-- | src/stream/ngx_stream.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stream/ngx_stream.h b/src/stream/ngx_stream.h index 0aded1691..deca8ae62 100644 --- a/src/stream/ngx_stream.h +++ b/src/stream/ngx_stream.h @@ -122,6 +122,7 @@ typedef enum { #if (NGX_STREAM_SSL) NGX_STREAM_SSL_PHASE, #endif + NGX_STREAM_PREREAD_PHASE, NGX_STREAM_CONTENT_PHASE, NGX_STREAM_LOG_PHASE } ngx_stream_phases; @@ -181,6 +182,8 @@ typedef struct { ngx_uint_t line; ngx_flag_t tcp_nodelay; + size_t preread_buffer_size; + ngx_msec_t preread_timeout; ngx_log_t *error_log; @@ -280,6 +283,8 @@ typedef struct { void ngx_stream_core_run_phases(ngx_stream_session_t *s); ngx_int_t ngx_stream_core_generic_phase(ngx_stream_session_t *s, ngx_stream_phase_handler_t *ph); +ngx_int_t ngx_stream_core_preread_phase(ngx_stream_session_t *s, + ngx_stream_phase_handler_t *ph); ngx_int_t ngx_stream_core_content_phase(ngx_stream_session_t *s, ngx_stream_phase_handler_t *ph); |
