comparison src/context.cpp @ 156:a220bfb9211f

add auto whitelisting
author carl
date Sun, 08 Jul 2007 09:46:55 -0700
parents 89ce226e5383
children b3ed72ee6564
comparison
equal deleted inserted replaced
155:a76a6af7ed8b 156:a220bfb9211f
470 int when = (*i).second; 470 int when = (*i).second;
471 ofs << who << " " << when << endl; 471 ofs << who << " " << when << endl;
472 } 472 }
473 } 473 }
474 ofs.close(); 474 ofs.close();
475 need = false;
475 } 476 }
476 pthread_mutex_unlock(&mutex); 477 pthread_mutex_unlock(&mutex);
477 } 478 }
478 479
479 480
510 whitelister_map::iterator i = whitelisters.find(fn); 511 whitelister_map::iterator i = whitelisters.find(fn);
511 if (i == whitelisters.end()) { 512 if (i == whitelisters.end()) {
512 rc = new WHITELISTER(fn, days); 513 rc = new WHITELISTER(fn, days);
513 whitelisters[fn] = rc; 514 whitelisters[fn] = rc;
514 } 515 }
515 else rc = (*i).second; 516 else {
517 rc = (*i).second;
518 rc->set_days(days);
519 }
516 pthread_mutex_unlock(&whitelister_mutex); 520 pthread_mutex_unlock(&whitelister_mutex);
517 return rc; 521 return rc;
518 } 522 }
519 523
520 524