From: cristy Date: Thu, 10 Jan 2013 01:55:05 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~4450 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7edca2b74c53ad795883de1b94bbc24e93e84b69;p=imagemagick --- diff --git a/MagickCore/cache.c b/MagickCore/cache.c index 8eb5699a0..d8a27b7d5 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -3841,7 +3841,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, status=AcquireMagickResource(DiskResource,cache_info->length); if (status == MagickFalse) { - cache_info->distribute_cache_info=AcquireDistributeCacheInfo(); + cache_info->distribute_cache_info=AcquireDistributeCacheInfo(exception); if (cache_info->distribute_cache_info != (DistributeCacheInfo *) NULL) return(MagickTrue); (void) ThrowMagickException(exception,GetMagickModule(),CacheError, diff --git a/MagickCore/distribute-cache-private.h b/MagickCore/distribute-cache-private.h index 259c8d781..232819e69 100644 --- a/MagickCore/distribute-cache-private.h +++ b/MagickCore/distribute-cache-private.h @@ -22,6 +22,8 @@ extern "C" { #endif +#include "MagickCore/exception.h" + #define MaxNumberDistributedCacheClients 32 typedef struct _DistributeCacheInfo @@ -40,7 +42,7 @@ typedef struct _DistributeCacheInfo } DistributeCacheInfo; extern MagickPrivate DistributeCacheInfo - *AcquireDistributeCacheInfo(void), + *AcquireDistributeCacheInfo(ExceptionInfo *), *DestroyDistributeCacheInfo(DistributeCacheInfo *); #endif diff --git a/MagickCore/distribute-cache.c b/MagickCore/distribute-cache.c index 124929f72..e25fcf2de 100644 --- a/MagickCore/distribute-cache.c +++ b/MagickCore/distribute-cache.c @@ -57,6 +57,7 @@ #include "MagickCore/exception.h" #include "MagickCore/exception-private.h" #include "MagickCore/memory_.h" +#include "MagickCore/registry.h" #if defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_HAVE_PTHREAD) #include #include @@ -78,16 +79,24 @@ % % The format of the AcquireDistributeCacheInfo method is: % -% DistributeCacheInfo *AcquireDistributeCacheInfo(void) +% DistributeCacheInfo *AcquireDistributeCacheInfo(ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o exception: return any errors or warnings in this structure. % */ -MagickPrivate DistributeCacheInfo *AcquireDistributeCacheInfo(void) +MagickPrivate DistributeCacheInfo *AcquireDistributeCacheInfo( + ExceptionInfo *exception) { +#if defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_HAVE_PTHREAD) + const char + *hosts; + DistributeCacheInfo *distribute_cache_info; distribute_cache_info=(DistributeCacheInfo *) NULL; -#if defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_HAVE_PTHREAD) distribute_cache_info=(DistributeCacheInfo *) AcquireMagickMemory( sizeof(*distribute_cache_info)); if (distribute_cache_info == (DistributeCacheInfo *) NULL) @@ -95,8 +104,12 @@ MagickPrivate DistributeCacheInfo *AcquireDistributeCacheInfo(void) (void) ResetMagickMemory(distribute_cache_info,0, sizeof(*distribute_cache_info)); distribute_cache_info->signature=MagickSignature; -#endif + hosts=GetImageRegistry(StringRegistryType,"cache:hosts",exception); + (void) hosts; return(distribute_cache_info); +#else + return((DistributeCacheInfo *) NULL); +#endif } /*