Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup LingerStruct #286

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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