소스 검색

Support multiple domains (Step 2/?)

bel2125 7 년 전
부모
커밋
ad0e4e4eb4
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/civetweb.c

+ 5 - 1
src/civetweb.c

@@ -14654,7 +14654,7 @@ init_ssl_ctx(struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 	const char *chain;
 	char ebuf[128];
 
-	if (!phys_ctx || !dom_ctx) {
+	if (!phys_ctx) {
 		return 0;
 	}
 
@@ -14663,6 +14663,10 @@ init_ssl_ctx(struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 		return 1;
 	}
 
+	if (!dom_ctx) {
+		dom_ctx = &(phys_ctx->dd);
+	}
+
 	/* Check for external SSL_CTX */
 	callback_ret =
 	    (phys_ctx->callbacks.external_ssl_ctx == NULL)