[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] 3.0-pre3: serial comm problems - FIXED
On Thursday 15 May 2003 23:12, Christophe Beauregard wrote:
> I've been spending the last few days trying to figure out why my m105 is
> periodically not completing a serial sync (about 1 in 4 syncs, on
> average). I've narrowed the problem down and it looks like the connection
> is being "lost" prematurely. As in, sometime between the last sync time
> being set and the connection getting closed.
It's actually a problem with the initial device opening that propogates
itself all the way down to the device close. The problem is that
PConn_select() is used to determine if a Palm device is attached (er...
cmp_read -> padp_read -> PConn_select() during the serial_accept()
process). If no device is trying to connect, select times out. This sets
the status to PCONNSTAT_LOST and it _never_ gets reset, even when a
connection is established. Of course, the only thing that checks the status
is the src/palmconn.c:Disconnect() call, after everything else has
completed.
To reproduce the behaviour, start coldsync, wait until PConn_select times
out (in the CVS version with -d padp:5 you'll see a "padp_read: timeout"),
then try a sync. The sync will run through to the end just fine and then
the Palm will lose the connection and complain that it didn't finish.
coldsync will think everything was just peachy.
The quick and easy fix is to rewrite libpconn/PConnection.c:PConn_accept()
as follows:
int
PConn_accept(struct PConnection *p)
{
int rc = (*p->io_accept)(p);
if (!rc) PConn_set_status(p, PCONNSTAT_UP);
return rc;
}
I've tested this with 3.0-pre3 and the CVS version and it appears to work
just fine for both.
A better fix probably involves cleaning up how connection status is tracked
and ensuring it's actually used in places where it's relevant... I'd
imagine this would be sometime _before_ the disconnect phase.
Now, back to that mail conduit I was trying to get working before this thing
started to annoy me...
c.
--
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.