Changeset 6715:d200a0fd00b7 in nginx


Ignore:
Timestamp:
09/29/16 12:28:24 (4 years ago)
Author:
Ruslan Ermilov <ru@…>
Branch:
default
Phase:
public
Message:

Introduced the NGX_COMPAT macro.

When enabled, some structures are padded to be size compatible
with their NGINX Plus versions.

Location:
src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/core/ngx_config.h

    r6494 r6715  
    130130
    131131
     132#if (NGX_COMPAT)
     133
     134#define NGX_COMPAT_BEGIN(slots)  uint64_t spare[slots];
     135#define NGX_COMPAT_END
     136
     137#else
     138
     139#define NGX_COMPAT_BEGIN(slots)
     140#define NGX_COMPAT_END
     141
     142#endif
     143
     144
    132145#endif /* _NGX_CONFIG_H_INCLUDED_ */
  • src/core/ngx_module.h

    r6603 r6715  
    211211#else
    212212#define NGX_MODULE_SIGNATURE_33  "0"
     213#endif
     214
     215#if (NGX_COMPAT)
     216#define NGX_MODULE_SIGNATURE_34  "1"
     217#else
     218#define NGX_MODULE_SIGNATURE_34  "0"
    213219#endif
    214220
     
    225231    NGX_MODULE_SIGNATURE_27 NGX_MODULE_SIGNATURE_28 NGX_MODULE_SIGNATURE_29   \
    226232    NGX_MODULE_SIGNATURE_30 NGX_MODULE_SIGNATURE_31 NGX_MODULE_SIGNATURE_32   \
    227     NGX_MODULE_SIGNATURE_33
     233    NGX_MODULE_SIGNATURE_33 NGX_MODULE_SIGNATURE_34
    228234
    229235
  • src/event/ngx_event_connect.h

    r6707 r6715  
    6969                                     /* ngx_connection_log_error_e */
    7070    unsigned                         log_error:2;
     71
     72    NGX_COMPAT_BEGIN(2)
     73    NGX_COMPAT_END
    7174};
    7275
  • src/http/ngx_http_upstream.h

    r6709 r6715  
    103103    unsigned                         down:1;
    104104    unsigned                         backup:1;
     105
     106    NGX_COMPAT_BEGIN(6)
     107    NGX_COMPAT_END
    105108} ngx_http_upstream_server_t;
    106109
     
    230233
    231234    ngx_str_t                        module;
     235
     236    NGX_COMPAT_BEGIN(2)
     237    NGX_COMPAT_END
    232238} ngx_http_upstream_conf_t;
    233239
     
    383389    unsigned                         request_body_sent:1;
    384390    unsigned                         header_sent:1;
     391
     392    NGX_COMPAT_BEGIN(1)
     393    NGX_COMPAT_END
    385394};
    386395
  • src/http/ngx_http_upstream_round_robin.h

    r6713 r6715  
    5151
    5252    ngx_http_upstream_rr_peer_t    *next;
     53
     54    NGX_COMPAT_BEGIN(32)
     55    NGX_COMPAT_END
    5356};
    5457
  • src/stream/ngx_stream_upstream.h

    r6708 r6715  
    5959    unsigned                           down:1;
    6060    unsigned                           backup:1;
     61
     62    NGX_COMPAT_BEGIN(4)
     63    NGX_COMPAT_END
    6164} ngx_stream_upstream_server_t;
    6265
  • src/stream/ngx_stream_upstream_round_robin.h

    r6713 r6715  
    5151
    5252    ngx_stream_upstream_rr_peer_t   *next;
     53
     54    NGX_COMPAT_BEGIN(25)
     55    NGX_COMPAT_END
    5356};
    5457
Note: See TracChangeset for help on using the changeset viewer.