Skip to content

Conversation

@joeyhub
Copy link
Contributor

@joeyhub joeyhub commented Aug 2, 2019

This doesn't solve the problem of somehow you allow it to initiate with no contact points rather than noop or graceful error (with php-driver try to connect with host as empty string).

@joeyhub
Copy link
Contributor Author

joeyhub commented Aug 2, 2019

  const uint64_t limit = CASS_UINT64_MAX - CASS_UINT64_MAX % max;
  uint64_t r;
  do {
    r = rng_();
  } while (r >= limit);
  return r % max;

Return 0 might be wrong. Instead...

  const uint64_t limit = max ? CASS_UINT64_MAX - CASS_UINT64_MAX % max : CASS_UINT64_MAX;
  return max ? r % max : r;

@mpenick mpenick merged commit 50acc6a into apache:master Aug 19, 2019
@mpenick
Copy link
Contributor

mpenick commented Aug 20, 2019

Created a story to fix the error handling around no contact points: https://datastax-oss.atlassian.net/browse/CPP-806

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

Successfully merging this pull request may close these issues.

2 participants