Link Here
|
1 |
--- src/core/servers-setup.c.orig 2019-08-29 13:48:46 UTC |
2 |
+++ src/core/servers-setup.c |
3 |
@@ -108,6 +108,35 @@ void server_setup_fill_reconn(SERVER_CONNECT_REC *conn |
4 |
if (sserver->password != NULL && conn->password == NULL) |
5 |
conn->password = g_strdup(sserver->password); |
6 |
|
7 |
+ if (sserver->no_proxy) |
8 |
+ g_free_and_null(conn->proxy); |
9 |
+ |
10 |
+ if (sserver->family != 0 && conn->family == 0) |
11 |
+ conn->family = sserver->family; |
12 |
+ if (sserver->address && !conn->address) |
13 |
+ conn->address = g_strdup(sserver->address); |
14 |
+ if (sserver->port > 0 && conn->port <= 0) |
15 |
+ conn->port = sserver->port; |
16 |
+ |
17 |
+ conn->use_tls = sserver->use_tls; |
18 |
+ if (conn->tls_cert == NULL && sserver->tls_cert != NULL && sserver->tls_cert[0] != '\0') |
19 |
+ conn->tls_cert = g_strdup(sserver->tls_cert); |
20 |
+ if (conn->tls_pkey == NULL && sserver->tls_pkey != NULL && sserver->tls_pkey[0] != '\0') |
21 |
+ conn->tls_pkey = g_strdup(sserver->tls_pkey); |
22 |
+ if (conn->tls_pass == NULL && sserver->tls_pass != NULL && sserver->tls_pass[0] != '\0') |
23 |
+ conn->tls_pass = g_strdup(sserver->tls_pass); |
24 |
+ conn->tls_verify = sserver->tls_verify; |
25 |
+ if (conn->tls_cafile == NULL && sserver->tls_cafile != NULL && sserver->tls_cafile[0] != '\0') |
26 |
+ conn->tls_cafile = g_strdup(sserver->tls_cafile); |
27 |
+ if (conn->tls_capath == NULL && sserver->tls_capath != NULL && sserver->tls_capath[0] != '\0') |
28 |
+ conn->tls_capath = g_strdup(sserver->tls_capath); |
29 |
+ if (conn->tls_ciphers == NULL && sserver->tls_ciphers != NULL && sserver->tls_ciphers[0] != '\0') |
30 |
+ conn->tls_ciphers = g_strdup(sserver->tls_ciphers); |
31 |
+ if (conn->tls_pinned_cert == NULL && sserver->tls_pinned_cert != NULL && sserver->tls_pinned_cert[0] != '\0') |
32 |
+ conn->tls_pinned_cert = g_strdup(sserver->tls_pinned_cert); |
33 |
+ if (conn->tls_pinned_pubkey == NULL && sserver->tls_pinned_pubkey != NULL && sserver->tls_pinned_pubkey[0] != '\0') |
34 |
+ conn->tls_pinned_pubkey = g_strdup(sserver->tls_pinned_pubkey); |
35 |
+ |
36 |
signal_emit("server setup fill reconn", 2, conn, sserver); |
37 |
} |
38 |
|
39 |
@@ -158,33 +187,6 @@ static void server_setup_fill_server(SERVER_CONNECT_RE |
40 |
g_return_if_fail(IS_SERVER_SETUP(sserver)); |
41 |
|
42 |
sserver->last_connect = time(NULL); |
43 |
- |
44 |
- if (sserver->no_proxy) |
45 |
- g_free_and_null(conn->proxy); |
46 |
- |
47 |
- if (sserver->family != 0 && conn->family == 0) |
48 |
- conn->family = sserver->family; |
49 |
- if (sserver->port > 0 && conn->port <= 0) |
50 |
- conn->port = sserver->port; |
51 |
- |
52 |
- conn->use_tls = sserver->use_tls; |
53 |
- if (conn->tls_cert == NULL && sserver->tls_cert != NULL && sserver->tls_cert[0] != '\0') |
54 |
- conn->tls_cert = g_strdup(sserver->tls_cert); |
55 |
- if (conn->tls_pkey == NULL && sserver->tls_pkey != NULL && sserver->tls_pkey[0] != '\0') |
56 |
- conn->tls_pkey = g_strdup(sserver->tls_pkey); |
57 |
- if (conn->tls_pass == NULL && sserver->tls_pass != NULL && sserver->tls_pass[0] != '\0') |
58 |
- conn->tls_pass = g_strdup(sserver->tls_pass); |
59 |
- conn->tls_verify = sserver->tls_verify; |
60 |
- if (conn->tls_cafile == NULL && sserver->tls_cafile != NULL && sserver->tls_cafile[0] != '\0') |
61 |
- conn->tls_cafile = g_strdup(sserver->tls_cafile); |
62 |
- if (conn->tls_capath == NULL && sserver->tls_capath != NULL && sserver->tls_capath[0] != '\0') |
63 |
- conn->tls_capath = g_strdup(sserver->tls_capath); |
64 |
- if (conn->tls_ciphers == NULL && sserver->tls_ciphers != NULL && sserver->tls_ciphers[0] != '\0') |
65 |
- conn->tls_ciphers = g_strdup(sserver->tls_ciphers); |
66 |
- if (conn->tls_pinned_cert == NULL && sserver->tls_pinned_cert != NULL && sserver->tls_pinned_cert[0] != '\0') |
67 |
- conn->tls_pinned_cert = g_strdup(sserver->tls_pinned_cert); |
68 |
- if (conn->tls_pinned_pubkey == NULL && sserver->tls_pinned_pubkey != NULL && sserver->tls_pinned_pubkey[0] != '\0') |
69 |
- conn->tls_pinned_pubkey = g_strdup(sserver->tls_pinned_pubkey); |
70 |
|
71 |
server_setup_fill_reconn(conn, sserver); |
72 |
|