Commit 48404579 authored by valenok's avatar valenok

Passing request_info with user_data to MG_INIT_SSL

parent 80d9fbcd
...@@ -3551,6 +3551,7 @@ static int load_dll(struct mg_context *ctx, const char *dll_name, ...@@ -3551,6 +3551,7 @@ static int load_dll(struct mg_context *ctx, const char *dll_name,
// Dynamically load SSL library. Set up ctx->ssl_ctx pointer. // Dynamically load SSL library. Set up ctx->ssl_ctx pointer.
static int set_ssl_option(struct mg_context *ctx) { static int set_ssl_option(struct mg_context *ctx) {
struct mg_request_info request_info;
SSL_CTX *CTX; SSL_CTX *CTX;
int i, size; int i, size;
const char *pem = ctx->config[SSL_CERTIFICATE]; const char *pem = ctx->config[SSL_CERTIFICATE];
...@@ -3574,8 +3575,10 @@ static int set_ssl_option(struct mg_context *ctx) { ...@@ -3574,8 +3575,10 @@ static int set_ssl_option(struct mg_context *ctx) {
if ((CTX = SSL_CTX_new(SSLv23_server_method())) == NULL) { if ((CTX = SSL_CTX_new(SSLv23_server_method())) == NULL) {
cry(fc(ctx), "SSL_CTX_new error: %s", ssl_error()); cry(fc(ctx), "SSL_CTX_new error: %s", ssl_error());
} else if (ctx->user_callback != NULL) { } else if (ctx->user_callback != NULL) {
memset(&request_info, 0, sizeof(request_info));
request_info.user_data = ctx->user_data;
ctx->user_callback(MG_INIT_SSL, (struct mg_connection *) CTX, ctx->user_callback(MG_INIT_SSL, (struct mg_connection *) CTX,
ctx->user_data); &request_info);
} }
if (CTX != NULL && SSL_CTX_use_certificate_file(CTX, pem, if (CTX != NULL && SSL_CTX_use_certificate_file(CTX, pem,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment