Browse Source

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 năm trước cách đây
mục cha
commit
024a23ebba
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      modules/tls/tls_mod.c

+ 6 - 0
modules/tls/tls_mod.c

@@ -308,6 +308,12 @@ static int mod_init(void)
 				"(set enable_tls=1 in the config to enable it)\n");
 		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 */
 	method = tls_parse_method(&tls_method);
 	if (method < 0) {