Update to 1.10.0-beta1

This commit is contained in:
dP
2019-10-31 22:24:28 +03:00
parent b84a475e14
commit 599ccf0c2b
1470 changed files with 354219 additions and 16795 deletions
+4 -16
View File
@@ -17,11 +17,9 @@
#include "../../string_func.h"
#include "../../core/smallmap_type.hpp"
#ifdef ENABLE_NETWORK
class NetworkAddress;
typedef SmallVector<NetworkAddress, 4> NetworkAddressList; ///< Type for a list of addresses.
typedef SmallMap<NetworkAddress, SOCKET, 4> SocketList; ///< Type for a mapping between address and socket.
typedef std::vector<NetworkAddress> NetworkAddressList; ///< Type for a list of addresses.
typedef SmallMap<NetworkAddress, SOCKET> SocketList; ///< Type for a mapping between address and socket.
/**
* Wrapper for (un)resolved network addresses; there's no reason to transform
@@ -86,22 +84,13 @@ public:
if (*hostname == '[') hostname++;
strecpy(this->hostname, StrEmpty(hostname) ? "" : hostname, lastof(this->hostname));
char *tmp = strrchr(this->hostname, ']');
if (tmp != NULL) *tmp = '\0';
if (tmp != nullptr) *tmp = '\0';
memset(&this->address, 0, sizeof(this->address));
this->address.ss_family = family;
this->SetPort(port);
}
/**
* Make a clone of another address
* @param address the address to clone
*/
NetworkAddress(const NetworkAddress &address)
{
memcpy(this, &address, sizeof(*this));
}
const char *GetHostname();
void GetAddressAsString(char *buffer, const char *last, bool with_family = true);
const char *GetAddressAsString(bool with_family = true);
@@ -131,7 +120,7 @@ public:
}
bool IsFamily(int family);
bool IsInNetmask(char *netmask);
bool IsInNetmask(const char *netmask);
/**
* Compare the address of this class with the address of another.
@@ -192,5 +181,4 @@ public:
static const char *AddressFamilyAsString(int family);
};
#endif /* ENABLE_NETWORK */
#endif /* NETWORK_CORE_ADDRESS_H */