]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Put checks for non-threaded TLS in a better place.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 13 May 2011 08:50:40 +0000 (10:50 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 13 May 2011 08:50:40 +0000 (10:50 +0200)
The TLS code requires threads to work.

src/main/listen.c

index 593ba2884b0373ac08be8454784d7ed439092634..ff15ebe0857ee8502b3a27e2b2f64cd8e9f2ed2e 100644 (file)
@@ -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 <foo> */
@@ -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);
        }