#include "MagickCore/splay-tree.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
+#include "MagickCore/version.h"
#if defined(MAGICKCORE_HAVE_SOCKET)
#include <netinet/in.h>
#include <netdb.h>
if (count != -1)
{
MagickSizeType
- hdri,
- quantum_depth;
+ signature;
(void) memcpy(p,secret,(size_t) count);
p+=count;
- quantum_depth=MAGICKCORE_QUANTUM_DEPTH;
- (void) memcpy(p,&quantum_depth,sizeof(quantum_depth));
- p+=sizeof(quantum_depth);
- hdri=MAGICKCORE_HDRI_ENABLE;
- (void) memcpy(p,&hdri,sizeof(hdri));
- p+=sizeof(hdri);
+ signature=MagickLibVersion;
+ (void) memcpy(p,&signature,sizeof(signature));
+ p+=sizeof(signature);
+ signature=MAGICKCORE_QUANTUM_DEPTH;
+ (void) memcpy(p,&signature,sizeof(signature));
+ p+=sizeof(signature);
+ signature=MAGICKCORE_HDRI_ENABLE;
+ (void) memcpy(p,&signature,sizeof(signature));
+ p+=sizeof(signature);
*session_key=CRC64(session,p-session);
}
if (*session_key == 0)
count;
MagickSizeType
- hdri,
- quantum_depth,
key,
- session_key;
+ session_key,
+ signature;
register unsigned char
*p;
secret=GetRandomKey(random_info,DPCSessionKeyLength);
(void) memcpy(p,GetStringInfoDatum(secret),DPCSessionKeyLength);
p+=DPCSessionKeyLength;
- quantum_depth=MAGICKCORE_QUANTUM_DEPTH;
- (void) memcpy(p,&quantum_depth,sizeof(quantum_depth));
- p+=sizeof(quantum_depth);
- hdri=MAGICKCORE_HDRI_ENABLE;
- (void) memcpy(p,&hdri,sizeof(hdri));
- p+=sizeof(hdri);
+ signature=MagickLibVersion;
+ (void) memcpy(p,&signature,sizeof(signature));
+ p+=sizeof(signature);
+ signature=MAGICKCORE_QUANTUM_DEPTH;
+ (void) memcpy(p,&signature,sizeof(signature));
+ p+=sizeof(signature);
+ signature=MAGICKCORE_HDRI_ENABLE;
+ (void) memcpy(p,&signature,sizeof(signature));
+ p+=sizeof(signature);
session_key=CRC64(session,p-session);
random_info=DestroyRandomInfo(random_info);
exception=AcquireExceptionInfo();
{
status=OpenDistributeCache(registry,client_socket,session_key,
exception);
+ count=dpc_send(client_socket,sizeof(status),(unsigned char *) &status);
break;
}
case 'r':
if (command == 'd')
break;
}
+ count=dpc_send(client_socket,sizeof(status),(unsigned char *) &status);
(void) close(client_socket);
exception=DestroyExceptionInfo(exception);
registry=DestroySplayTree(registry);
MagickPrivate MagickBooleanType OpenDistributePixelCache(
DistributeCacheInfo *server_info,Image *image)
{
+ MagickBooleanType
+ status;
+
MagickOffsetType
count;
count=dpc_send(server_info->file,p-message,message);
if (count != (MagickOffsetType) (p-message))
return(MagickFalse);
- return(MagickTrue);
+ status=MagickFalse;
+ count=dpc_read(server_info->file,sizeof(status),(unsigned char *) &status);
+ if (count != (MagickOffsetType) sizeof(status))
+ return(MagickFalse);
+ return(status);
}
\f
/*
assert(server_info->signature == MagickSignature);
assert(region != (RectangleInfo *) NULL);
assert(metacontent != (unsigned char *) NULL);
- if (length != (size_t) length)
+ if (length > SSIZE_MAX)
return(-1);
p=message;
*p++='R';
assert(server_info->signature == MagickSignature);
assert(region != (RectangleInfo *) NULL);
assert(pixels != (unsigned char *) NULL);
- if (length != (size_t) length)
+ if (length > SSIZE_MAX)
return(-1);
p=message;
*p++='r';
assert(server_info->signature == MagickSignature);
assert(region != (RectangleInfo *) NULL);
assert(metacontent != (unsigned char *) NULL);
- if (length != (size_t) length)
+ if (length > SSIZE_MAX)
return(-1);
p=message;
*p++='W';
assert(server_info->signature == MagickSignature);
assert(region != (RectangleInfo *) NULL);
assert(pixels != (const unsigned char *) NULL);
- if (length != (size_t) length)
+ if (length > SSIZE_MAX)
return(-1);
p=message;
*p++='w';
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
sizeof(*kernel_info->values)));
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
sizeof(*kernel_info->values)));
(void) ResetMagickMemory(kernel_info,0,sizeof(*kernel_info));
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->signature=MagickSignature;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
(void) ResetMagickMemory(kernel_info,0,sizeof(*kernel_info));
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->signature=MagickSignature;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*