Changeset 478 for trunk/wifidog/src/util.c
- Timestamp:
- 02/24/05 23:03:38 (8 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog/src/util.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/src/util.c
r469 r478 113 113 free(h_addr); 114 114 UNLOCK_GHBN(); 115 mark_offline();116 115 return NULL; 117 116 } … … 156 155 157 156 void mark_online() { 158 int isonline; 159 isonline = is_online(); 157 int before; 158 int after; 159 160 before = is_online(); 160 161 time(&last_online_time); 161 if (!isonline) { 162 debug(LOG_INFO, "ONLINE status changed to ON"); 163 } 162 after = is_online(); 163 164 if (before != after) { 165 debug(LOG_INFO, "ONLINE status became %s", (after ? "ON" : "OFF")); 166 } 167 164 168 } 165 169 166 170 void mark_offline() { 167 int isonline; 168 isonline = is_online(); 171 int before; 172 int after; 173 174 before = is_online(); 169 175 time(&last_offline_time); 176 after = is_online(); 177 178 if (before != after) { 179 debug(LOG_INFO, "ONLINE status became %s", (after ? "ON" : "OFF")); 180 } 181 170 182 /* If we're offline it definately means the auth server is offline */ 171 183 mark_auth_offline(); 172 if (isonline) { 173 debug(LOG_INFO, "ONLINE status changed to OFF"); 174 } 184 175 185 } 176 186 … … 187 197 188 198 void mark_auth_online() { 189 int isauthonline; 190 isauthonline = is_auth_online(); 199 int before; 200 int after; 201 202 before = is_auth_online(); 191 203 time(&last_auth_online_time); 204 after = is_auth_online(); 205 206 if (before != after) { 207 debug(LOG_INFO, "AUTH_ONLINE status became %s", (after ? "ON" : "OFF")); 208 } 209 192 210 /* If auth server is online it means we're definately online */ 193 211 mark_online(); 194 if (!isauthonline) { 195 debug(LOG_INFO, "AUTH_ONLINE status changed to ON"); 196 } 212 197 213 } 198 214 199 215 void mark_auth_offline() { 200 int isauthonline; 201 isauthonline = is_auth_online(); 216 int before; 217 int after; 218 219 before = is_auth_online(); 202 220 time(&last_auth_offline_time); 203 if (isauthonline) { 204 debug(LOG_INFO, "AUTH_ONLINE status changed to OFF"); 205 } 221 after = is_auth_online(); 222 223 if (before != after) { 224 debug(LOG_INFO, "AUTH_ONLINE status became %s", (after ? "ON" : "OFF")); 225 } 226 206 227 } 207 228
