Skip to content
GitHub no longer supports this web browser. Learn more about the browsers we support.
Permalink
Browse files

Add support for building as a dynamic module.

This commit also converts the common code into a core module.
  • Loading branch information
grahamedgecombe committed Feb 14, 2016
1 parent b77e163 commit bd269221b86140791be7ef7f631601a37cf0d129
87 config
@@ -13,31 +13,78 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

ngx_addon_name=ngx_ssl_ct_module
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/ngx_ssl_ct.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_ssl_ct.c"

found_any=no

if [ $HTTP = YES ] && [ $HTTP_SSL = YES ]; then
HTTP_MODULES="$HTTP_MODULES ngx_http_ssl_ct_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_ssl_ct_module.c"
found_any=yes
fi
if test -n "$ngx_module_link"; then
ngx_module_type=CORE
ngx_module_name=ngx_ssl_ct_module
ngx_module_deps="$ngx_addon_dir/ngx_ssl_ct_module.h"
ngx_module_srcs="$ngx_addon_dir/ngx_ssl_ct_module.c"
ngx_module_libs=OPENSSL
. auto/module

if [ $MAIL = YES ] && [ $MAIL_SSL = YES ]; then
# XXX: we have to use MAIL_SSL_MODULE instead of MAIL_MODULES here such that
# ngx_mail_ssl_ct_module is started *after* ngx_mail_ssl_module
MAIL_SSL_MODULE="$MAIL_SSL_MODULE ngx_mail_ssl_ct_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_mail_ssl_ct_module.c"
found_any=yes
fi
if [ $HTTP = YES ] && [ $HTTP_SSL = YES ]; then
ngx_module_type=HTTP
ngx_module_name=ngx_http_ssl_ct_module
ngx_module_deps="$ngx_addon_dir/ngx_ssl_ct_module.h"
ngx_module_srcs="$ngx_addon_dir/ngx_http_ssl_ct_module.c"
ngx_module_libs=OPENSSL
ngx_module_order="ngx_http_ssl_module $ngx_module_name"
. auto/module

found_any=yes
fi

if [ $MAIL = YES ] && [ $MAIL_SSL = YES ]; then
ngx_module_type=MAIL
ngx_module_name=ngx_mail_ssl_ct_module
ngx_module_deps="$ngx_addon_dir/ngx_ssl_ct_module.h"
ngx_module_srcs="$ngx_addon_dir/ngx_mail_ssl_ct_module.c"
ngx_module_libs=OPENSSL
ngx_module_order="ngx_mail_ssl_module $ngx_module_name"
. auto/module

found_any=yes
fi

if [ $STREAM = YES ] && [ $STREAM_SSL = YES ]; then
ngx_module_type=STREAM
ngx_module_name=ngx_stream_ssl_ct_module
ngx_module_deps="$ngx_addon_dir/ngx_ssl_ct_module.h"
ngx_module_srcs="$ngx_addon_dir/ngx_stream_ssl_ct_module.c"
ngx_module_libs=OPENSSL
ngx_module_order="ngx_stream_ssl_module $ngx_module_name"
. auto/module

found_any=yes
fi
else
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/ngx_ssl_ct_module.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_ssl_ct_module.c"
CORE_MODULES="$CORE_MODULES ngx_ssl_ct_module"

if [ $HTTP = YES ] && [ $HTTP_SSL = YES ]; then
HTTP_MODULES="$HTTP_MODULES ngx_http_ssl_ct_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_ssl_ct_module.c"
found_any=yes
fi

if [ $MAIL = YES ] && [ $MAIL_SSL = YES ]; then
# XXX: we have to use MAIL_SSL_MODULE instead of MAIL_MODULES here such that
# ngx_mail_ssl_ct_module is started *after* ngx_mail_ssl_module
MAIL_SSL_MODULE="$MAIL_SSL_MODULE ngx_mail_ssl_ct_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_mail_ssl_ct_module.c"
found_any=yes
fi

if [ $STREAM = YES ] && [ $STREAM_SSL = YES ]; then
# XXX: we have to use STREAM_SSL_MODULE instead of STREAM_MODULES here such
# that ngx_stream_ssl_ct_module is started *after* ngx_stream_ssl_module
STREAM_SSL_MODULE="$STREAM_SSL_MODULE ngx_stream_ssl_ct_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_stream_ssl_ct_module.c"
found_any=yes
if [ $STREAM = YES ] && [ $STREAM_SSL = YES ]; then
# XXX: we have to use STREAM_SSL_MODULE instead of STREAM_MODULES here such
# that ngx_stream_ssl_ct_module is started *after* ngx_stream_ssl_module
STREAM_SSL_MODULE="$STREAM_SSL_MODULE ngx_stream_ssl_ct_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_stream_ssl_ct_module.c"
found_any=yes
fi
fi

if [ $found_any = no ]; then
@@ -15,7 +15,7 @@
*/

#include <ngx_http.h>
#include "ngx_ssl_ct.h"
#include "ngx_ssl_ct_module.h"

static char *ngx_http_ssl_ct_merge_srv_conf(ngx_conf_t *cf, void *parent,
void *child);
@@ -15,7 +15,7 @@
*/

#include <ngx_mail.h>
#include "ngx_ssl_ct.h"
#include "ngx_ssl_ct_module.h"

static char *ngx_mail_ssl_ct_merge_srv_conf(ngx_conf_t *cf, void *parent,
void *child);
@@ -14,12 +14,34 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include "ngx_ssl_ct.h"
#include "ngx_ssl_ct_module.h"

static ngx_ssl_ct_ext *ngx_ssl_ct_read_static_sct(ngx_conf_t *cf,
ngx_str_t *dir, u_char *file, size_t file_len,
ngx_ssl_ct_ext *sct_list);

static ngx_core_module_t ngx_ssl_ct_module_ctx = {
ngx_string("ssl_ct"),

NULL, /* create main configuration */
NULL /* init main configuration */
};

ngx_module_t ngx_ssl_ct_module = {
NGX_MODULE_V1,
&ngx_ssl_ct_module_ctx, /* module context */
NULL, /* module directives */
NGX_CORE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};

void *ngx_ssl_ct_create_srv_conf(ngx_conf_t *cf)
{
ngx_ssl_ct_srv_conf_t *conf = ngx_pcalloc(cf->pool, sizeof(*conf));
File renamed without changes.
@@ -15,7 +15,7 @@
*/

#include <ngx_stream.h>
#include "ngx_ssl_ct.h"
#include "ngx_ssl_ct_module.h"

static char *ngx_stream_ssl_ct_merge_srv_conf(ngx_conf_t *cf, void *parent,
void *child);

0 comments on commit bd26922

Please sign in to comment.
You can’t perform that action at this time.