Index: /branches/neb_distrib_20081210/Nebulous-Server/Changes
===================================================================
--- /branches/neb_distrib_20081210/Nebulous-Server/Changes	(revision 23724)
+++ /branches/neb_distrib_20081210/Nebulous-Server/Changes	(revision 23725)
@@ -9,4 +9,5 @@
     - attempt to optimize _is_valid_object_key() by eliminating an unused join
     - rename Nebulous::Keys class -> Nebulous::Key
+    - select neb db to use by hashing only the directory component of the key
       
 0.16
Index: /branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Server.pm
===================================================================
--- /branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Server.pm	(revision 23724)
+++ /branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Server.pm	(revision 23725)
@@ -79,8 +79,8 @@
     # only use the first 8 hex chars... have to be careful to avoid an int
     # overflow here
-    # XXX this needs to be modified to follow my key prescription:
-    # neb://host/path/path/filename.ext -> use path/path/filename (ignore neb://host and .ext)
-    # EAM : test to double-check hashing behavior
-    $db_index = unpack("h8", sha1_hex("$key")) % $config->n_db;
+
+    # hash only the directory component of the path and not the filename
+    my $path = dirname($key->path);
+    $db_index = unpack("h8", sha1_hex($path)) % $config->n_db;
 
     return $db_index;
