From: Alan T. DeKok Date: Fri, 13 May 2011 08:50:40 +0000 (+0200) Subject: Put checks for non-threaded TLS in a better place. X-Git-Tag: release_3_0_0_beta0~832 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da4bd80476caff4fbd6d4211cf05a1305288dfb9;p=thirdparty%2Ffreeradius-server.git Put checks for non-threaded TLS in a better place. The TLS code requires threads to work. --- diff --git a/src/main/listen.c b/src/main/listen.c index 593ba2884b0..ff15ebe0857 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -2687,15 +2687,6 @@ int listen_init(CONF_SECTION *config, rad_listen_t **head, int spawn_flag) if (cs) this->server = mainconfig.name; } -#ifdef WITH_TLS - if (!spawn_flag && this->tls) { - tls_error: - cf_log_err(cf_sectiontoitem(cs), "Threading must be enabled for TLS sockets to function properly."); - listen_free(&this); - return -1; - } -#endif - *last = this; last = &(this->next); @@ -2778,10 +2769,6 @@ int listen_init(CONF_SECTION *config, rad_listen_t **head, int spawn_flag) return -1; } -#ifdef WITH_TLS - if (!spawn_flag && this->tls) goto tls_error; -#endif - *last = this; last = &(this->next); } /* loop over "listen" directives in server */ @@ -2850,6 +2837,14 @@ add_sockets: defined_proxy = 1; } +#endif + +#ifdef WITH_TLS + if (!spawn_flag && this->tls) { + cf_log_err(cf_sectiontoitem(this->cs), "Threading must be enabled for TLS sockets to function properly."); + cf_log_err(cf_sectiontoitem(this->cs), "You probably need to do 'radiusd -fxx -l stdout' for debugging"); + return -1; + } #endif event_new_fd(this); }