cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Curl_dofree function

From: Nazim Oztahtaci <nazim_oztahtaci_at_hotmail.com>
Date: Thu, 3 Nov 2011 10:52:35 +0000

The thing Im doing is recursively sending test emails to my smtp server. When I use TLS, I dont face any problem and I sent around 100.000 emails during test phase without any problem.
However, when I try to send emails via pure SMTP without authentication, after first email, my module throws exception on curl_dofree (actually it is a redefinition of free(smtpc->domain) function.)

In my previous email I said that problem was solved by NOBODY option but now I use FRESH_CONNECT and FORBID_REUSE options so each time the curl uses a new connection and closes it at the end of process.

When our smtp module opens up a connection to smtp server using libcurl, it uses same connection to send recursive emails to the server. However, because it does not close the connection after first trial, in the second try curl_dofree() fails because free(smtpc->domain) function does not the EHLO message I assume. Maybe I am wrong as well about the error. I will send you a test code tomorrow and you can also check for me if it is a bug or not.

Best regards,
Nazim

> Date: Wed, 2 Nov 2011 13:00:13 +0100
> From: daniel_at_haxx.se
> To: curl-library_at_cool.haxx.se
> Subject: RE: Curl_dofree function
>
> On Tue, 1 Nov 2011, Nazim Oztahtaci wrote:
>
> > I am sorry for spamming. I have found the reason of the problem so maybe it
> > might be helpful for people who will face the same problem in future.
> >
> > I did not set NOBODY option previously in my code so the connection between
> > SMTP server and client was ongoing. That's why in the second try, Free
> > function could not delete the first message : free(smtpc->domain);
> >
> > It was working on SSL because after each connection, SSL session was closed
> > automatically. Using the NOBODY option solved the problem.
>
> I'm not sure I get it. If you can get a crash with a legitimate libcurl- using
> problem then that is a bug. Can you show us the code for an equivalent program
> that causes this problem?
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
                                               

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-03