Changeset 427

Show
Ignore:
Timestamp:
02/04/05 00:45:20 (8 years ago)
Author:
minaguib
Message:

Insignificant code cosmetic shuffling

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/src/http.c

    r424 r427  
    6161        s_config        *config = config_get_config(); 
    6262        t_auth_serv     *auth_server = get_auth_server(); 
    63          
    64         if (!is_online()) { 
    65                 /* No point re-directing them to the auth server if we haven't been able to talk 
    66                  * to it for a while */ 
    67                 httpdOutput(r, "<html><head><title>Currently unavailable</title></head><body><h1>Uh oh!</h1>"); 
    68                 httpdOutput(r, "We apologize, but it seems that we are currently unable to re-direct you to the login screen."); 
    69                 httpdOutput(r, "<p>"); 
    70                 httpdOutput(r, "The maintainers of this network are aware of this disruption.  We hope that this situation will be resolved soon."); 
    71                 httpdOutput(r, "<p>"); 
    72                 httpdOutput(r, "Please try again another time."); 
    73                 httpdOutput(r, "</body></html>"); 
    74                 return; 
    75         } 
    7663 
    7764        if (auth_server->authserv_use_ssl) { 
     
    8976        url = httpdUrlEncode(tmp_url); 
    9077         
    91         if ((asprintf(&newlocation, "Location: %s://%s:%d%slogin?" 
     78        if (!is_online()) { 
     79                /* No point re-directing them to the auth server if we haven't been able to talk 
     80                 * to it for a while */ 
     81                httpdOutput(r, "<html><head><title>Currently unavailable</title></head><body><h1>Uh oh!</h1>"); 
     82                httpdOutput(r, "We apologize, but it seems that we are currently unable to re-direct you to the login screen."); 
     83                httpdOutput(r, "<p>"); 
     84                httpdOutput(r, "The maintainers of this network are aware of this disruption.  We hope that this situation will be resolved soon."); 
     85                httpdOutput(r, "<p>"); 
     86                httpdPrintf(r, "In a while please <a href='%s'>click here</a> to try again.", url); 
     87                httpdOutput(r, "</body></html>"); 
     88                debug(LOG_INFO, "Sent %s an apology since I am not online - no point sending them to auth server", r->clientAddr); 
     89        } 
     90        else if ((asprintf(&newlocation, "Location: %s://%s:%d%slogin?" 
    9291                        "gw_address=%s&gw_port=%d&gw_id=%s&url=%s", 
    9392                        protocol, 
     
    9998                        url)) == -1) { 
    10099                debug(LOG_ERR, "Failed to asprintf newlocation"); 
    101                 free(url); 
    102                 free(newlocation); 
    103100                httpdOutput(r, "Internal error occurred"); 
    104101        } else { 
     
    120117                debug(LOG_INFO, "Captured %s and re-directed them to login " 
    121118                        "page", r->clientAddr); 
    122                 free(url); 
    123119                free(newlocation); 
    124120        } 
     121 
     122        free(url); 
    125123} 
    126124