changeset fcd2f1221914 in /home/hg/repos/gajim

author: Fedor Brunner <[email protected]>
branches: gajim_0.16
details:http://hg.gajim.org/gajim?cmd=changeset;node=fcd2f1221914
description: Defer the creation of XTLS until it's first time used.
        This will make Gajim start a bit faster and more entropy can be
        generated for key generation.

diffstat:

 src/common/check_paths.py |  7 -------
 src/common/jingle_ft.py   |  9 +++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r 9528eb6f8432 -r fcd2f1221914 src/common/check_paths.py
--- a/src/common/check_paths.py Tue Apr 15 12:42:09 2014 +0200
+++ b/src/common/check_paths.py Tue Apr 15 14:01:55 2014 +0200
@@ -30,7 +30,6 @@
 
 from common import gajim
 import logger
-from common import jingle_xtls
 
 # DO NOT MOVE ABOVE OF import gajim
 import sqlite3 as sqlite
@@ -350,12 +349,6 @@
         create_path(XTLS_CERTS)
     if not os.path.exists(LOCAL_XTLS_CERTS):
         create_path(LOCAL_XTLS_CERTS)
-    cert_name = os.path.join(LOCAL_XTLS_CERTS,
-        jingle_xtls.SELF_SIGNED_CERTIFICATE)
-    if not (os.path.exists(cert_name + '.cert') and os.path.exists(
-    cert_name + '.pkey')):
-        jingle_xtls.make_certs(cert_name, 'gajim')
-
 
 def create_path(directory):
     head, tail = os.path.split(directory)
diff -r 9528eb6f8432 -r fcd2f1221914 src/common/jingle_ft.py
--- a/src/common/jingle_ft.py   Tue Apr 15 12:42:09 2014 +0200
+++ b/src/common/jingle_ft.py   Tue Apr 15 14:01:55 2014 +0200
@@ -19,9 +19,11 @@
 Handles  Jingle File Transfer (XEP 0234)
 """
 
+import os
 import hashlib
 import gajim
 import nbxmpp
+import configpaths
 import jingle_xtls
 from jingle_content import contents, JingleContent
 from jingle_transport import *
@@ -108,6 +110,13 @@
                    STATE_TRANSPORT_REPLACE : StateTransportReplace(self),
               STATE_CAND_SENT_AND_RECEIVED : StateCandSentAndRecv(self)
         }
+        
+        if jingle_xtls.PYOPENSSL_PRESENT:
+            cert_name = os.path.join(configpaths.gajimpaths['MY_CERT'],
+                                     jingle_xtls.SELF_SIGNED_CERTIFICATE)
+            if not (os.path.exists(cert_name + '.cert')
+                    and os.path.exists(cert_name + '.pkey')):
+                jingle_xtls.make_certs(cert_name, 'gajim')
 
     def __state_changed(self, nextstate, args=None):
         # Executes the next state action and sets the next state
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to