Opened 3 years ago
Closed 3 years ago
#2072 closed defect (fixed)
Adding alternate dests to private address book fails on blank hostsdb.blockfile
Reported by: | Zlatin Balevsky | Owned by: | zzz |
---|---|---|---|
Priority: | minor | Milestone: | 0.9.33 |
Component: | apps/addressbook | Version: | 0.9.32 |
Keywords: | Cc: | ||
Parent Tickets: | Sensitive: | no |
Description
Hi,
Adding alternate locations to the private address book doesn't work on blank address books. It works after a restart.
Steps to reproduce:
- Delete hostsdb.blockfile
- Start router
- Add an entry in private address book
- Try to add alternate destinations for same host
Reason:
When initializing a new block file, BlockFileNamingService doesn't add the "privatehosts.txt" SkipList to the "_lists" variable.
Subtickets
Change History (3)
comment:1 Changed 3 years ago by
Component: | apps/susidns → apps/addressbook |
---|---|
Milestone: | undecided → 0.9.33 |
Owner: | set to zzz |
Status: | new → accepted |
comment:2 Changed 3 years ago by
On a blank router without a privatehosts.txt file, the checks on line 253 are going to short-circuit the addition to "_lists" which happens on line 291
comment:3 Changed 3 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Thanks, in 57cdeb15d186bfaf6d8683f11c653bc82b907abf to be 0.9.32-4
Note: See
TracTickets for help on using
tickets.
hmm. In initNew() line 245 we do set the list variable to HostsTxtNamingService?.DEFAULT_HOSTS_FILE which is "privatehosts.txt,userhosts.txt,hosts.txt" and then add each to the _lists List at the bottom of the loop. Also, the string is put in the info property, which is put in the header skiplist.
One quirk of the underlying blockfile/skiplist implementation is that empty skiplists are deleted. That's why in e.g. addEntry() line 528 it must be checked and created if absent.
I don't yet see where the problem is exactly, but I haven't tried to follow your steps to reproduce yet. For further research.