[AWS] (solved) AWS.Server.Push : CONSTRAINT_ERROR, Too big message

David SAUVAGE - AdaLabs Ltd david.sauvage at adalabs.com
Sun Dec 11 18:36:30 CET 2011


> Date: Fri, 09 Dec 2011 17:26:07 +0400
> From: David SAUVAGE - AdaLabs Ltd <david.sauvage at adalabs.com>
> Subject: [AWS] AWS.Server.Push  : CONSTRAINT_ERROR, Too big message
> Hello,
> 
> I use the AWS.Server.Push generic to push multi-part JPEG images
> (converting from AWS.Response.Data to Ada.Streams.Stream_Element_Array).
> 
> It works like a charm, well done for that.
> 
> On a test, I use 5 images, that I push in an loop to a unique client,
> after each Send I use Wait_Send_Completion (180.0) and the time-out is
> not reached.
> 
>   1.jpeg 196 KByte
>   2.jpeg 168 KByte
>   3.jpeg 264 KByte *
>   4.jpeg 164 KByte
>   5.jpeg 280 KByte *
> 
> When images 3 & 5 are present I got the "Too big message"
> Constraint_Error the first time the server push those images.
> Server push broken, Exception name: CONSTRAINT_ERROR
> Message: Too big message
> 
> Note : Those images are sent successfully when passed to the Init_Data
> of the register procedure.
> 
> I am looking for tips to solve this issue, 
> 

While investigating in aws-server-push.adb [1] there are two different
hard coded values that define the size of two Stream_Element_Array,
8_192 (aws-server-push.adb:1812) and 8_196 (aws-server-push.adb:1235),

It seems that an unique constant of value 8_192 corresponding to 8
KBytes could be used instead.

I set those two buffers length to 500 KBytes (using the same constant)
and it solved my issue.

If increasing this buffer is the good way to solve this issue, I would
suggest this constant to be a generic parameter, without any default
value so that the user will be aware of this limitation. 

Cheers

[1] Version AWS GPL 2011


-- 

David SAUVAGE

Software Agile Architect, Director
AdaLabs Ltd - Mauritius
http://adalabs.com
+230 428 18 32
skype sauvaged
BRN C10097052
VAT 27035043



More information about the AWS mailing list