Skip to content

Commit

Permalink
Merge pull request #286 from Wolf3s/Cleanups
Browse files Browse the repository at this point in the history
Cleanup LingerStruct
  • Loading branch information
sahlberg authored Nov 20, 2023
2 parents fc4f76f + 68fe734 commit 3f4fa56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@
* timeout of 100ms. */
#define HAPPY_EYEBALLS_TIMEOUT 100

struct LingerStruct
{
int l_onoff; /* Linger active */
int l_linger; /* How long to linger for */
};

static int
smb2_connect_async_next_addr(struct smb2_context *smb2, const struct addrinfo *base);

Expand Down Expand Up @@ -864,8 +870,7 @@ connect_async_ai(struct smb2_context *smb2, const struct addrinfo *ai, int *fd_o
struct sockaddr_storage ss;
#if 0 == CONFIGURE_OPTION_TCP_LINGER
int const yes = 1;
struct LingerStruct { int l_onoff; /* linger active */ int l_linger; /* how many seconds to linger for */ };
struct LingerStruct const lin = { .l_onoff = 1, .l_linger = 0 }; /* if l_linger is zero, sends RST after FIN */
struct LingerStruct const lin = { 1, 0 }; /* if l_linger is zero, sends RST after FIN */
#endif
memset(&ss, 0, sizeof(ss));
switch (ai->ai_family) {
Expand Down

0 comments on commit 3f4fa56

Please sign in to comment.