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

socket leak on tcpconnect() timeout #181

Open
majek opened this issue Feb 17, 2018 · 0 comments
Open

socket leak on tcpconnect() timeout #181

majek opened this issue Feb 17, 2018 · 0 comments

Comments

@majek
Copy link

majek commented Feb 17, 2018

If I read this code right:

libmill/tcp.c

Line 209 in 2dd13ae

/* Connect to the remote endpoint. */

    int rc = connect(s, (struct sockaddr*)&addr, mill_iplen(addr));
    if(rc != 0) {
        mill_assert(rc == -1);
        if(errno != EINPROGRESS)
            return NULL;
        rc = fdwait(s, FDW_OUT, deadline);
        if(rc == 0) {
            errno = ETIMEDOUT;
            return NULL;
        }

On fdwait() timeout, the "s" never gets "closed()".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant