mirror of https://gitee.com/bigwinds/arangodb
Don't ask
This commit is contained in:
parent
6bdf3ae565
commit
928ee5525a
|
@ -165,28 +165,21 @@ Endpoint* Endpoint::factory (const Endpoint::Type type,
|
||||||
|
|
||||||
Encryption encryption = ENCRYPTION_NONE;
|
Encryption encryption = ENCRYPTION_NONE;
|
||||||
string domainType = StringUtils::tolower(copy.substr(0, 7));
|
string domainType = StringUtils::tolower(copy.substr(0, 7));
|
||||||
|
if (StringUtils::isPrefix(domainType, "ssl://")) {
|
||||||
|
|
||||||
if (StringUtils::isPrefix(domainType, "unix://")) {
|
|
||||||
// unix socket
|
|
||||||
#ifdef TRI_HAVE_LINUX_SOCKETS
|
|
||||||
return new EndpointUnix(type, protocol, specification, copy.substr(strlen("unix://")));
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (StringUtils::isPrefix(domainType, "ssl://")) {
|
|
||||||
// ssl
|
// ssl
|
||||||
encryption = ENCRYPTION_SSL;
|
encryption = ENCRYPTION_SSL;
|
||||||
}
|
}
|
||||||
|
#if TRI_HAVE_LINUX_SOCKETS
|
||||||
|
else if (StringUtils::isPrefix(domainType, "unix://")) {
|
||||||
|
// unix socket
|
||||||
|
return new EndpointUnix(type, protocol, specification, listenBacklog, copy.substr(strlen("unix://")));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if (! StringUtils::isPrefix(domainType, "tcp://")) {
|
else if (! StringUtils::isPrefix(domainType, "tcp://")) {
|
||||||
// invalid type
|
// invalid type
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// tcp/ip or ssl
|
// tcp/ip or ssl
|
||||||
copy = copy.substr(strlen("tcp://"), copy.length());
|
copy = copy.substr(strlen("tcp://"), copy.length());
|
||||||
|
|
||||||
|
@ -250,8 +243,8 @@ void Endpoint::setTimeout (socket_t s, double timeout) {
|
||||||
tv.tv_sec = (uint64_t) timeout;
|
tv.tv_sec = (uint64_t) timeout;
|
||||||
tv.tv_usec = ((uint64_t) (timeout * 1000000.0)) % 1000000;
|
tv.tv_usec = ((uint64_t) (timeout * 1000000.0)) % 1000000;
|
||||||
|
|
||||||
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (const char*)(&tv), sizeof(tv));
|
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||||
setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (const char*)(&tv), sizeof(tv));
|
setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -722,14 +715,9 @@ bool EndpointIp::initIncoming (socket_t incoming) {
|
||||||
EndpointIpV4::EndpointIpV4 (const Endpoint::Type type,
|
EndpointIpV4::EndpointIpV4 (const Endpoint::Type type,
|
||||||
const Endpoint::Protocol protocol,
|
const Endpoint::Protocol protocol,
|
||||||
const Endpoint::Encryption encryption,
|
const Endpoint::Encryption encryption,
|
||||||
<<<<<<< HEAD
|
|
||||||
const std::string& specification,
|
|
||||||
const std::string& host,
|
|
||||||
=======
|
|
||||||
string const& specification,
|
string const& specification,
|
||||||
int listenBacklog,
|
int listenBacklog,
|
||||||
string const& host,
|
string const& host,
|
||||||
>>>>>>> a487f9478eb5e948fbdaae9d0c348f386baa2e34
|
|
||||||
const uint16_t port) :
|
const uint16_t port) :
|
||||||
EndpointIp(type, ENDPOINT_IPV4, protocol, encryption, specification, listenBacklog, host, port) {
|
EndpointIp(type, ENDPOINT_IPV4, protocol, encryption, specification, listenBacklog, host, port) {
|
||||||
}
|
}
|
||||||
|
@ -765,14 +753,9 @@ EndpointIpV4::~EndpointIpV4 () {
|
||||||
EndpointIpV6::EndpointIpV6 (const Endpoint::Type type,
|
EndpointIpV6::EndpointIpV6 (const Endpoint::Type type,
|
||||||
const Endpoint::Protocol protocol,
|
const Endpoint::Protocol protocol,
|
||||||
const Endpoint::Encryption encryption,
|
const Endpoint::Encryption encryption,
|
||||||
<<<<<<< HEAD
|
|
||||||
const std::string& specification,
|
|
||||||
const std::string& host,
|
|
||||||
=======
|
|
||||||
string const& specification,
|
string const& specification,
|
||||||
int listenBacklog,
|
int listenBacklog,
|
||||||
string const& host,
|
string const& host,
|
||||||
>>>>>>> a487f9478eb5e948fbdaae9d0c348f386baa2e34
|
|
||||||
const uint16_t port) :
|
const uint16_t port) :
|
||||||
EndpointIp(type, ENDPOINT_IPV6, protocol, encryption, specification, listenBacklog, host, port) {
|
EndpointIp(type, ENDPOINT_IPV6, protocol, encryption, specification, listenBacklog, host, port) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <Basics/StringUtils.h>
|
#include <Basics/StringUtils.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef TRI_HAVE_LINUX_SOCKETS
|
#ifdef TRI_HAVE_LINUX_SOCKETS
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -44,8 +45,6 @@
|
||||||
|
|
||||||
|
|
||||||
#ifdef TRI_HAVE_WINSOCK2_H
|
#ifdef TRI_HAVE_WINSOCK2_H
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue