Opened 4 years ago

Closed 4 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



Adding alternate locations to the private address book doesn't work on blank address books. It works after a restart.

Steps to reproduce:

  1. Delete hostsdb.blockfile
  2. Start router
  3. Add an entry in private address book
  4. Try to add alternate destinations for same host

When initializing a new block file, BlockFileNamingService doesn't add the "privatehosts.txt" SkipList to the "_lists" variable.


Change History (3)

comment:1 Changed 4 years ago by zzz

Component: apps/susidnsapps/addressbook
Milestone: undecided0.9.33
Owner: set to zzz
Status: newaccepted

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.

comment:2 Changed 4 years ago by Zlatin Balevsky

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 4 years ago by zzz

Resolution: fixed
Status: acceptedclosed

Thanks, in 57cdeb15d186bfaf6d8683f11c653bc82b907abf to be 0.9.32-4

Note: See TracTickets for help on using tickets.