From f837f5126212636d331c586489561dcef1ed5464 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 7 Mar 2020 23:57:19 +0000 Subject: [PATCH] send ssl struct when logging error message FossilOrigin-Name: 3fdaf0bd98b07ef474fc82ff2d61ded4f740cfe399241d932a88430dce5a6540 --- src/cw/dtls_openssl_connect.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/cw/dtls_openssl_connect.c b/src/cw/dtls_openssl_connect.c index d77c01e6..34e48abf 100644 --- a/src/cw/dtls_openssl_connect.c +++ b/src/cw/dtls_openssl_connect.c @@ -42,7 +42,8 @@ static BIO_METHOD bio_methods = { } -int dtls_openssl_connect(struct conn *conn) +int +dtls_openssl_connect(struct conn *conn) { struct dtls_openssl_data *d; int rc; @@ -58,8 +59,8 @@ int dtls_openssl_connect(struct conn *conn) return 0; /* -// if (conn->dtls_psk) -// SSL_set_psk_client_callback(d->ssl, psk_client_cb); + if (conn->dtls_psk) + SSL_set_psk_client_callback(d->ssl, psk_client_cb); */ @@ -68,7 +69,7 @@ int dtls_openssl_connect(struct conn *conn) do { rc = SSL_connect(d->ssl); }while(rc!=1 && errno==EAGAIN && !cw_timer_timeout(timer)); - + if (rc == 1) { cw_dbg(DBG_DTLS,"SSL connect successfull!"); @@ -77,10 +78,7 @@ int dtls_openssl_connect(struct conn *conn) return 1; } - rc = dtls_openssl_log_error(0, rc, "DTLS connect"); - - - - + rc = dtls_openssl_log_error(d->ssl, rc, "DTLS connect"); return 0; } +