Changeset 840

Show
Ignore:
Timestamp:
11/24/05 16:46:44 (3 years ago)
Author:
aprilp
Message:

Bad idea, rollback

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wifidog/ChangeLog

    r819 r840  
    11# $Header$ 
     22005-11-24 Philippe April <philippe@ilesansfil.org> 
     3        * Bad idea 
     4 
    252005-11-01 Max Horvath <max.horvath@maxspot.de> 
    36        * Added .project to .cvsignore 
     
    582005-11-01 Philippe April <philippe@ilesansfil.org> 
    69        * Added OPTIONS section in wifidog-init (example: enable syslog) 
    7  
    8 2005-10-10 Philippe April <philippe@ilesansfil.org> 
    9         * Ability to run wifidog without an auth server (splash only). 
    10         * Does not allow (yet) to specify a custom splash/disclaimer, but will 
    11         forward to the portal of your choice if specified in the config (or 
    12         a generic one if none is specified). 
    13         Of course, using wifidog without an authentication server will not give 
    14         you statistics and all the rest of the cool features. 
    1510 
    16112005-10-09 Philippe April <philippe@ilesansfil.org> 
  • trunk/wifidog/src/conf.c

    r799 r840  
    7878        oAuthServPath, 
    7979        oAuthServMaxTries, 
    80     oPortal, 
    8180        oHTTPDMaxConn, 
    8281        oHTTPDName, 
     
    106105        { "authserver",         oAuthServer }, 
    107106        { "authservmaxtries",   oAuthServMaxTries }, 
    108         { "portal",             oPortal }, 
    109107        { "httpdmaxconn",       oHTTPDMaxConn }, 
    110108        { "httpdname",          oHTTPDName }, 
     
    151149        config.authserv_maxtries = DEFAULT_AUTHSERVMAXTRIES; 
    152150        config.httpdname = NULL; 
    153     config.portal = NULL; 
    154151        config.clienttimeout = DEFAULT_CLIENTTIMEOUT; 
    155152        config.checkinterval = DEFAULT_CHECKINTERVAL; 
     
    643640                                                        &linenum); 
    644641                                        break; 
    645                 case oPortal: 
    646                     config.portal = safe_strdup(p1); 
    647                     break; 
    648642                                case oFirewallRuleSet: 
    649643                                        parse_firewall_ruleset(p1, fd, filename, &linenum); 
     
    758752{ 
    759753        config_notnull(config.gw_interface, "GatewayInterface"); 
     754    config_notnull(config.auth_servers, "AuthServer"); 
    760755 
    761756        if (missing_parms) { 
  • trunk/wifidog/src/conf.h

    r799 r840  
    116116                                     connection attempts before abandoning */ 
    117117    t_auth_serv *auth_servers;  /**< @brief Auth servers list */ 
    118     char *portal;           /**< @brief portal file or url to show */ 
    119118    char *httpdname;            /**< @brief Name the web server will return when 
    120119                                     replying to a request */ 
  • trunk/wifidog/src/gateway.c

    r799 r840  
    291291                pthread_kill(tid_fw_counter, SIGKILL); 
    292292        } 
    293         if (config->auth_servers != NULL && tid_ping) { 
     293        if (tid_ping) { 
    294294                debug(LOG_INFO, "Explicitly killing the ping thread"); 
    295295                pthread_kill(tid_ping, SIGKILL); 
     
    409409        httpdAddCContent(webserver, "/wifidog", "status", 0, NULL, http_callback_status); 
    410410        httpdAddCContent(webserver, "/wifidog", "auth", 0, NULL, http_callback_auth); 
    411         httpdAddCContent(webserver, "/wifidog", "splash", 0, NULL, http_callback_splash); 
    412         httpdAddCContent(webserver, "/wifidog", "portal", 0, NULL, http_callback_portal); 
    413411 
    414412        httpdAddC404Content(webserver, http_callback_404); 
     
    435433        pthread_detach(tid); 
    436434         
    437         /* Start heartbeat thread, only if we have an auth server set */ 
    438         if (config->auth_servers != NULL) { 
    439             result = pthread_create(&tid_ping, NULL, (void *)thread_ping, NULL); 
    440             if (result != 0) { 
    441                     debug(LOG_ERR, "FATAL: Failed to create a new thread (ping) - exiting"); 
    442                     termination_handler(0); 
    443             } 
    444             pthread_detach(tid_ping); 
    445     } 
     435        /* Start heartbeat thread */ 
     436        result = pthread_create(&tid_ping, NULL, (void *)thread_ping, NULL); 
     437        if (result != 0) { 
     438            debug(LOG_ERR, "FATAL: Failed to create a new thread (ping) - exiting"); 
     439                termination_handler(0); 
     440        } 
     441        pthread_detach(tid_ping); 
    446442         
    447443        debug(LOG_NOTICE, "Waiting for connections"); 
  • trunk/wifidog/src/http.h

    r799 r840  
    3939void http_callback_status(httpd *webserver, request *r); 
    4040/**@brief Callback for libhttpd */ 
    41 void http_callback_splash(httpd *webserver, request *r); 
    42 /**@brief Callback for libhttpd */ 
    43 void http_callback_portal(httpd *webserver, request *r); 
    44 /**@brief Callback for libhttpd */ 
    4541void http_callback_auth(httpd *webserver, request *r); 
    4642 
  • trunk/wifidog/src/util.c

    r799 r840  
    410410    } 
    411411 
    412     if (config->auth_servers != NULL) { 
    413         snprintf((buffer + len), (sizeof(buffer) - len), "\nAuthentication servers:\n"); 
     412    snprintf((buffer + len), (sizeof(buffer) - len), "\nAuthentication servers:\n"); 
     413    len = strlen(buffer); 
     414 
     415    LOCK_CONFIG(); 
     416 
     417    for (auth_server = config->auth_servers; auth_server != NULL; auth_server = auth_server->next) { 
     418        snprintf((buffer + len), (sizeof(buffer) - len), "  Host: %s (%s)\n", auth_server->authserv_hostname, auth_server->last_ip); 
    414419        len = strlen(buffer); 
    415  
    416         LOCK_CONFIG(); 
    417  
    418         for (auth_server = config->auth_servers; auth_server != NULL; auth_server = auth_server->next) { 
    419             snprintf((buffer + len), (sizeof(buffer) - len), "  Host: %s (%s)\n", auth_server->authserv_hostname, auth_server->last_ip); 
    420             len = strlen(buffer); 
    421         } 
    422  
    423         UNLOCK_CONFIG(); 
    424     } else { 
    425         snprintf((buffer + len), (sizeof(buffer) - len), "\nRunning in splash only mode\n"); 
    426         len = strlen(buffer); 
    427     } 
     420    } 
     421 
     422    UNLOCK_CONFIG(); 
    428423 
    429424        return safe_strdup(buffer);