From 16b6aea0a93b05d94146e453393c5bc435bdc2c7 Mon Sep 17 00:00:00 2001 From: shanth96 Date: Wed, 13 Sep 2023 22:49:13 +0400 Subject: [PATCH] Update src/socket.c Co-authored-by: Eileen M. Uchitelle --- src/socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/socket.c b/src/socket.c index 8a1ce9e7..01320911 100644 --- a/src/socket.c +++ b/src/socket.c @@ -197,10 +197,10 @@ static int raw_connect_internal(struct trilogy_sock *sock, const struct addrinfo #ifdef TCP_NODELAY if (sock->base.opts.tcp_nodelay_enabled) { - int flags = 1; - if (setsockopt(sock->fd, IPPROTO_TCP, TCP_NODELAY, (void *)&flags, sizeof(flags)) < 0) { - goto fail; - } + int flags = 1; + if (setsockopt(sock->fd, IPPROTO_TCP, TCP_NODELAY, (void *)&flags, sizeof(flags)) < 0) { + goto fail; + } } #endif if (sock->base.opts.keepalive_enabled) {