Browse Source

[multiple] mark con->srv_socket a const ptr

master
Glenn Strauss 7 months ago
parent
commit
924d3c9bd6
  1. 2
      src/base.h
  2. 2
      src/connections.c
  3. 2
      src/connections.h
  4. 2
      src/mod_gnutls.c
  5. 2
      src/mod_mbedtls.c
  6. 2
      src/mod_nss.c
  7. 2
      src/mod_openssl.c
  8. 2
      src/mod_wolfssl.c
  9. 4
      src/server.c

2
src/base.h

@ -50,7 +50,7 @@ struct connection {
sock_addr dst_addr;
buffer *dst_addr_buf;
struct server_socket *srv_socket; /* reference to the server-socket */
const struct server_socket *srv_socket; /* reference to the server-socket */
/* timestamps */
time_t read_idle_ts;

2
src/connections.c

@ -973,7 +973,7 @@ static int connection_write_cq(connection *con, chunkqueue *cq, off_t max_bytes)
static handler_t connection_handle_read_post_state(request_st * const r);
connection *connection_accepted(server *srv, server_socket *srv_socket, sock_addr *cnt_addr, int cnt) {
connection *connection_accepted(server *srv, const server_socket *srv_socket, sock_addr *cnt_addr, int cnt) {
connection *con;
srv->cur_fds++;

2
src/connections.h

@ -17,7 +17,7 @@ void connection_periodic_maint (server *srv, time_t cur_ts);
int connection_send_1xx (request_st *r, connection *con);
connection * connection_accept(server *srv, struct server_socket *srv_sock);
connection * connection_accepted(server *srv, struct server_socket *srv_socket, sock_addr *cnt_addr, int cnt);
connection * connection_accepted(server *srv, const struct server_socket *srv_socket, sock_addr *cnt_addr, int cnt);
void connection_state_machine(connection *con);

2
src/mod_gnutls.c

@ -2570,7 +2570,7 @@ mod_gnutls_debug_cb(int level, const char *str)
CONNECTION_FUNC(mod_gnutls_handle_con_accept)
{
server_socket *srv_sock = con->srv_socket;
const server_socket *srv_sock = con->srv_socket;
if (!srv_sock->is_ssl) return HANDLER_GO_ON;
plugin_data *p = p_d;

2
src/mod_mbedtls.c

@ -2235,7 +2235,7 @@ mod_mbedtls_debug_cb(void *ctx, int level,
CONNECTION_FUNC(mod_mbedtls_handle_con_accept)
{
server_socket *srv_sock = con->srv_socket;
const server_socket *srv_sock = con->srv_socket;
if (!srv_sock->is_ssl) return HANDLER_GO_ON;
plugin_data *p = p_d;

2
src/mod_nss.c

@ -2324,7 +2324,7 @@ connection_read_cq_ssl (connection *con, chunkqueue *cq, off_t max_bytes)
CONNECTION_FUNC(mod_nss_handle_con_accept)
{
server_socket *srv_sock = con->srv_socket;
const server_socket *srv_sock = con->srv_socket;
if (!srv_sock->is_ssl) return HANDLER_GO_ON;
plugin_data *p = p_d;

2
src/mod_openssl.c

@ -3237,7 +3237,7 @@ connection_read_cq_ssl (connection *con, chunkqueue *cq, off_t max_bytes)
CONNECTION_FUNC(mod_openssl_handle_con_accept)
{
server_socket *srv_sock = con->srv_socket;
const server_socket *srv_sock = con->srv_socket;
if (!srv_sock->is_ssl) return HANDLER_GO_ON;
plugin_data *p = p_d;

2
src/mod_wolfssl.c

@ -2999,7 +2999,7 @@ connection_read_cq_ssl (connection *con, chunkqueue *cq, off_t max_bytes)
CONNECTION_FUNC(mod_openssl_handle_con_accept)
{
server_socket *srv_sock = con->srv_socket;
const server_socket *srv_sock = con->srv_socket;
if (!srv_sock->is_ssl) return HANDLER_GO_ON;
plugin_data *p = p_d;

4
src/server.c

@ -451,7 +451,7 @@ static int server_oneshot_init_pipe(server *srv, int fdin, int fdout) {
* NCAT_PROTO (TCP, UDP, SCTP)
*/
connection *con;
server_socket *srv_socket;
const server_socket *srv_socket;
sock_addr cnt_addr;
/* detect if called from netcat or else fabricate localhost addrs */
@ -524,7 +524,7 @@ static int server_oneshot_init_pipe(server *srv, int fdin, int fdout) {
__attribute_cold__
static int server_oneshot_init(server *srv, int fd) {
connection *con;
server_socket *srv_socket;
const server_socket *srv_socket;
sock_addr cnt_addr;
socklen_t cnt_len;

Loading…
Cancel
Save