Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_con


Modified Files:
        ecore_con.c 


Log Message:
Delay allocation of SSL library memory until necessary.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- ecore_con.c 23 Sep 2005 05:46:56 -0000      1.53
+++ ecore_con.c 27 Nov 2005 07:18:36 -0000      1.54
@@ -44,6 +44,7 @@
 
 static Ecore_List *servers = NULL;
 static int init_count = 0;
+static int ssl_init_count = 0;
 
 #define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct 
sockaddr_un *)NULL)->sun_path))
 
@@ -72,11 +73,6 @@
    ECORE_CON_EVENT_CLIENT_DATA = ecore_event_type_new();
    ECORE_CON_EVENT_SERVER_DATA = ecore_event_type_new();
 
-#if USE_OPENSSL
-   SSL_library_init();
-   SSL_load_error_strings();
-#endif
-
    /* TODO Remember return value, if it fails, use gethostbyname() */
    ecore_con_dns_init();
 
@@ -295,6 +291,13 @@
 #if USE_OPENSSL
    if (compl_type & ECORE_CON_USE_SSL)
      {
+       if (!ssl_init_count)
+         {
+            SSL_library_init();
+            SSL_load_error_strings();
+         }
+       ssl_init_count++;
+
        /* SSLv3 gives *weird* results on my box, don't use it yet */
        if (!(svr->ssl_ctx = SSL_CTX_new(SSLv2_client_method())))
          goto error;
@@ -847,6 +850,13 @@
 svr_try_connect_ssl(Ecore_Con_Server *svr)
 {
    int res, ssl_err, flag = 0;
+
+   if (!ssl_init_count)
+     {
+       SSL_library_init();
+       SSL_load_error_strings();
+     }
+   ssl_init_count++;
    
    res = SSL_connect(svr->ssl);
    if (res == 1) return 1;
@@ -918,6 +928,13 @@
 #if USE_OPENSSL
    if (svr->type & ECORE_CON_USE_SSL)
      {
+       if (!ssl_init_count)
+         {
+            SSL_library_init();
+            SSL_load_error_strings();
+         }
+       ssl_init_count++;
+
        /* SSLv3 gives *weird* results on my box, don't use it yet */
        if (!(svr->ssl_ctx = SSL_CTX_new(SSLv2_client_method())))
          goto error;




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to