-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACE_INET_Addr::set
errantly succeeds when ACE_LACKS_GETSERVBYNAME
Problem ------- Calling `set("1.2.3.4")` on an ACE_INET_Addr eventually tries to part it as a port name. When `ACE_LACKS_GETSERVBYNAME`, this succeeds returning port number 0 with the reset address. When port names are not expected, this breaks a useful idiom of parsing addresses that may or may not contain port numbers: ACE_INET_Addr addr; if (addr.set(x) == 0) { // Success, address contained a port number } else if (addr.set(u_short(0), x) == 0) { // Success, address did not contain a port number. } else { // Fail } Solution -------- Return -1 for the port number when `ACE_LACKS_GETSERVBYNAME`.
- Loading branch information
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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