Fix xtreme8000#96 error when starting client with aos version in url#189
Open
dany-on-demand wants to merge 3 commits into
Open
Fix xtreme8000#96 error when starting client with aos version in url#189dany-on-demand wants to merge 3 commits into
dany-on-demand wants to merge 3 commits into
Conversation
rzrn
added a commit
to rzrn/tigerspades
that referenced
this pull request
Jan 8, 2024
Owner
|
Contributor
Author
|
rzrn/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
xtreme8000
reviewed
Jan 22, 2024
| } | ||
| } else { | ||
| // parse port, also ignore anything past another ':' (e.g. version info) | ||
| int next_colon = strchr(port_start + 1, ':'); |
Owner
There was a problem hiding this comment.
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); |
Owner
There was a problem hiding this comment.
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
Owner
There was a problem hiding this comment.
does this PR even do anything different to the original code, except the additional ip length check???
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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