mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-11 12:14:41 +08:00
Report bind error in simplest_web_server_ssl
PUBLISHED_FROM=73e7ed5dd69cbca00ad6f67125915fbfb296770b
This commit is contained in:
parent
844c7787f9
commit
4120f953c7
@ -29,16 +29,19 @@ int main(void) {
|
|||||||
struct mg_mgr mgr;
|
struct mg_mgr mgr;
|
||||||
struct mg_connection *nc;
|
struct mg_connection *nc;
|
||||||
struct mg_bind_opts bind_opts;
|
struct mg_bind_opts bind_opts;
|
||||||
|
const char *err;
|
||||||
|
|
||||||
mg_mgr_init(&mgr, NULL);
|
mg_mgr_init(&mgr, NULL);
|
||||||
memset(&bind_opts, 0, sizeof(bind_opts));
|
memset(&bind_opts, 0, sizeof(bind_opts));
|
||||||
bind_opts.ssl_cert = s_ssl_cert;
|
bind_opts.ssl_cert = s_ssl_cert;
|
||||||
bind_opts.ssl_key = s_ssl_key;
|
bind_opts.ssl_key = s_ssl_key;
|
||||||
|
bind_opts.error_string = &err;
|
||||||
|
|
||||||
printf("Starting SSL server on port %s, cert from %s, key from %s\n",
|
printf("Starting SSL server on port %s, cert from %s, key from %s\n",
|
||||||
s_http_port, bind_opts.ssl_cert, bind_opts.ssl_key);
|
s_http_port, bind_opts.ssl_cert, bind_opts.ssl_key);
|
||||||
nc = mg_bind_opt(&mgr, s_http_port, ev_handler, bind_opts);
|
nc = mg_bind_opt(&mgr, s_http_port, ev_handler, bind_opts);
|
||||||
if (nc == NULL) {
|
if (nc == NULL) {
|
||||||
printf("Failed to create listener\n");
|
printf("Failed to create listener: %s\n", err);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user