ipv6 support for modified-URL-like#1403
Conversation
| if (serverName.startsWith("[")) { | ||
| portLoc = serverName.indexOf("]:") + 1; | ||
| } else { | ||
| serverName = "[" + serverName + "]"; |
There was a problem hiding this comment.
There cannot be port in this case?
There was a problem hiding this comment.
There isn't one, but because the shortUrl contains the port number, it needs to be formatted that way
shortUrl example sqlserver://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:1433.
I'm now thinking though, whether this is not appropriate for the host attribute i.e. [2001:0db8:85a3:0000:0000:8a2e:0370:7334]. What do you think?
By the way, the mariadb test is partially incorrect because it includes the port as part of the shortUrl
EDIT
For
"jdbc:mariadb:loadbalance://[2001:0660:7401:0200:0000:0000:0edf:bdd7]:33,mdb.host/mdbdb"
shortUrl becomes
"mariadb:loadbalance://2001:0660:7401:0200:0000:0000:0edf:bdd7:33"
There was a problem hiding this comment.
You lost me :) I am not proficient with ip6 formats. I just see:
if (serverName.startsWith("[")) {
portLoc = XXX
} else {
serverName = "[" + serverName + "]";
}
and wonder, why if serverName does not start with [, then it means there is no port?
There was a problem hiding this comment.
Apologies, I went neck-deep into IPv6 land. Yes, since : is a delimiter for the IPv6 parts, the only way to define a port in a URL/URI-like manner, is to wrap the address in [-] and then append the port with a :
Does this make sense, especially with regards to my point about the MariaDB tests?
There was a problem hiding this comment.
Clarification, when I say
the only way to define a port in a URL/URI-like manner
, I should have said instead, "the only unambigious way to define a port in a URL/URI-like manner"
There was a problem hiding this comment.
I see. I have left a comment in #1421, but that is a separate issue.
Closes #1223