Changeset 187

Show
Ignore:
Timestamp:
08/19/04 23:41:28 (9 years ago)
Author:
alexcv
Message:

Fixed a few bugs?

Location:
trunk/wifidog
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/ChangeLog

    r186 r187  
    11# $Header$ 
     2 
     32004-08-19 Alexandre Carmel-Veilleux <acv@acv.ca> 
     4        * Sort of fixed the hanging thread (with an explicit thread kill) 
     5        * Fixed ping code 
     6 
    272004-08-13 Alexandre Carmel-Veilleux <acv@acv.ca> 
    38        * All Auth Server configuration now handled by the "AuthServer"  
  • trunk/wifidog/src/auth.c

    r176 r187  
    120120                /* No longer needs to be locked */ 
    121121                pthread_mutex_unlock(&cond_mutex); 
    122                  
     122         
     123                debug(LOG_DEBUG, "Running fw_counter()"); 
     124         
    123125                fw_counter(); 
    124126        } 
  • trunk/wifidog/src/gateway.c

    r182 r187  
    5757extern int errno; 
    5858 
     59static pthread_t tid_fw_counter; /* XXX Ugly hack */ 
     60 
    5961/**@internal 
    6062 * @brief Handles SIGCHLD signals to avoid zombie processes 
     
    7981        static  pthread_mutex_t sigterm_mutex = PTHREAD_MUTEX_INITIALIZER; 
    8082 
     83        /* XXX stupid openwrt bug */ 
     84        pthread_kill(tid_fw_counter, SIGKILL); 
     85 
    8186        /* Makes sure we only call fw_destroy() once. */ 
    8287        if (pthread_mutex_trylock(&sigterm_mutex)) 
    83                 return; 
     88                pthread_exit(NULL); 
    8489         
    8590        fw_destroy(); 
     
    179184 
    180185        /* start clean up thread */ 
    181         pthread_create(&tid, NULL, (void *)thread_client_timeout_check, NULL); 
    182         pthread_detach(tid); 
     186        pthread_create(&tid_fw_counter, NULL, (void *)thread_client_timeout_check, NULL); 
     187        pthread_detach(tid_fw_counter); 
    183188 
    184189        /* start control thread */ 
  • trunk/wifidog/src/ping_thread.c

    r186 r187  
    7777                pthread_mutex_unlock(&cond_mutex); 
    7878 
    79                 fprintf(stderr, "BANG\n"); 
    80                  
    8179                ping(); 
    8280        } 
     
    132130        } 
    133131 
    134         snprintf(request, sizeof(request) - 1, "GET %s/ping HTTP/1.0\r\n" 
    135                         "User-Agent: WiFiDog %s\r\n" 
    136                         "Host: %s\r\n" 
    137                         "\r\n", 
     132        snprintf(request, sizeof(request) - 1, "GET %s/ping/ HTTP/1.0\n" 
     133                        "User-Agent: WiFiDog %s\n" 
     134                        "Host: %s\n" 
     135                        "\n", 
    138136                        auth_server->authserv_path, 
    139137                        VERSION, 
    140138                        auth_server->authserv_hostname); 
     139 
     140        send(sockfd, request, strlen(request), 0); 
    141141 
    142142        numbytes = totalbytes = 0;