-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix xtreme8000#96 error when starting client with aos version in url #189
base: standalone
Are you sure you want to change the base?
Conversation
|
forked-from-1kasper/tigerspades@247f2ca also has a different solution, but like I said as far as I know this is entirely pointless, distinguishing versions at this point is unnecessary and doesn't do anything |
af831d8
to
3560e5d
Compare
remove the "removesuffix" and use less straight forward but more c-like logic. functionality is the same, but it also handles cases where "ip" portion is longer than 32 (like if someone accidentally puts a domain there, which does remind me maybe that should be a feature lol)
3560e5d
to
fdb41a5
Compare
} | ||
} else { | ||
// parse port, also ignore anything past another ':' (e.g. version info) | ||
int next_colon = strchr(port_start + 1, ':'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is next_colon of type int
even though strchr returns char*
} else { | ||
// parse port, also ignore anything past another ':' (e.g. version info) | ||
int next_colon = strchr(port_start + 1, ':'); | ||
*port_out = strtoul(port_start + 1, next_colon, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next_colon should be passed as a char**
pointer, where strtoul
can write the first invalid char pos to, HOWEVER we don't actually need it here, and can pass NULL
instead, thus don't even need it in the first place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this PR even do anything different to the original code, except the additional ip length check???
The reason this happens is because network_identifier_split at some point got support for "255.255.255.255" ipv4 format, and if you have the suffix it thinks that it's parsing that. This hotfix works in either case (tested). The information about whether the server is .75 or .76 is not needed as it is already handled heuristically in network_connect and read_PacketWorldUpdate