66 |
close_connection(conn); |
close_connection(conn); |
67 |
return ERROR_NETWORK; |
return ERROR_NETWORK; |
68 |
} |
} |
69 |
info("Connected to %s.\n", he->h_name); |
if (conn == &connpri) |
70 |
|
info("Connected to %s.\n", he->h_name); |
71 |
|
|
72 |
#ifdef SSL_TLS |
#ifdef SSL_TLS |
73 |
if (protocol != SSL_DISABLED) |
if (protocol != SSL_DISABLED) |
158 |
int |
int |
159 |
close_connection(conn_t * conn) |
close_connection(conn_t * conn) |
160 |
{ |
{ |
161 |
|
#ifdef SSL_TLS |
162 |
if (conn->ssl) { |
if (conn->ssl) { |
163 |
SSL_shutdown(conn->ssl); |
SSL_shutdown(conn->ssl); |
164 |
SSL_free(conn->ssl); |
SSL_free(conn->ssl); |
165 |
conn->ssl = NULL; |
conn->ssl = NULL; |
166 |
} |
} |
167 |
|
#endif |
168 |
if (conn->sock >= 0 && close(conn->sock) == -1) { |
if (conn->sock >= 0 && close(conn->sock) == -1) { |
169 |
error("closing socket; %s\n", strerror(errno)); |
error("closing socket; %s\n", strerror(errno)); |
170 |
return ERROR_NETWORK; |
return ERROR_NETWORK; |