From 588883eb42aa04e72bbcc8723075a01093edc9e4 Mon Sep 17 00:00:00 2001
From: yrutschle <git1@rutschle.net>
Date: Fri, 27 Dec 2019 18:26:16 +0100
Subject: [PATCH] Fix on-timeout setting so it is no longer ignored (issue
 #253)

---
 probe.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/probe.c b/probe.c
index ed54426..45421e4 100644
--- a/probe.c
+++ b/probe.c
@@ -59,8 +59,6 @@ static struct protocol_probe_desc builtins[] = {
     { "anyprot",    is_true }
 };
 
-static char* on_timeout = "ssh";
-
 /* TODO I think this has to go */
 struct protocol_probe_desc*  get_builtins(void) {
     return builtins;
@@ -70,13 +68,6 @@ int get_num_builtins(void) {
     return ARRAY_SIZE(builtins);
 }
 
-/* Sets the protocol name to connect to in case of timeout */
-void set_ontimeout(const char* name)
-{
-    int res = asprintf(&on_timeout, "%s", name);
-    CHECK_RES_DIE(res, "asprintf");
-}
-
 /* Returns the protocol to connect to in case of timeout; 
  * if not found, return the first protocol specified 
  */
@@ -84,7 +75,7 @@ struct sslhcfg_protocols_item* timeout_protocol(void)
 {
     int i;
     for (i = 0; i < cfg.protocols_len; i++) {
-        if (!strcmp(cfg.protocols[i].name, on_timeout)) return &cfg.protocols[i];
+        if (!strcmp(cfg.protocols[i].name, cfg.on_timeout)) return &cfg.protocols[i];
     }
     return &cfg.protocols[0];
 }