  
  }
 diff --git a/backends/remote/remote-database.cc b/backends/remote/remote-database.cc
-index 337865a..f056b9c 100644
+index 337865a..f1f2fbb 100644
 --- a/backends/remote/remote-database.cc
 +++ b/backends/remote/remote-database.cc
 @@ -59,8 +59,9 @@ throw_bad_message(const string & context)

+        message += db_dir;
+	send_message(MSG_SELECT, message);
+	get_message(message, REPLY_UPDATE);
+
+	p = message.c_str();
+	p_end = p + message.size();

 	if (type == REPLY_DONE) {
 	    // The database was already open at the latest revision.
 	    return false;
@@ -348,6 +349,22 @@ RemoteDatabase::update_stats(message_type msg_code) const
 	throw Xapian::NetworkError(errmsg, context);
     }
 
