After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 389664 - porting evolution conduits to pilot-link 0.12
porting evolution conduits to pilot-link 0.12
Status: RESOLVED OBSOLETE
Product: evolution
Classification: Applications
Component: Do Not Use
2.10.x (obsolete)
Other All
: Normal critical
: ---
Assigned To: Veerapuram Varadhan
Evolution QA team
to-be-updated
Depends on:
Blocks:
 
 
Reported: 2006-12-26 07:01 UTC by Jerry Yu
Modified: 2013-09-13 12:34 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
application patch (25.42 KB, patch)
2006-12-26 07:04 UTC, Jerry Yu
committed Details | Review

Description Jerry Yu 2006-12-26 07:01:10 UTC
Please describe the problem:
Attached patch ported the Evolution conduits to pilot-link 0.12. They are backwards compatible with pilot-link 0.11.8.
For gnome-pilot, JP created a way to determine if pilot-link 0.11.x
or 0.12 was installed, and compiled the code accordingly. The patch used that same mechanism for the Evolution conduits. 

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Jerry Yu 2006-12-26 07:04:25 UTC
Created attachment 78892 [details] [review]
application patch

the patch is a combination of Nathan's (Nathan Owens <pianocomp81@yahoo.com>)patch and Solaris internal patch.Owens <pianocomp81@yahoo.com>
Comment 2 Veerapuram Varadhan 2007-01-08 15:17:48 UTC
Committed to HEAD.  Thanks Nathan and Jerry Yu.  Let me keep the bug open to address Matt's concerns.

Matt's concerns:
> I've had a look at the patch.  I don't like the changes to the
> "local_record_to_pilot_record" API.  What happens if the record is
> longer than the array the user has supplied?  You've no way of informing
> the user that they hadn't allocated enough space, or what the right
> amount of space is.  You should get the caller to pass in a non-null
> (pi_buffer_t *).  For thread safeness it would be best not to use static
> pi_buffers_t variables.  Let the caller create a temporary one and
> destroy it when done.
> 
> Also, there are a couple of places where there's an explicit
> free(piBuf.data) that should be pi_buffer_free(piBuf).
> 
> Other than that, looks good to me.
Comment 3 Jerry Yu 2007-01-09 07:28:25 UTC
The patch pasted here modifying local_record_to_pilot_record isn't different from Nathan's original patch. It may resolve Matt's concerns.
Comment 4 Nathan Owens 2007-01-10 06:09:06 UTC
Thanks for committing it!

I don't think it really resolves Matt's concerns, but it's no different than before. The same thing can happen: data could be truncated if record[] isn't big enough. Now, I don't think it's a problem in this format (or the previous format) only because 0xffff is the maximum PalmOS record size right now.

Matt's real concern was that record should be a pi_buffer_t, and should be passed in the whole way, automatically resized by pack_Memo() if needed, and then returned to the user. This is not possible because the prepare() function (implements the gnome-pilot 'prepare' signal) calls local_record_to_pilot_record(). Right now, any memory allocated in prepare() must be freed in prepare(). To completely alleviate Matt's concern, prepare() would return dynamically-allocated memory, and then some future call (by gnome-pilot and pilot-link) would free that memory. This is a limitation in the pilot-link libpisync API. It doesn't look like this limitation will be overcome in the near future, either.

Given all that, I'd agree with Jerry that this bug can be closed - I've looked at SVN, and it looks good. Thanks again!
Comment 5 Matt Davey 2007-01-10 09:18:23 UTC
It's great to see this patch committed.

It's still the case that local_record_to_pilot_record returns the record in a static char[], so is thread unsafe.  I agree with Nathan that this isn't a big problem (it isn't a regression, AFAICS): gpilotd only runs one sync at a time, so I think you'd need multiple copies of gpilotd, one listening for, say, usb and the other for network.

That said, the obvious way to use a pi_buffer in the conduits would be to give each conduit context (e.g. struct _EAddrConduitContext) its own pi_buffer to use as required.  The memory can then be freed in e_addr_context_destroy.  local_record_to_pilot_record could use the same API as before, but return a pointer to the conduit's pi_buffer data instead of the static char[].
Comment 6 Tom Billiet 2007-01-16 09:48:44 UTC
Hi,
I want to use this patch to get evolution compiled with the new pilot-link, but it doesn't work here, it keeps looking for the old pilot-link functions.
Do I have to pass a special parameter to configure to make it check if I have the new version of pilot-link installed?
Comment 7 Jerry Yu 2007-01-17 05:56:50 UTC
Tom, 
Perhaps you should add this option "--with-pisock=$PILOT_LINK_PATH" when configuring.
Comment 8 Tom Billiet 2007-06-11 10:23:01 UTC
Hmm,
why is this bug not closed? As far as I see the patch is already committed in evolution 2.10 and perfectly working
Comment 9 Matthew Barnes 2008-03-11 00:31:47 UTC
Bumping version to a stable release.