Skip to content

Commit b832730

Browse files
committed
Remove condition which is always false
If sslconn->non_ssl_request is set to either NON_SSL_SEND_REQLINE or NON_SSL_SEND_HDR_SEP we cannot close the connection here. We handle NON_SSL_SEND_REQLINE and NON_SSL_SEND_HDR_SEP later again in the input filter and in ssl_hook_ReadReq to return an appropriate error message to the client. PR: 69773 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927880 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1ff8121 commit b832730

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

modules/ssl/mod_ssl.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,23 @@ static int ssl_hook_process_connection(conn_rec* c)
709709
AP_MODE_INIT, APR_BLOCK_READ, 0);
710710
apr_brigade_destroy(temp);
711711

712-
if (APR_SUCCESS != APR_SUCCESS) {
713-
if (c->cs) {
714-
c->cs->state = CONN_STATE_LINGER;
712+
if (rv != APR_SUCCESS) {
713+
/*
714+
* We handle NON_SSL_SEND_REQLINE and NON_SSL_SEND_HDR_SEP
715+
* later again in the input filter and in ssl_hook_ReadReq
716+
* to return an appropriate error message to the client.
717+
* Hence do not close the connection here.
718+
*/
719+
if ((sslconn->non_ssl_request != NON_SSL_SEND_REQLINE) &&
720+
(sslconn->non_ssl_request != NON_SSL_SEND_HDR_SEP)) {
721+
if (c->cs) {
722+
c->cs->state = CONN_STATE_LINGER;
723+
}
724+
ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c, APLOGNO(10373)
725+
"SSL handshake was not completed, "
726+
"closing connection");
727+
return OK;
715728
}
716-
ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c, APLOGNO(10373)
717-
"SSL handshake was not completed, "
718-
"closing connection");
719-
return OK;
720729
}
721730
}
722731

0 commit comments

Comments
 (0)