Merge branch 'next' into aeonwave
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
#include <memory> // for std::auto_ptr
|
#include <memory> // for std::auto_ptr
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <ctime> // for time_t
|
||||||
|
|
||||||
#include <simgear/structure/SGReferenced.hxx>
|
#include <simgear/structure/SGReferenced.hxx>
|
||||||
#include <simgear/structure/SGSharedPtr.hxx>
|
#include <simgear/structure/SGSharedPtr.hxx>
|
||||||
|
|
||||||
|
|||||||
@@ -82,13 +82,11 @@ public:
|
|||||||
curl_multi_setopt(curlMulti, CURLMOPT_PIPELINING, 1 /* aka CURLPIPE_HTTP1 */);
|
curl_multi_setopt(curlMulti, CURLMOPT_PIPELINING, 1 /* aka CURLPIPE_HTTP1 */);
|
||||||
#if (LIBCURL_VERSION_MINOR >= 30)
|
#if (LIBCURL_VERSION_MINOR >= 30)
|
||||||
curl_multi_setopt(curlMulti, CURLMOPT_MAX_TOTAL_CONNECTIONS, (long) maxConnections);
|
curl_multi_setopt(curlMulti, CURLMOPT_MAX_TOTAL_CONNECTIONS, (long) maxConnections);
|
||||||
#endif
|
|
||||||
curl_multi_setopt(curlMulti, CURLMOPT_MAX_PIPELINE_LENGTH,
|
curl_multi_setopt(curlMulti, CURLMOPT_MAX_PIPELINE_LENGTH,
|
||||||
(long) maxPipelineDepth);
|
(long) maxPipelineDepth);
|
||||||
curl_multi_setopt(curlMulti, CURLMOPT_MAX_HOST_CONNECTIONS,
|
curl_multi_setopt(curlMulti, CURLMOPT_MAX_HOST_CONNECTIONS,
|
||||||
(long) maxHostConnections);
|
(long) maxHostConnections);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef std::map<Request_ptr, CURL*> RequestCurlMap;
|
typedef std::map<Request_ptr, CURL*> RequestCurlMap;
|
||||||
@@ -148,13 +146,17 @@ void Client::setMaxConnections(unsigned int maxCon)
|
|||||||
void Client::setMaxHostConnections(unsigned int maxHostCon)
|
void Client::setMaxHostConnections(unsigned int maxHostCon)
|
||||||
{
|
{
|
||||||
d->maxHostConnections = maxHostCon;
|
d->maxHostConnections = maxHostCon;
|
||||||
|
#if (LIBCURL_VERSION_MINOR >= 30)
|
||||||
curl_multi_setopt(d->curlMulti, CURLMOPT_MAX_HOST_CONNECTIONS, (long) maxHostCon);
|
curl_multi_setopt(d->curlMulti, CURLMOPT_MAX_HOST_CONNECTIONS, (long) maxHostCon);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::setMaxPipelineDepth(unsigned int depth)
|
void Client::setMaxPipelineDepth(unsigned int depth)
|
||||||
{
|
{
|
||||||
d->maxPipelineDepth = depth;
|
d->maxPipelineDepth = depth;
|
||||||
|
#if (LIBCURL_VERSION_MINOR >= 30)
|
||||||
curl_multi_setopt(d->curlMulti, CURLMOPT_MAX_PIPELINE_LENGTH, (long) depth);
|
curl_multi_setopt(d->curlMulti, CURLMOPT_MAX_PIPELINE_LENGTH, (long) depth);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::update(int waitTimeout)
|
void Client::update(int waitTimeout)
|
||||||
|
|||||||
+8
-9
@@ -6,25 +6,24 @@
|
|||||||
//#include <stdint.h>
|
//#include <stdint.h>
|
||||||
//#include <string.h>
|
//#include <string.h>
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__) || defined(__APPLE__)
|
||||||
|
# include <machine/endian.h>
|
||||||
|
#elif !defined(_WIN32)
|
||||||
|
# include <endian.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __BIG_ENDIAN__
|
#ifdef __BIG_ENDIAN__
|
||||||
# define SHA_BIG_ENDIAN
|
# define SHA_BIG_ENDIAN
|
||||||
#elif defined __LITTLE_ENDIAN__
|
|
||||||
/* override */
|
|
||||||
#elif defined __BYTE_ORDER
|
#elif defined __BYTE_ORDER
|
||||||
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||||
# define SHA_BIG_ENDIAN
|
# define SHA_BIG_ENDIAN
|
||||||
# endif
|
# endif
|
||||||
#elif defined _WIN32
|
#elif defined BYTE_ORDER
|
||||||
/* assume little-endian, there is no endian.h on MSVC */
|
# if BYTE_ORDER == BIG_ENDIAN
|
||||||
#else // ! defined __LITTLE_ENDIAN__
|
# define SHA_BIG_ENDIAN
|
||||||
# include <endian.h> // machine/endian.h
|
|
||||||
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
|
||||||
# define SHA_BIG_ENDIAN
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* code */
|
/* code */
|
||||||
#define SHA1_K0 0x5a827999
|
#define SHA1_K0 0x5a827999
|
||||||
#define SHA1_K20 0x6ed9eba1
|
#define SHA1_K20 0x6ed9eba1
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ std::string error_string(int errnum)
|
|||||||
retcode = strerror_s(buf, sizeof(buf), errnum);
|
retcode = strerror_s(buf, sizeof(buf), errnum);
|
||||||
#elif defined(_GNU_SOURCE)
|
#elif defined(_GNU_SOURCE)
|
||||||
return std::string(strerror_r(errnum, buf, sizeof(buf)));
|
return std::string(strerror_r(errnum, buf, sizeof(buf)));
|
||||||
#elif (_POSIX_C_SOURCE >= 200112L) || defined(SG_MAC)
|
#elif (_POSIX_C_SOURCE >= 200112L) || defined(SG_MAC) || defined(__FreeBSD__)
|
||||||
int retcode;
|
int retcode;
|
||||||
// POSIX.1-2001 and POSIX.1-2008
|
// POSIX.1-2001 and POSIX.1-2008
|
||||||
retcode = strerror_r(errnum, buf, sizeof(buf));
|
retcode = strerror_r(errnum, buf, sizeof(buf));
|
||||||
|
|||||||
Reference in New Issue
Block a user