]> git.kaiwu.me - nginx.git/commitdiff
Modules compatibility: compatibility with NGX_HAVE_FILE_AIO.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 10 Oct 2016 15:44:17 +0000 (18:44 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 10 Oct 2016 15:44:17 +0000 (18:44 +0300)
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.

src/core/ngx_buf.h
src/core/ngx_connection.h
src/core/ngx_file.h
src/core/ngx_module.h
src/event/ngx_event.h
src/http/ngx_http_core_module.c

index 224807cb050e0e018fca4ac132e3a89b8338c643..12781a7821988331e7093633273bb3814e606850 100644 (file)
@@ -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);
 
-#if (NGX_HAVE_FILE_AIO)
 typedef void (*ngx_output_chain_aio_pt)(ngx_output_chain_ctx_t *ctx,
     ngx_file_t *file);
-#endif
 
 struct ngx_output_chain_ctx_s {
     ngx_buf_t                   *buf;
@@ -90,9 +88,9 @@ struct ngx_output_chain_ctx_s {
     unsigned                     need_in_temp:1;
     unsigned                     aio:1;
 
-#if (NGX_HAVE_FILE_AIO)
+#if (NGX_HAVE_FILE_AIO || NGX_COMPAT)
     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);
 #endif
 #endif
index b527954e6db6e42d0e1466f6137159acc332c3c1..a49c5a65678721535388d32e8542b202688988fa 100644 (file)
@@ -182,7 +182,7 @@ struct ngx_connection_s {
 
     unsigned            need_last_buf:1;
 
-#if (NGX_HAVE_AIO_SENDFILE)
+#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
     unsigned            busy_count:2;
 #endif
 
index cff74cba1de0b31f7df758e3d4530140914affad..320adc2952a25bc750e1447b61ecf32b614e8fe1 100644 (file)
@@ -30,7 +30,7 @@ struct ngx_file_s {
     ngx_thread_task_t         *thread_task;
 #endif
 
-#if (NGX_HAVE_FILE_AIO)
+#if (NGX_HAVE_FILE_AIO || NGX_COMPAT)
     ngx_event_aio_t           *aio;
 #endif
 
index 626481d8a94d8fbe906ef8e5eea3de89453dd164..4d0db44c67b23c7b19a3e02e60c3dba32a63d376 100644 (file)
 #define NGX_MODULE_SIGNATURE_2   "0"
 #endif
 
-#if (NGX_HAVE_FILE_AIO)
+#if (NGX_HAVE_FILE_AIO || NGX_COMPAT)
 #define NGX_MODULE_SIGNATURE_3   "1"
 #else
 #define NGX_MODULE_SIGNATURE_3   "0"
 #endif
 
-#if (NGX_HAVE_AIO_SENDFILE)
+#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
 #define NGX_MODULE_SIGNATURE_4   "1"
 #else
 #define NGX_MODULE_SIGNATURE_4   "0"
index f0b75af619a899868a8d38b77e4654e941e7c1bb..053bd16f8ceeee88b4123c0b26be224ff761d91d 100644 (file)
@@ -152,7 +152,7 @@ struct ngx_event_aio_s {
     ngx_event_handler_pt       handler;
     ngx_file_t                *file;
 
-#if (NGX_HAVE_AIO_SENDFILE)
+#if (NGX_HAVE_AIO_SENDFILE || NGX_COMPAT)
     ssize_t                  (*preload_handler)(ngx_buf_t *file);
 #endif
 
index 2daea10135c402b548ba94a631eb5851de60565c..9da5d109e3cb8cb439ec1253ba06dc1c4b2cdd82 100644 (file)
@@ -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_size_value(conf->sendfile_max_chunk,
                               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_write, prev->aio_write, 0);
-#endif
 #if (NGX_THREADS)
     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,