瀏覽代碼

tls: don't start if tcp is in async mode

- added check for tcp async mode on startup. If tcp is in async
  mode and tls_force_run is not set, refuse to start and print an
  error message (tls does not support yet tcp async mode).
Andrei Pelinescu-Onciul 16 年之前
父節點
當前提交
d9b7afae58
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      modules_s/tls/tls_mod.c

+ 6 - 0
modules_s/tls/tls_mod.c

@@ -301,6 +301,12 @@ static int mod_init(void)
 				"(set enable_tls=1 in the config to enable it)\n");
 				"(set enable_tls=1 in the config to enable it)\n");
 		return 0;
 		return 0;
 	}
 	}
+
+	if (cfg_get(tcp, tcp_cfg, async) && !tls_force_run){
+		ERR("tls does not support tcp in async mode, please use"
+				" tcp_async=no in the config file\n");
+		return -1;
+	}
 	     /* Convert tls_method parameter to integer */
 	     /* Convert tls_method parameter to integer */
 	method = tls_parse_method(&tls_method);
 	method = tls_parse_method(&tls_method);
 	if (method < 0) {
 	if (method < 0) {