starting work on the actual synchronisation code for rhizome direct.

This commit is contained in:
gardners 2012-09-07 22:53:16 +09:30
parent 5aa4c8bb82
commit 6d725535f9
2 changed files with 12 additions and 0 deletions

View File

@ -1786,6 +1786,12 @@ command_line_option command_line_options[]={
{app_rhizome_direct_sync,{"rhizome","direct","sync","<ip:port>",NULL},
CLIFLAG_STANDALONE,
"Synchronise with the specified Rhizome Direct server. Return when done."},
{app_rhizome_direct_sync,{"rhizome","direct","push","<ip:port>",NULL},
CLIFLAG_STANDALONE,
"Deliver all new content to the specified Rhizome Direct server. Return when done."},
{app_rhizome_direct_sync,{"rhizome","direct","pull","<ip:port>",NULL},
CLIFLAG_STANDALONE,
"Fetch all new content from the specified Rhizome Direct server. Return when done."},
{app_keyring_create,{"keyring","create",NULL},0,
"Create a new keyring file."},
{app_keyring_list,{"keyring","list","[<pin,pin...>]",NULL},CLIFLAG_STANDALONE,

View File

@ -569,6 +569,12 @@ int app_rhizome_direct_sync(int argc, const char *const *argv,
{
/* Attempt to connect with a remote Rhizome Direct instance,
and negotiate which BARs to synchronise. */
char *modeName = (argc >= 3 ? argv[2] : "sync");
int mode=3; /* two-way sync */
if (!strcasecmp(modeName,"push")) mode=1; /* push only */
if (!strcasecmp(modeName,"pull")) mode=2; /* pull only */
DEBUGF("sync direction = %d",mode);
return -1;
}