mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Modules compatibility: compatibility with NGX_HAVE_FILE_AIO.
With this change it is now possible to load modules compiled without the "--with-file-aio" configure option into nginx binary compiled with it, and vice versa, assuming both use the "--with-compat" option.
This commit is contained in:
parent
9f6e8673f4
commit
844c78556b
@ -72,10 +72,8 @@ typedef struct ngx_output_chain_ctx_s ngx_output_chain_ctx_t;
|
|||||||
|
|
||||||
typedef ngx_int_t (*ngx_output_chain_filter_pt)(void *ctx, ngx_chain_t *in);
|
typedef ngx_int_t (*ngx_output_chain_filter_pt)(void *ctx, ngx_chain_t *in);
|
||||||
|
|
||||||
#if (NGX_HAVE_FILE_AIO)
|
|
||||||
typedef void (*ngx_output_chain_aio_pt)(ngx_output_chain_ctx_t *ctx,
|
typedef void (*ngx_output_chain_aio_pt)(ngx_output_chain_ctx_t *ctx,
|
||||||
ngx_file_t *file);
|
ngx_file_t *file);
|
||||||
#endif
|
|
||||||
|
|
||||||
struct ngx_output_chain_ctx_s {
|
struct ngx_output_chain_ctx_s {
|
||||||
ngx_buf_t *buf;
|
ngx_buf_t *buf;
|
||||||
@ -90,9 +88,9 @@ struct ngx_output_chain_ctx_s {
|
|||||||
unsigned need_in_temp:1;
|
unsigned need_in_temp:1;
|
||||||
unsigned aio:1;
|
unsigned aio:1;
|
||||||
|
|
||||||
#if (NGX_HAVE_FILE_AIO)
|
#if (NGX_HAVE_FILE_AIO || NGX_COMPAT)
|
||||||
ngx_output_chain_aio_pt aio_handler;
|
ngx_output_chain_aio_pt aio_handler;
|
||||||
#if (NGX_HAVE_AIO_SENDFILE)
|
#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
|
||||||
ssize_t (*aio_preload)(ngx_buf_t *file);
|
ssize_t (*aio_preload)(ngx_buf_t *file);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -182,7 +182,7 @@ struct ngx_connection_s {
|
|||||||
|
|
||||||
unsigned need_last_buf:1;
|
unsigned need_last_buf:1;
|
||||||
|
|
||||||
#if (NGX_HAVE_AIO_SENDFILE)
|
#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
|
||||||
unsigned busy_count:2;
|
unsigned busy_count:2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ struct ngx_file_s {
|
|||||||
ngx_thread_task_t *thread_task;
|
ngx_thread_task_t *thread_task;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NGX_HAVE_FILE_AIO)
|
#if (NGX_HAVE_FILE_AIO || NGX_COMPAT)
|
||||||
ngx_event_aio_t *aio;
|
ngx_event_aio_t *aio;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@
|
|||||||
#define NGX_MODULE_SIGNATURE_2 "0"
|
#define NGX_MODULE_SIGNATURE_2 "0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NGX_HAVE_FILE_AIO)
|
#if (NGX_HAVE_FILE_AIO || NGX_COMPAT)
|
||||||
#define NGX_MODULE_SIGNATURE_3 "1"
|
#define NGX_MODULE_SIGNATURE_3 "1"
|
||||||
#else
|
#else
|
||||||
#define NGX_MODULE_SIGNATURE_3 "0"
|
#define NGX_MODULE_SIGNATURE_3 "0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (NGX_HAVE_AIO_SENDFILE)
|
#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
|
||||||
#define NGX_MODULE_SIGNATURE_4 "1"
|
#define NGX_MODULE_SIGNATURE_4 "1"
|
||||||
#else
|
#else
|
||||||
#define NGX_MODULE_SIGNATURE_4 "0"
|
#define NGX_MODULE_SIGNATURE_4 "0"
|
||||||
|
@ -152,7 +152,7 @@ struct ngx_event_aio_s {
|
|||||||
ngx_event_handler_pt handler;
|
ngx_event_handler_pt handler;
|
||||||
ngx_file_t *file;
|
ngx_file_t *file;
|
||||||
|
|
||||||
#if (NGX_HAVE_AIO_SENDFILE)
|
#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
|
||||||
ssize_t (*preload_handler)(ngx_buf_t *file);
|
ssize_t (*preload_handler)(ngx_buf_t *file);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3760,10 +3760,8 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
|||||||
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
|
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
|
||||||
ngx_conf_merge_size_value(conf->sendfile_max_chunk,
|
ngx_conf_merge_size_value(conf->sendfile_max_chunk,
|
||||||
prev->sendfile_max_chunk, 0);
|
prev->sendfile_max_chunk, 0);
|
||||||
#if (NGX_HAVE_FILE_AIO || NGX_THREADS)
|
|
||||||
ngx_conf_merge_value(conf->aio, prev->aio, NGX_HTTP_AIO_OFF);
|
ngx_conf_merge_value(conf->aio, prev->aio, NGX_HTTP_AIO_OFF);
|
||||||
ngx_conf_merge_value(conf->aio_write, prev->aio_write, 0);
|
ngx_conf_merge_value(conf->aio_write, prev->aio_write, 0);
|
||||||
#endif
|
|
||||||
#if (NGX_THREADS)
|
#if (NGX_THREADS)
|
||||||
ngx_conf_merge_ptr_value(conf->thread_pool, prev->thread_pool, NULL);
|
ngx_conf_merge_ptr_value(conf->thread_pool, prev->thread_pool, NULL);
|
||||||
ngx_conf_merge_ptr_value(conf->thread_pool_value, prev->thread_pool_value,
|
ngx_conf_merge_ptr_value(conf->thread_pool_value, prev->thread_pool_value,
|
||||||
|
Loading…
Reference in New Issue
Block a user