Skip to content

Commit

Permalink
CLEANUP: connection: properly name the CO_ER_SSL_FATAL enum entry
Browse files Browse the repository at this point in the history
It was the only one prefixed with "CO_ERR_", making it harder to batch
process and to look up. It was added in 2.5 by commit 61944f7 ("MINOR:
ssl: Set connection error code in case of SSL read or write fatal failure")
so it can be backported as far as 2.6 if needed to help integrate other
patches.

(cherry picked from commit 3939579)
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit c91c678)
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit 69c43ef)
Signed-off-by: Christopher Faulet <[email protected]>
  • Loading branch information
wtarreau authored and capflam committed Nov 6, 2024
1 parent 63b68cd commit f18a7d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/haproxy/connection-t.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ enum {
CO_ER_SOCKS4_DENY, /* SOCKS4 Proxy deny the request */
CO_ER_SOCKS4_ABORT, /* SOCKS4 Proxy handshake aborted by server */

CO_ERR_SSL_FATAL, /* SSL fatal error during a SSL_read or SSL_write */
CO_ER_SSL_FATAL, /* SSL fatal error during a SSL_read or SSL_write */
};

/* error return codes for accept_conn() */
Expand Down
2 changes: 1 addition & 1 deletion src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ const char *conn_err_code_str(struct connection *c)
case CO_ER_SOCKS4_DENY: return "SOCKS4 Proxy deny the request";
case CO_ER_SOCKS4_ABORT: return "SOCKS4 Proxy handshake aborted by server";

case CO_ERR_SSL_FATAL: return "SSL fatal error";
case CO_ER_SSL_FATAL: return "SSL fatal error";
}
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ssl_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -6499,7 +6499,7 @@ static size_t ssl_sock_to_buf(struct connection *conn, void *xprt_ctx, struct bu
struct ssl_sock_ctx *ctx = conn_get_ssl_sock_ctx(conn);
if (ctx && !ctx->error_code)
ctx->error_code = ERR_peek_error();
conn->err_code = CO_ERR_SSL_FATAL;
conn->err_code = CO_ER_SSL_FATAL;
}
/* For SSL_ERROR_SYSCALL, make sure to clear the error
* stack before shutting down the connection for
Expand Down Expand Up @@ -6675,7 +6675,7 @@ static size_t ssl_sock_from_buf(struct connection *conn, void *xprt_ctx, const s

if (ctx && !ctx->error_code)
ctx->error_code = ERR_peek_error();
conn->err_code = CO_ERR_SSL_FATAL;
conn->err_code = CO_ER_SSL_FATAL;
}
goto out_error;
}
Expand Down

0 comments on commit f18a7d3

Please sign in to comment.