mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-12 10:13:29 +00:00
Pass more args to custom TLS init
This commit is contained in:
+4
-2
@@ -3780,7 +3780,8 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
||||
if (tls == NULL) {
|
||||
mg_error(c, "TLS OOM");
|
||||
goto fail;
|
||||
} else if (opts->ifn != NULL && opts->ifn(opts) != 0) {
|
||||
} else if (opts->custom_init != NULL &&
|
||||
opts->custom_init(c, opts, tls) != 0) {
|
||||
mg_error(c, "TLS custom init failed");
|
||||
goto fail;
|
||||
}
|
||||
@@ -3948,7 +3949,8 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
||||
if (tls == NULL) {
|
||||
mg_error(c, "TLS OOM");
|
||||
goto fail;
|
||||
} else if (opts->ifn != NULL && opts->ifn(opts) != 0) {
|
||||
} else if (opts->custom_init != NULL &&
|
||||
opts->custom_init(c, opts, tls) != 0) {
|
||||
mg_error(c, "TLS custom init failed");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+1
-1
@@ -930,7 +930,7 @@ struct mg_tls_opts {
|
||||
const char *certkey; // Certificate key
|
||||
const char *ciphers; // Cipher list
|
||||
struct mg_str srvname; // If not empty, enables server name verification
|
||||
int (*ifn)(struct mg_tls_opts *); // Custom init func. Return 0 on success
|
||||
int (*custom_init)(struct mg_connection *, struct mg_tls_opts *, void *tls);
|
||||
};
|
||||
|
||||
void mg_tls_init(struct mg_connection *, struct mg_tls_opts *);
|
||||
|
||||
@@ -11,7 +11,7 @@ struct mg_tls_opts {
|
||||
const char *certkey; // Certificate key
|
||||
const char *ciphers; // Cipher list
|
||||
struct mg_str srvname; // If not empty, enables server name verification
|
||||
int (*ifn)(struct mg_tls_opts *); // Custom init func. Return 0 on success
|
||||
int (*custom_init)(struct mg_connection *, struct mg_tls_opts *, void *tls);
|
||||
};
|
||||
|
||||
void mg_tls_init(struct mg_connection *, struct mg_tls_opts *);
|
||||
|
||||
+2
-1
@@ -58,7 +58,8 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
||||
if (tls == NULL) {
|
||||
mg_error(c, "TLS OOM");
|
||||
goto fail;
|
||||
} else if (opts->ifn != NULL && opts->ifn(opts) != 0) {
|
||||
} else if (opts->custom_init != NULL &&
|
||||
opts->custom_init(c, opts, tls) != 0) {
|
||||
mg_error(c, "TLS custom init failed");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
|
||||
if (tls == NULL) {
|
||||
mg_error(c, "TLS OOM");
|
||||
goto fail;
|
||||
} else if (opts->ifn != NULL && opts->ifn(opts) != 0) {
|
||||
} else if (opts->custom_init != NULL &&
|
||||
opts->custom_init(c, opts, tls) != 0) {
|
||||
mg_error(c, "TLS custom init failed");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user