Hi Brad,

The patch looks OK to me.

Can you apply it or shall you prefer I do it on your behalf?

Cheers,
Julien.

On Thu, 2013-05-23 at 06:35 +1000, Brad Hards wrote:
> While investigating appointments, I noticed that they get dumped twice:
> 
> $ openchangeclient --fetch-items=Appointment
> MAILBOX (2 messages)
> |==  ==| : 1D00000000000001/34CB000000000001
>          Location: new york
>          Start time     :   Thu May 23 06:30:00 2013 EST
>          End time       :   Thu May 23 07:30:00 2013 EST
>          Timezone: (GMT-08:00) Pacific Time (US & Canada)
>          Private: False
>          Status: Completed
> |==  ==| : 1D00000000000001/33CB000000000001
>          Location: washington dc
>          Start time     :   Thu May 23 06:30:00 2013 EST
>          End time       :   Thu May 23 07:30:00 2013 EST
>          Timezone: (GMT-08:00) Pacific Time (US & Canada)
>          Private: False
>          Status: Completed
> |==  ==| : 1D00000000000001/34CB000000000001
>          Location: new york
>          Start time     :   Thu May 23 06:30:00 2013 EST
>          End time       :   Thu May 23 07:30:00 2013 EST
>          Timezone: (GMT-08:00) Pacific Time (US & Canada)
>          Private: False
>          Status: Completed
> |==  ==| : 1D00000000000001/33CB000000000001
>          Location: washington dc
>          Start time     :   Thu May 23 06:30:00 2013 EST
>          End time       :   Thu May 23 07:30:00 2013 EST
>          Timezone: (GMT-08:00) Pacific Time (US & Canada)
>          Private: False
>          Status: Completed
> 
> It looks like we're doing the comparison incorrectly. The "count" 
> variable represents the number of messages still to be output, so
> we should compare to that.
> 
> The patch below also includes a formatting fix - that is trivial though.
> 
> > diff --git a/utils/openchangeclient.c b/utils/openchangeclient.c
> > index a284ed2..2bbe3cd 100644
> > --- a/utils/openchangeclient.c
> > +++ b/utils/openchangeclient.c
> > @@ -1816,7 +1816,7 @@ static bool openchangeclient_fetchitems(TALLOC_CTX 
> > *mem_ctx, mapi_object_t *obj_
> >         MAPIFreeBuffer(SPropTagArray);
> >         if (retval != MAPI_E_SUCCESS) return false;
> >
> > -       while ((retval = QueryRows(&obj_table, count, TBL_ADVANCE, 
> > &SRowSet)) != MAPI_E_NOT_FOUND && SRowSet.cRows) {
> > +       while ((retval = QueryRows(&obj_table, count, TBL_ADVANCE, 
> > &SRowSet)) != MAPI_E_NOT_FOUND && count) {
> >                 count -= SRowSet.cRows;
> >                 for (i = 0; i < SRowSet.cRows; i++) {
> >                         mapi_object_init(&obj_message);
> > @@ -1837,7 +1837,7 @@ static bool openchangeclient_fetchitems(TALLOC_CTX 
> > *mem_ctx, mapi_object_t *obj_
> >                                                                             
> > &properties_array);
> >                                                 switch (olFolder) {
> >                                                 case olFolderInbox:
> > -                                                 
> > mapidump_message(&properties_array, id, NULL);
> > +                                                       
> > mapidump_message(&properties_array, id, NULL);
> >                                                         break;
> >                                                 case olFolderCalendar:
> >                                                         
> > mapidump_appointment(&properties_array, id);
> 
> Does this look OK? If so, please apply.
> 
> Brad
> _______________________________________________
> devel mailing list
> [email protected]
> http://mailman.openchange.org/listinfo/devel

-- 
Julien Kerihuel
[email protected]
OpenChange Project Founder

Twitter: http://twitter.com/jkerihuel

GPG Fingerprint: 0B55 783D A781 6329 108A  B609 7EF6 FE11 A35F 1F79





_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel

Reply via email to