The unified diff between revisions [83b5270b..] and [5587f68e..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'netsync.cc'

#
#
# patch "netsync.cc"
#  from [6e37489151e0809548e293eb4d0495b8921cebfe]
#    to [5d53bf85b20e88af400ccea87f1233eefdfd5daa]
#
============================================================
--- netsync.cc	6e37489151e0809548e293eb4d0495b8921cebfe
+++ netsync.cc	5d53bf85b20e88af400ccea87f1233eefdfd5daa
@@ -438,6 +438,7 @@ session
                          delta const & del);
   bool process_nonexistant_cmd(netcmd_item_type type,
                                id const & item);
+  bool process_usher_cmd(utf8 const & msg);

   bool merkle_node_exists(netcmd_item_type type,
                           size_t level,
@@ -2738,6 +2739,23 @@ bool
 }

 bool
+session::process_usher_cmd(utf8 const & msg)
+{
+  if (msg().size())
+    {
+      if (msg()[0] == '!')
+        P(F("Received warning from usher: %s") % msg().substr(1));
+      else
+        L(F("Received greeting from usher: %s") % msg().substr(1));
+    }
+  netcmd cmdout;
+  cmdout.write_usher_reply_cmd(our_include_pattern);
+  write_netcmd_and_try_flush(cmdout);
+  L(F("Sent reply."));
+  return true;
+}
+
+bool
 session::merkle_node_exists(netcmd_item_type type,
                             size_t level,
                             prefix const & pref)
@@ -2955,6 +2973,16 @@ session::dispatch_payload(netcmd const &
         return process_nonexistant_cmd(type, item);
       }
       break;
+    case usher_cmd:
+      {
+        utf8 greeting;
+        cmd.read_usher_cmd(greeting);
+        return process_usher_cmd(greeting);
+      }
+      break;
+    case usher_reply_cmd:
+      return false;// should not happen
+      break;
     }
   return false;
 }