# # # patch "ChangeLog" # from [e131fc1b4fc5ba32da8a24fa42d1721325321eea] # to [7a4f96db238b9ec6693f949870e7eb78c00329de] # # patch "contrib/usher.cc" # from [b64f4dc18a125c94130e73b289958b0d734374cd] # to [d70e075f22b9098967c5add74c0e5988ae5bbd8d] # ============================================================ --- ChangeLog e131fc1b4fc5ba32da8a24fa42d1721325321eea +++ ChangeLog 7a4f96db238b9ec6693f949870e7eb78c00329de @@ -1,5 +1,16 @@ 2006-04-21 Richard Levitte + * contrib/usher.cc (server::set_hosts, server::set_patterns): + Write a warning saying that existing entries with the same host + or pattern are stripped of said host or pattern. + (server::set_patterns): Erasing the list node that we're iterating + on, then trying to go to the next node doesn't work. Save the + iterator, then increment it before erasing the node using the + saved value. No more segfaults. This is the same fix as was done + for server::set_hosts February 21st. + +2006-04-21 Richard Levitte + * po/sv.po: A fuzzy updated 2006-04-20 Timtohy Brownawell ============================================================ --- contrib/usher.cc b64f4dc18a125c94130e73b289958b0d734374cd +++ contrib/usher.cc d70e075f22b9098967c5add74c0e5988ae5bbd8d @@ -699,6 +699,7 @@ for (vector::const_iterator i = h.begin(); i != h.end(); ++i) { c = servers_by_host.find(*i); if (c != servers_by_host.end()) { + cerr << "Removing duplicates for host " << *i << std::endl; list >::iterator>::iterator j; for (j = c->second->by_host.begin(); j != c->second->by_host.end();) { @@ -727,11 +728,17 @@ for (vector::const_iterator i = p.begin(); i != p.end(); ++i) { c = servers_by_pattern.find(*i); if (c != servers_by_pattern.end()) { + cerr << "Removing duplicates for pattern " << *i << std::endl; list >::iterator>::iterator j; for (j = c->second->by_pat.begin(); j != c->second->by_pat.end(); ++j) - if ((*j)->first == *i) { - servers_by_pattern.erase(*j); - c->second->by_pat.erase(j); + { + list >::iterator>::iterator j_saved + = j; + ++j; + if ((*j_saved)->first == *i) { + servers_by_pattern.erase(*j_saved); + c->second->by_pat.erase(j_saved); + } } } c = servers_by_pattern.insert(make_pair(*i, me)).first;