fixed;
This commit is contained in:
parent
dc6a9781cd
commit
bb28ee9a63
@ -466,6 +466,11 @@ static void __connection_destroy(conn_t *co)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&co->idx_msg_lock);
|
pthread_mutex_unlock(&co->idx_msg_lock);
|
||||||
|
|
||||||
|
/* update use count */
|
||||||
|
_CONN_NOTINUSE(co);
|
||||||
|
|
||||||
|
/* ok, let's free other if we can */
|
||||||
|
if(!_CONN_UCOUNT(co)) {
|
||||||
/* ok now we will free the channels */
|
/* ok now we will free the channels */
|
||||||
pthread_mutex_lock(&co->idx_ch_lock);
|
pthread_mutex_lock(&co->idx_ch_lock);
|
||||||
for(i = 0; i < 512; i++) {
|
for(i = 0; i < 512; i++) {
|
||||||
@ -476,12 +481,10 @@ static void __connection_destroy(conn_t *co)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&co->idx_ch_lock);
|
pthread_mutex_unlock(&co->idx_ch_lock);
|
||||||
|
|
||||||
/* update use count */
|
|
||||||
_CONN_NOTINUSE(co);
|
|
||||||
|
|
||||||
/* ok, let's free other if we can */
|
|
||||||
if(!_CONN_UCOUNT(co)) {
|
|
||||||
if(ssys->on_destroy) ssys->on_destroy(co);
|
if(ssys->on_destroy) ssys->on_destroy(co);
|
||||||
|
if(co->pctx->login) free(co->pctx->login);
|
||||||
|
if(co->pctx->passwd) free(co->pctx->passwd);
|
||||||
|
|
||||||
SSL_shutdown(co->ssl);
|
SSL_shutdown(co->ssl);
|
||||||
close(SSL_get_fd(co->ssl));
|
close(SSL_get_fd(co->ssl));
|
||||||
SSL_free(co->ssl);
|
SSL_free(co->ssl);
|
||||||
|
@ -170,24 +170,13 @@ static void sigpipe_handler(int a)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// set detailed signal handler
|
|
||||||
// struct sigaction sigact, sigpipe;
|
|
||||||
// sigact.sa_flags = SA_SIGINFO;
|
|
||||||
// sigact.sa_sigaction = signal_error;
|
|
||||||
// sigemptyset(&sigact.sa_mask);
|
|
||||||
// sigaction(SIGFPE, &sigact, 0);
|
|
||||||
// sigaction(SIGILL, &sigact, 0);
|
|
||||||
// sigaction(SIGSEGV, &sigact, 0);
|
|
||||||
// sigaction(SIGBUS, &sigact, 0);
|
|
||||||
|
|
||||||
// memset(&sigpipe, 0, sizeof(struct sigaction));
|
|
||||||
// sigpipe.sa_handler = sigpipe_handler;
|
|
||||||
// sigaction(SIGPIPE, &sigpipe, NULL);
|
|
||||||
char *rootca = NULL, *cert = NULL;
|
char *rootca = NULL, *cert = NULL;
|
||||||
conn_sys_t *ssys = connections_create();
|
conn_sys_t *ssys = connections_create();
|
||||||
int port = DEFAULT_PORT;
|
int port = DEFAULT_PORT;
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
while((opt = getopt(argc, argv, "p:r:u:")) != -1) {
|
while((opt = getopt(argc, argv, "p:r:u:")) != -1) {
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'p':
|
case 'p':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user