comparison src/event/ngx_event_openssl.c @ 8664:f61d347158d0 quic

Merged with the default branch.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 15 Dec 2020 16:55:43 +0000
parents 507da0d3b070 7efae6b4cfb0
children 05e0988a6898
comparison
equal deleted inserted replaced
8663:1823e2152fc4 8664:f61d347158d0
2885 * Avoid calling SSL_shutdown() if handshake wasn't completed. 2885 * Avoid calling SSL_shutdown() if handshake wasn't completed.
2886 */ 2886 */
2887 2887
2888 SSL_free(c->ssl->connection); 2888 SSL_free(c->ssl->connection);
2889 c->ssl = NULL; 2889 c->ssl = NULL;
2890 c->recv = ngx_recv;
2890 2891
2891 return NGX_OK; 2892 return NGX_OK;
2892 } 2893 }
2893 2894
2894 if (c->timedout || c->error || c->buffered) { 2895 if (c->timedout || c->error || c->buffered) {
2930 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_shutdown: %d", n); 2931 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_shutdown: %d", n);
2931 2932
2932 if (n == 1) { 2933 if (n == 1) {
2933 SSL_free(c->ssl->connection); 2934 SSL_free(c->ssl->connection);
2934 c->ssl = NULL; 2935 c->ssl = NULL;
2936 c->recv = ngx_recv;
2935 2937
2936 return NGX_OK; 2938 return NGX_OK;
2937 } 2939 }
2938 2940
2939 if (n == 0 && tries-- > 1) { 2941 if (n == 0 && tries-- > 1) {
2972 } 2974 }
2973 2975
2974 if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) { 2976 if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) {
2975 SSL_free(c->ssl->connection); 2977 SSL_free(c->ssl->connection);
2976 c->ssl = NULL; 2978 c->ssl = NULL;
2979 c->recv = ngx_recv;
2977 2980
2978 return NGX_OK; 2981 return NGX_OK;
2979 } 2982 }
2980 2983
2981 err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0; 2984 err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
2982 2985
2983 ngx_ssl_connection_error(c, sslerr, err, "SSL_shutdown() failed"); 2986 ngx_ssl_connection_error(c, sslerr, err, "SSL_shutdown() failed");
2984 2987
2985 SSL_free(c->ssl->connection); 2988 SSL_free(c->ssl->connection);
2986 c->ssl = NULL; 2989 c->ssl = NULL;
2990 c->recv = ngx_recv;
2987 2991
2988 return NGX_ERROR; 2992 return NGX_ERROR;
2989 } 2993 }
2990 } 2994 }
2991 2995