Hi Daniel,

Yes, it happens in NSS only.  I just verified that.  I built the source and 
attached a debugger.  I think this fixes the problem:

-bash-4.0# diff -c lib/nssorig.c lib/nss.c
*** lib/nssorig.c    Fri Oct 16 20:51:42 2009
--- lib/nss.c    Fri Oct 16 21:05:06 2009
***************
*** 896,901 ****
--- 896,902 ----

   if(connssl->handle) {
     PR_Close(connssl->handle);
+     conn->sock[sockindex] = CURL_SOCKET_BAD;
     if(connssl->client_nickname != NULL) {
       free(connssl->client_nickname);
       connssl->client_nickname = NULL;

Later sclose is called in conn_free if it is not set to CURL_SOCKET_BAD:

  /* close possibly still open sockets */
  if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET])
    sclose(conn->sock[SECONDARYSOCKET]);
  if(CURL_SOCKET_BAD != conn->sock[FIRSTSOCKET])
    sclose(conn->sock[FIRSTSOCKET]);

I'm trying this now to see if this solved my issue.  It did solve the double 
close with the simple test using the command line. 

Thanks!

~Kevin






________________________________
From: Daniel Stenberg <[email protected]>
To: libcurl development <[email protected]>
Sent: Sat, October 17, 2009 3:42:00 PM
Subject: Re: Double close with SSL

On Thu, 15 Oct 2009, Kevin Baughman wrote:

> curl https://customers.countrywide.com/protected/entry_authenticated.asp

I tried valgrind on this with my curl built with OpenSSL and I get no double 
close... Can you run your version with valgrind to see if the problem isn't 
within or perhaps related to NSS?

-- 
/ 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

Reply via email to