Skip to content

Commit

Permalink
Use TCP home server listener "nonblock" option when creating client s…
Browse files Browse the repository at this point in the history
…ocket
  • Loading branch information
ndptech committed Jul 19, 2024
1 parent 8639351 commit f440863
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static int tls_sni_callback(SSL *ssl, UNUSED int *al, void *arg)
* one.
*/
if (r) (void) SSL_set_SSL_CTX(ssl, r->ctx);

/*
* Set an attribute saying which server has been selected.
*/
Expand Down Expand Up @@ -3585,6 +3585,8 @@ rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t
if (home->proto == IPPROTO_TCP) {
this->recv = proxy_socket_tcp_recv;

this->nonblock |= home->nonblock;

/*
* FIXME: connect() is blocking!
* We do this with the proxy mutex locked, which may
Expand All @@ -3593,7 +3595,7 @@ rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t
this->fd = fr_socket_client_tcp(&home->src_ipaddr,
&home->ipaddr, home->port,
#ifdef WITH_TLS
!this->nonblock
this->nonblock
#else
false
#endif
Expand Down Expand Up @@ -3638,8 +3640,6 @@ rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t
this->radiusv11 = home->tls->radiusv11;
#endif

this->nonblock |= home->nonblock;

#ifdef TCP_NODELAY
/*
* Also set TCP_NODELAY, to force the data to be written quickly.
Expand Down

0 comments on commit f440863

Please sign in to comment.