1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
a-brandt 2012-09-26 12:39:09 +02:00
commit e957c99b14
5 changed files with 27 additions and 24 deletions

3
lib/BasicsC/json.c Normal file → Executable file
View File

@ -1065,7 +1065,8 @@ bool TRI_EqualJsonJson (TRI_json_t* left, TRI_json_t* right) {
default: { default: {
assert(false); assert(false);
} }
} }
return false; // stops the vc++ compiler from complaining
} }

2
lib/BasicsC/strings.c Normal file → Executable file
View File

@ -1380,7 +1380,7 @@ char* TRI_UnescapeUtf8StringZ (TRI_memory_zone_t* zone, char const* in, size_t i
// we might have wasted some space if the unescaped string is shorter than the // we might have wasted some space if the unescaped string is shorter than the
// escaped one. this is the case if the string contained escaped characters // escaped one. this is the case if the string contained escaped characters
if (*outLength < (ptr - in)) { if (((ptr - in) > 0) && (*outLength < (size_t)(ptr - in))) {
// result string is shorter than original string // result string is shorter than original string
qtr = TRI_Allocate(zone, *outLength + 1, false); qtr = TRI_Allocate(zone, *outLength + 1, false);

16
lib/Rest/Endpoint.cpp Normal file → Executable file
View File

@ -27,11 +27,7 @@
#include "Endpoint.h" #include "Endpoint.h"
#include <netinet/in.h>
#include <sys/file.h>
#include "BasicsC/socket-utils.h" #include "BasicsC/socket-utils.h"
#include "Basics/StringUtils.h" #include "Basics/StringUtils.h"
#include "Basics/FileUtils.h" #include "Basics/FileUtils.h"
#include "Logger/Logger.h" #include "Logger/Logger.h"
@ -81,7 +77,7 @@ Endpoint::Endpoint (const Endpoint::Type type,
const Endpoint::DomainType domainType, const Endpoint::DomainType domainType,
const Endpoint::Protocol protocol, const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption, const Endpoint::Encryption encryption,
const string& specification) : const std::string& specification) :
_connected(false), _connected(false),
_socket(0), _socket(0),
_type(type), _type(type),
@ -115,7 +111,7 @@ Endpoint::~Endpoint () {
/// @brief create a client endpoint object from a string value /// @brief create a client endpoint object from a string value
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Endpoint* Endpoint::clientFactory (const string& specification) { Endpoint* Endpoint::clientFactory (const std::string& specification) {
return Endpoint::factory(ENDPOINT_CLIENT, specification); return Endpoint::factory(ENDPOINT_CLIENT, specification);
} }
@ -123,7 +119,7 @@ Endpoint* Endpoint::clientFactory (const string& specification) {
/// @brief create a server endpoint object from a string value /// @brief create a server endpoint object from a string value
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Endpoint* Endpoint::serverFactory (const string& specification) { Endpoint* Endpoint::serverFactory (const std::string& specification) {
return Endpoint::factory(ENDPOINT_SERVER, specification); return Endpoint::factory(ENDPOINT_SERVER, specification);
} }
@ -132,7 +128,7 @@ Endpoint* Endpoint::serverFactory (const string& specification) {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Endpoint* Endpoint::factory (const Endpoint::Type type, Endpoint* Endpoint::factory (const Endpoint::Type type,
const string& specification) { const std::string& specification) {
if (specification.size() < 7) { if (specification.size() < 7) {
return 0; return 0;
} }
@ -477,8 +473,8 @@ EndpointIp::EndpointIp (const Endpoint::Type type,
const Endpoint::DomainType domainType, const Endpoint::DomainType domainType,
const Endpoint::Protocol protocol, const Endpoint::Protocol protocol,
const Endpoint::Encryption encryption, const Endpoint::Encryption encryption,
string const& specification, const std::string& specification,
string const& host, const std::string& host,
const uint16_t port) : const uint16_t port) :
Endpoint(type, domainType, protocol, encryption, specification), _host(host), _port(port) { Endpoint(type, domainType, protocol, encryption, specification), _host(host), _port(port) {

30
lib/Rest/Endpoint.h Normal file → Executable file
View File

@ -31,16 +31,22 @@
#include <Basics/Common.h> #include <Basics/Common.h>
#include <Basics/StringUtils.h> #include <Basics/StringUtils.h>
#ifdef TRI_HAVE_LINUX_SOCKETS
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#ifdef TRI_HAVE_LINUX_SOCKETS
#include <sys/un.h> #include <sys/un.h>
#endif
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
#include <sys/file.h>
#endif
#ifdef TRI_HAVE_WINSOCK2_H
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- Endpoint // --SECTION-- Endpoint
@ -129,7 +135,7 @@ namespace triagens {
const DomainType, const DomainType,
const Protocol, const Protocol,
const Encryption, const Encryption,
const string&); const std::string&);
public: public:
@ -158,20 +164,20 @@ namespace triagens {
/// @brief creates a server endpoint from a string value /// @brief creates a server endpoint from a string value
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static Endpoint* serverFactory (const string&); static Endpoint* serverFactory (const std::string&);
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief creates a client endpoint from a string value /// @brief creates a client endpoint from a string value
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static Endpoint* clientFactory (const string&); static Endpoint* clientFactory (const std::string&);
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief creates an endpoint from a string value /// @brief creates an endpoint from a string value
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static Endpoint* factory (const Type type, static Endpoint* factory (const Type type,
const string&); const std::string&);
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief compare two endpoints /// @brief compare two endpoints
@ -259,7 +265,7 @@ namespace triagens {
/// @brief get the original endpoint specification /// @brief get the original endpoint specification
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
string getSpecification () const { std::string getSpecification () const {
return _specification; return _specification;
} }
@ -279,13 +285,13 @@ namespace triagens {
/// @brief get host name /// @brief get host name
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
virtual string getHost () const = 0; virtual std::string getHost () const = 0;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief get address /// @brief get address
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
virtual string getHostString () const = 0; virtual std::string getHostString () const = 0;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @} /// @}
@ -342,7 +348,7 @@ namespace triagens {
/// @brief original endpoint specification /// @brief original endpoint specification
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
string _specification; std::string _specification;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @} /// @}

0
lib/V8/v8-globals.h Normal file → Executable file
View File