mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-27 20:48:29 +00:00
Passing user_data to init_ssl()
This commit is contained in:
1 parent
67f5de624e
commit
3892e0199e
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -4705,7 +4705,7 @@ static int set_ssl_option(struct mg_context *ctx) {
|
|||||||
// If user callback returned non-NULL, that means that user callback has
|
// If user callback returned non-NULL, that means that user callback has
|
||||||
// set up certificate itself. In this case, skip sertificate setting.
|
// set up certificate itself. In this case, skip sertificate setting.
|
||||||
if ((ctx->callbacks.init_ssl == NULL ||
|
if ((ctx->callbacks.init_ssl == NULL ||
|
||||||
!ctx->callbacks.init_ssl(ctx->ssl_ctx)) &&
|
!ctx->callbacks.init_ssl(ctx->ssl_ctx, ctx->user_data)) &&
|
||||||
(SSL_CTX_use_certificate_file(ctx->ssl_ctx, pem, 1) == 0 ||
|
(SSL_CTX_use_certificate_file(ctx->ssl_ctx, pem, 1) == 0 ||
|
||||||
SSL_CTX_use_PrivateKey_file(ctx->ssl_ctx, pem, 1) == 0)) {
|
SSL_CTX_use_PrivateKey_file(ctx->ssl_ctx, pem, 1) == 0)) {
|
||||||
cry(fc(ctx), "%s: cannot open %s: %s", __func__, pem, ssl_error());
|
cry(fc(ctx), "%s: cannot open %s: %s", __func__, pem, ssl_error());
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ struct mg_callbacks {
|
|||||||
int (*begin_request)(struct mg_connection *);
|
int (*begin_request)(struct mg_connection *);
|
||||||
void (*end_request)(const struct mg_connection *, int reply_status_code);
|
void (*end_request)(const struct mg_connection *, int reply_status_code);
|
||||||
int (*log_message)(const struct mg_connection *, const char *message);
|
int (*log_message)(const struct mg_connection *, const char *message);
|
||||||
int (*init_ssl)(void *ssl_context);
|
int (*init_ssl)(void *ssl_context, void *user_data);
|
||||||
int (*websocket_connect)(const struct mg_connection *);
|
int (*websocket_connect)(const struct mg_connection *);
|
||||||
void (*websocket_ready)(struct mg_connection *);
|
void (*websocket_ready)(struct mg_connection *);
|
||||||
int (*websocket_data)(struct mg_connection *);
|
int (*websocket_data)(struct mg_connection *);
|
||||||
|
|||||||
Reference in new issue
Block a user