Skip to content

Commit

Permalink
starting work on the actual synchronisation code for rhizome direct.
Browse files Browse the repository at this point in the history
  • Loading branch information
gardners committed Sep 7, 2012
1 parent 5aa4c8b commit 6d72553
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commandline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions rhizome_direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6d72553

Please sign in to comment.