Problems Using libesmtp with pthreads

Anil Oommen <[email protected]> Fri, 3 Oct 2003 00:02:33 -0700 (PDT)
Newsgroups gmane.comp.lib.libesmtp
Message-ID <[email protected]>
Hi 
 ive been trying to use libesmtp to smtp messages onto
the mail server . i have used the example code in
mail-file.c as a Guideline to use the libesmtp API. I
have threaded my application using pthreads and am
running on a Redhat 7 Linux system. The Problems i
have faced..


1) In a Loop where i have sent abt 20 Mails per
session, there is a Memory Leak, found using
dmalloc.It points to a code in
libesmtp/concatenate.c(cat_alloc). The leak was found
after i had freed up session and authcontext. about 26
Bytes were lost for each mail sent.

2) while using libesmtp in pthread, i get Segmentation
Fault. Have Traced to problem to 
smtp_set_header (tempPData->message,...).
i tried using mutex to sycn with other threads but to
no avail. app crashes.

I believe i might be using the wrong approach. i have
used to api as in examples/mail-file.c and that might
have caused to problem. I have tried looking around
for example codes for libesmtp for pthreaded
environments, but cant find one.

Can Someone help me out with a framework code of
libesmtp that can be used with pthreads. or is there
something i am missing out.

Thankyou in advance for any help rendered.


Warm Regards
Anil Oommen
Lead Developer
Attract Ventures

NOTE: i have configured and installed libesmtp with
the --pthreads turned on.

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com