{
cache_info->distribute_cache_info=AcquireDistributeCacheInfo(exception);
if (cache_info->distribute_cache_info != (DistributeCacheInfo *) NULL)
- return(MagickTrue);
+ {
+ cache_info->type=DistributedCache;
+ return(MagickTrue);
+ }
(void) ThrowMagickException(exception,GetMagickModule(),CacheError,
"CacheResourcesExhausted","`%s'",image->filename);
return(MagickFalse);
#include "MagickCore/exception-private.h"
#include "MagickCore/memory_.h"
#include "MagickCore/registry.h"
-#if defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_HAVE_PTHREAD)
+#if defined(MAGICKCORE_HAVE_SOCKET)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
ExceptionInfo *exception)
{
#if defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_HAVE_PTHREAD)
+ char
+ *host,
+ **hosts;
+
const char
- *hosts;
+ *value;
DistributeCacheInfo
*distribute_cache_info;
(void) ResetMagickMemory(distribute_cache_info,0,
sizeof(*distribute_cache_info));
distribute_cache_info->signature=MagickSignature;
- hosts=GetImageRegistry(StringRegistryType,"cache:hosts",exception);
- (void) hosts;
+ value=GetImageRegistry(StringRegistryType,"cache:hosts",exception);
+ if (value == (const char *) NULL)
+ value=(const char *) "127.0.0.1";
+ host=AcquireString(value);
+ if (host == (char *) NULL)
+ ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
+ SubstituteString(&host,",","\n");
+ hosts=StringToList(host);
+ if (hosts == (char **) NULL)
+ ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
+ hosts=DestroyStringList(hosts);
return(distribute_cache_info);
#else
return((DistributeCacheInfo *) NULL);
{
assert(distribute_cache_info != (DistributeCacheInfo *) NULL);
assert(distribute_cache_info->signature == MagickSignature);
-#if defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_HAVE_PTHREAD)
+#if defined(MAGICKCORE_HAVE_SOCKET)
#endif
distribute_cache_info->signature=(~MagickSignature);
distribute_cache_info=(DistributeCacheInfo *)