-
Notifications
You must be signed in to change notification settings - Fork 43
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
support format "127.0.0.1:1234, 127.0.0.2:5678", trim blank, tab #55
Comments
This is a C library. I think it's OK to require a strict format without flexible spaces in the user input. OTOH, it's only one line added, so not a lot of complexity. What do other people think? (@bjosv, @andreasgerstmayr, etc.) We'd need to use the string returned by sdstrim though since it may realloc the memory, so address[i] = sdstrim(address[i], "\t "); |
I think it would be ok to trim, but at the same time this could easily be done by the user of this library. |
There is no detailed description for the api. |
suggest adding trim or detailed description for the api. @bjosv |
Thanks for the clarification @cuipingxu. This need to be fixed. |
I'd vote for adding it to the docs instead of adding |
The only place it's documented is https://github.com/Nordix/hiredis-cluster#connecting right? It's only documented by an example. If we add sdstrim, it'd be only to the functions that handle the comma-separated list IMO. Is it more than this one function? If it's only in this function, I think we can do it, but otherwise not. Whether we add sdstrim or not, we could add some syntactic validation of the addresses and ports here. That could also catch mistakes with spaces. |
int redisClusterSetOptionAddNodes(redisClusterContext *cc, const char *addrs) {
int ret;
sds *address = NULL;
int address_count = 0;
int i;
}
The text was updated successfully, but these errors were encountered: