From 48404579273615c3f3d3d8b6d6c9dc3b7a814141 Mon Sep 17 00:00:00 2001 From: valenok Date: Sat, 5 Mar 2011 09:01:38 +0000 Subject: [PATCH] Passing request_info with user_data to MG_INIT_SSL --- mongoose.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index bf0eef05..14ae67aa 100644 --- a/mongoose.c +++ b/mongoose.c @@ -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. static int set_ssl_option(struct mg_context *ctx) { + struct mg_request_info request_info; SSL_CTX *CTX; int i, size; const char *pem = ctx->config[SSL_CERTIFICATE]; @@ -3574,8 +3575,10 @@ static int set_ssl_option(struct mg_context *ctx) { if ((CTX = SSL_CTX_new(SSLv23_server_method())) == NULL) { cry(fc(ctx), "SSL_CTX_new error: %s", ssl_error()); } 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_data); + &request_info); } if (CTX != NULL && SSL_CTX_use_certificate_file(CTX, pem,