[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] [PATCH] removing lastsync PC dependency on host's IP
Andrew Arensburger writes:
> On Tue, Aug 14, 2001 at 02:33:41PM -0400, Dan Pelleg wrote:
> > Attached, a patch to remove the lastsync PC dependency on the host's
> > IP. This should solve a problem where hosts with changing IPs (DHCP and so
> > on) are forced to do a slow sync with the PDA after the IP
> > changes. Naturally, it also allows fast-syncs against multiple machines, if
> > the state is copied between the machines before the sync (via some external
> > file-syncing utility).
> >
> > Details: the last PC is stored in ~/.palm/lastsync, and is incremented
> > with each sucessful sync. If this file is missing, a random 32-bit number
> > is used. As was done previously, a mismatch in the ID will force a slow
> > sync. Once the ~/.palm hierarchy is copied from one host to another, so is
> > the file lastsync, and subsequent syncs in either the copier or copyee will
> > be fast. I tested this in both standalone and daemon modes. Systems tested
> > on are RedHat Linux, and FreeBSD 4.4-PRERELEASE.
>
> Sorry, but this strikes me as a hack. I'd much rather
> a) Fix the config file to allow you to set the host ID in the
> config file. This should solve the problem of DHCP clients with
> transient IP addresses.
> b) Have one or more ancillary files that give the ID of the
> host with which a given database was synced. That way, this
> information can be rdisted along with the databases, and ColdSync can
> make a more informed decision as to whether or not to do a slow sync.
>
I never said it wasn't a hack. It also has the advantage that the user
needs not set up any config entries themselves, which I think your solution
requires. Maybe I got you wrong there, but did you mean the host ID is
something the user puts in? I can't think of anything the computer itself
can supply that will serve as an ID (remember that hostnames can also be
set by the DHCP client).
As for (b), it can definitely work, but the logic needs to be worked
out. I'm guessing you'll end up needing some universal "clock" to compare
sync events timeestamps to. That clock needs to be stored on the PDA, or
else you have no way of identifying a sync against the PDA after a sync to
a different host which has not bothered to send its files over since. I
accomplished that by making the lastsyncPC the "clock" and incrementing it
with each sync. I guess the same could be achieved by, say, storing this
clock in a database of its own or in an options field. What did you have in
mind?
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.