Introduced the NGX_COMPAT macro.
When enabled, some structures are padded to be size compatible
with their NGINX Plus versions.
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index a0bfa63..1861be6 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -129,4 +129,17 @@
#define NGX_MAX_INT32_VALUE (uint32_t) 0x7fffffff
+#if (NGX_COMPAT)
+
+#define NGX_COMPAT_BEGIN(slots) uint64_t spare[slots];
+#define NGX_COMPAT_END
+
+#else
+
+#define NGX_COMPAT_BEGIN(slots)
+#define NGX_COMPAT_END
+
+#endif
+
+
#endif /* _NGX_CONFIG_H_INCLUDED_ */
diff --git a/src/core/ngx_module.h b/src/core/ngx_module.h
index a1a0d6c..c944746 100644
--- a/src/core/ngx_module.h
+++ b/src/core/ngx_module.h
@@ -212,6 +212,12 @@
#define NGX_MODULE_SIGNATURE_33 "0"
#endif
+#if (NGX_COMPAT)
+#define NGX_MODULE_SIGNATURE_34 "1"
+#else
+#define NGX_MODULE_SIGNATURE_34 "0"
+#endif
+
#define NGX_MODULE_SIGNATURE \
NGX_MODULE_SIGNATURE_0 NGX_MODULE_SIGNATURE_1 NGX_MODULE_SIGNATURE_2 \
NGX_MODULE_SIGNATURE_3 NGX_MODULE_SIGNATURE_4 NGX_MODULE_SIGNATURE_5 \
@@ -224,7 +230,7 @@
NGX_MODULE_SIGNATURE_24 NGX_MODULE_SIGNATURE_25 NGX_MODULE_SIGNATURE_26 \
NGX_MODULE_SIGNATURE_27 NGX_MODULE_SIGNATURE_28 NGX_MODULE_SIGNATURE_29 \
NGX_MODULE_SIGNATURE_30 NGX_MODULE_SIGNATURE_31 NGX_MODULE_SIGNATURE_32 \
- NGX_MODULE_SIGNATURE_33
+ NGX_MODULE_SIGNATURE_33 NGX_MODULE_SIGNATURE_34
#define NGX_MODULE_V1 \
diff --git a/src/event/ngx_event_connect.h b/src/event/ngx_event_connect.h
index f410d35..6b97a24 100644
--- a/src/event/ngx_event_connect.h
+++ b/src/event/ngx_event_connect.h
@@ -68,6 +68,9 @@
/* ngx_connection_log_error_e */
unsigned log_error:2;
+
+ NGX_COMPAT_BEGIN(2)
+ NGX_COMPAT_END
};
diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h
index e079eae..e6bf3c9 100644
--- a/src/http/ngx_http_upstream.h
+++ b/src/http/ngx_http_upstream.h
@@ -102,6 +102,9 @@
unsigned down:1;
unsigned backup:1;
+
+ NGX_COMPAT_BEGIN(6)
+ NGX_COMPAT_END
} ngx_http_upstream_server_t;
@@ -229,6 +232,9 @@
#endif
ngx_str_t module;
+
+ NGX_COMPAT_BEGIN(2)
+ NGX_COMPAT_END
} ngx_http_upstream_conf_t;
@@ -382,6 +388,9 @@
unsigned request_sent:1;
unsigned request_body_sent:1;
unsigned header_sent:1;
+
+ NGX_COMPAT_BEGIN(1)
+ NGX_COMPAT_END
};
diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h
index 326e849..92aa1a6 100644
--- a/src/http/ngx_http_upstream_round_robin.h
+++ b/src/http/ngx_http_upstream_round_robin.h
@@ -50,6 +50,9 @@
#endif
ngx_http_upstream_rr_peer_t *next;
+
+ NGX_COMPAT_BEGIN(32)
+ NGX_COMPAT_END
};
diff --git a/src/stream/ngx_stream_upstream.h b/src/stream/ngx_stream_upstream.h
index db21984..5c99078 100644
--- a/src/stream/ngx_stream_upstream.h
+++ b/src/stream/ngx_stream_upstream.h
@@ -58,6 +58,9 @@
unsigned down:1;
unsigned backup:1;
+
+ NGX_COMPAT_BEGIN(4)
+ NGX_COMPAT_END
} ngx_stream_upstream_server_t;
diff --git a/src/stream/ngx_stream_upstream_round_robin.h b/src/stream/ngx_stream_upstream_round_robin.h
index 75ffadd..9e1afc5 100644
--- a/src/stream/ngx_stream_upstream_round_robin.h
+++ b/src/stream/ngx_stream_upstream_round_robin.h
@@ -50,6 +50,9 @@
#endif
ngx_stream_upstream_rr_peer_t *next;
+
+ NGX_COMPAT_BEGIN(25)
+ NGX_COMPAT_END
};