lightmelody

changeset 739:37088291364e objectify

Lm.SSL now produces compatible API get_use_starttls() is a method, not a property, to avoid namespace conflict with the method use_starttls. One or both of these will need to be deprecated to clean this up.
author Arc Riley <arcriley@gmail.com>
date Thu, 16 Oct 2014 10:33:22 +0000
parents 42e7bc90547b
children 521e1653f1e2
files src/SSL.gs
diffstat 1 files changed, 30 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/src/SSL.gs	Thu Oct 16 10:30:09 2014 +0000
     1.2 +++ b/src/SSL.gs	Thu Oct 16 10:33:22 2014 +0000
     1.3 @@ -22,6 +22,9 @@
     1.4  
     1.5  class Lm.SSL : Object
     1.6  
     1.7 +    delegate Function (ssl : SSL, status : Status) : Response
     1.8 +
     1.9 +
    1.10      enum Response
    1.11          CONTINUE
    1.12          STOP
    1.13 @@ -36,13 +39,32 @@
    1.14          CERT_FINGERPRINT_MISMATCH
    1.15          GENERIC_ERROR
    1.16  
    1.17 -    /*
    1.18 -    construct (expected_fingerprint : string, ssl_function : SSLFunction)
    1.19  
    1.20 -    public unowned string get_fingerprint ();
    1.21 -    public bool get_require_starttls ();
    1.22 -    public bool get_use_starttls ();
    1.23 -    public static bool is_supported ();
    1.24 -    public void use_starttls (bool use_starttls, bool require);
    1.25 -    */
    1.26 +    construct (expected_fingerprint : string, ssl_function : Function)
    1.27 +        _fingerprint = ""
    1.28 +        _require_starttls = true
    1.29  
    1.30 +
    1.31 +    //////////////////////////////////////////////////////////////////////////
    1.32 +    // Methods
    1.33 +
    1.34 +    def get_use_starttls ( ) : bool
    1.35 +        return true
    1.36 +
    1.37 +
    1.38 +    def is_supported ( ) : bool
    1.39 +        return true
    1.40 +
    1.41 +
    1.42 +    def use_starttls (use_starttls : bool, require : bool)
    1.43 +        return
    1.44 +
    1.45 +
    1.46 +    //////////////////////////////////////////////////////////////////////////
    1.47 +    // Properties
    1.48 +
    1.49 +    prop readonly fingerprint : string
    1.50 +
    1.51 +
    1.52 +    prop readonly require_starttls : bool
    1.53 +