"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/remote/SockAddr.h" between
Firebird-3.0.2.32703-0.tar.bz2 and Firebird-3.0.4.33054-0.tar.bz2

About: Firebird is a relational database offering many ANSI SQL standard features.

SockAddr.h  (Firebird-3.0.2.32703-0.tar.bz2):SockAddr.h  (Firebird-3.0.4.33054-0.tar.bz2)
skipping to change at line 88 skipping to change at line 88
unsigned short family() const; unsigned short family() const;
unsigned short port() const; unsigned short port() const;
void setPort(unsigned short x); void setPort(unsigned short x);
int connect(SOCKET s) const; int connect(SOCKET s) const;
int accept(SOCKET s); int accept(SOCKET s);
int getsockname(SOCKET s); int getsockname(SOCKET s);
int getpeername(SOCKET s); int getpeername(SOCKET s);
void unmapV4(); void unmapV4();
}; };
// Definitions below taken from sources at correspondent operating systems. // Definitions below taken from sources (socket.h) on the correspondent operatin g systems.
// If something else arrives, it should be added here and into checkAndFixFamily () also. // If something else arrives, it should be added here and into checkAndFixFamily () also.
#define AF_INET6_POSIX 10 #define AF_INET6_POSIX 10
#define AF_INET6_WINDOWS 23 #define AF_INET6_WINDOWS 23
#define AF_INET6_DARWIN 30
inline void SockAddr::checkAndFixFamily()
{
#if AF_INET6 == AF_INET6_POSIX #if AF_INET6 == AF_INET6_POSIX
if (data.sock.sa_family == AF_INET6_WINDOWS)
#elif AF_INET6 == AF_INET6_WINDOWS #elif AF_INET6 == AF_INET6_WINDOWS
if (data.sock.sa_family == AF_INET6_POSIX) #elif AF_INET6 == AF_INET6_DARWIN
#else #else
#error Unknown value of AF_INET6 ! #error Unknown value of AF_INET6 !
#endif #endif
inline void SockAddr::checkAndFixFamily()
{
switch (data.sock.sa_family)
{ {
case AF_INET:
fb_assert(len == sizeof(sockaddr_in));
break;
case AF_INET6_POSIX:
case AF_INET6_WINDOWS:
case AF_INET6_DARWIN:
data.sock.sa_family = AF_INET6; data.sock.sa_family = AF_INET6;
fb_assert(len == sizeof(sockaddr_in6)); fb_assert(len == sizeof(sockaddr_in6));
break;
default:
fb_assert(false);
break;
} }
} }
inline void SockAddr::clear() inline void SockAddr::clear()
{ {
len = 0; len = 0;
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
} }
inline const SockAddr& SockAddr::operator = (const SockAddr& x) inline const SockAddr& SockAddr::operator = (const SockAddr& x)
 End of changes. 8 change blocks. 
5 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)