Menu

#116 Flags are not properly set after a successful connection

0.5.x
open
nobody
None
1
2019-06-25
2019-06-20
Anonymous
No

After successfully connecting to the ICAP server, the code sets connection->flags to CI_CONNECTION_CONNECTED. The code uses &= instead of |=, however, so the flags do not get set successfully. This is for both the TLS and non-TLS code.

Here is a patch that fixes this issue:

index 1d03124..c8e9934 100644
--- a/net_io.c
+++ b/net_io.c
@@ -289,7 +289,7 @@ int ci_connect_to_nonblock(ci_connection_t connection, const char servername,
ci_strerror(errno, errBuf, sizeof(errBuf)));
return -1;
}

  • connection->flags &= CI_CONNECTION_CONNECTED;
  • connection->flags |= CI_CONNECTION_CONNECTED;
    }

    return 1;
    index f888dd5..5dac859 100644
    --- a/openssl/net_io_ssl.c
    +++ b/openssl/net_io_ssl.c
    @@ -811,7 +811,7 @@ int ci_tls_connect_nonblock(ci_connection_t connection, const char servername,
    ci_strerror(errno, buf, sizeof(buf)));
    return -1;
    }

  • connection->flags &= CI_CONNECTION_CONNECTED;

  • connection->flags |= CI_CONNECTION_CONNECTED;

    return 1;
    }

Discussion

  • Anonymous

    Anonymous - 2019-06-20

    The milestone should be set to 0.5.x, not modules-0.5x.

     
  • chtsanti

    chtsanti - 2019-06-21
    • Group: modules-0.5.x --> 0.5.x
     
  • chtsanti

    chtsanti - 2019-06-25

    Fixed in master branch with git commit 77ab787

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB