Re: An issue setting the header of a new message



On Wed, 2007-01-24 at 16:50 +0100, Sergio Villar Senin wrote:
> Philip Van Hoof wrote:
> > 
> > In case of 1 and 2, the camel_message_info_* API must be used, in case
> > of 2 the camel_mime_part and camel_mime_message API must be used.
> 
> So the check should be (((TnyCamelHeader *)header)->write == 3) isn't it?

That's possible, yes. I'll check with you this evening. But feel free to
just try it.

Any check that doesn't explicitly compare with a number, is wrong since
I changed tny-camel-header.c.

All "if (inst->write)"'s should be replaced with "if (inst->write ==
1)"'s and all if (!inst->write)"'s with "if (inst->write == 0)"'s.

Checking for 3 means that you are checking whether the header's instance
is (being) destroyed (and that you shouldn't have had the instance
anymore anyhow) or non-initialized.

Since locking is not being done (for memory and performance reasons),
the 3 value can happen in multithreaded situations too. :) (oeps)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]