diff options
author | B. Stack <bgstack15@gmail.com> | 2022-09-07 14:49:22 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-09-07 14:49:22 -0400 |
commit | 47c88c433d17948fab1d8e1d76121a72fe5938cb (patch) | |
tree | fbc1dea58a6b28f1af4a9e9b2bc8e3e1d23b2103 /zen/socket.h | |
parent | Merge branch 'b11.23' into 'master' (diff) | |
download | FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.tar.gz FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.tar.bz2 FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.zip |
add upstream 11.24
Diffstat (limited to 'zen/socket.h')
-rw-r--r-- | zen/socket.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/zen/socket.h b/zen/socket.h index 5ece29f8..d9517bd8 100644 --- a/zen/socket.h +++ b/zen/socket.h @@ -33,11 +33,13 @@ class Socket //throw SysError public: Socket(const Zstring& server, const Zstring& serviceName) //throw SysError { - ::addrinfo hints = {}; - hints.ai_socktype = SOCK_STREAM; //we *do* care about this one! - hints.ai_flags = AI_ADDRCONFIG; //save a AAAA lookup on machines that can't use the returned data anyhow + const addrinfo hints + { + .ai_flags = AI_ADDRCONFIG, //save a AAAA lookup on machines that can't use the returned data anyhow + .ai_socktype = SOCK_STREAM, //we *do* care about this one! + }; - ::addrinfo* servinfo = nullptr; + addrinfo* servinfo = nullptr; ZEN_ON_SCOPE_EXIT(if (servinfo) ::freeaddrinfo(servinfo)); const int rcGai = ::getaddrinfo(server.c_str(), serviceName.c_str(), &hints, &servinfo); |