Skip to content

Commit

Permalink
tls: remove unnecessary TLS init
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Sep 14, 2015
1 parent d71e8f2 commit a9486e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
7 changes: 1 addition & 6 deletions modules/proto_tls/proto_tls.c
Expand Up @@ -155,11 +155,6 @@ static int mod_init(void)
return -1;
}

if (tls_mgm_api.mod_init() < 0) {
LM_ERR("could not initialize TLS engine\n");
return -1;
}

return 0;
}

Expand Down Expand Up @@ -499,4 +494,4 @@ static int tls_read_req(struct tcp_connection* con, int* bytes_read)
error:
/* connection will be released as ERROR */
return -1;
}
}
8 changes: 0 additions & 8 deletions modules/tls_mgm/api.h
Expand Up @@ -7,29 +7,21 @@

#ifndef API_H

typedef int (*get_client_domain_f) (void);
typedef struct tls_domain * (*tls_find_server_domain_f) (struct ip_addr *, unsigned short);
typedef struct tls_domain * (*tls_find_client_domain_f) (struct ip_addr *, unsigned short);
typedef struct tls_domain * (*tls_find_client_domain_name_f) (str);
typedef int (*get_send_timeout_f) (void);
typedef int (*get_handshake_timeout_f) (void);
typedef int (*tls_mod_init_f) (void);

struct tls_mgm_binds {
get_client_domain_f get_client_domain;
get_send_timeout_f get_send_timeout;
get_handshake_timeout_f get_handshake_timeout;
tls_find_server_domain_f find_server_domain;
tls_find_client_domain_f find_client_domain;
tls_find_client_domain_name_f find_client_domain_name;
tls_mod_init_f mod_init;
};


typedef int(*load_tls_mgm_f)(struct tls_mgm_binds *binds);

int load_tls_mgm(struct tls_mgm_binds *binds);

static inline int load_tls_mgm_api(struct tls_mgm_binds *binds) {
load_tls_mgm_f load_tls;

Expand Down
4 changes: 3 additions & 1 deletion modules/tls_mgm/tls_mgm.c
Expand Up @@ -37,6 +37,8 @@ static int mod_init(void);
static void mod_destroy(void);
static int tls_get_handshake_timeout(void);
static int tls_get_send_timeout(void);
static int load_tls_mgm(struct tls_mgm_binds *binds);


/* definition of exported functions */
static int is_peer_verified(struct sip_msg*, char*, char*);
Expand Down Expand Up @@ -1139,7 +1141,7 @@ static int tls_get_send_timeout(void)
return tls_send_timeout;
}

int load_tls_mgm(struct tls_mgm_binds *binds)
static int load_tls_mgm(struct tls_mgm_binds *binds)
{
binds->find_server_domain = tls_find_server_domain;
binds->find_client_domain = tls_find_client_domain;
Expand Down

0 comments on commit a9486e5

Please sign in to comment.