[AWS] agent demo broken in AWS-1.4 (worked in 1.3)

Pascal Obry p.obry@wanadoo.fr
Thu, 25 Mar 2004 18:47:02 +0100


Adrien,

 > I'm not sure i do it correctly then.
 > To get a distant file in my server i do :
 > 
 > declare
 > 	Data : Response.Data;
 > 	F : Ada.Streams.Stream_IO.File_Type;
 > begin
 > 	Data := AWS.Client.Get (URL => URL);
 > 	Ada.Streams.Stream_IO.Create (F, 
 > 	                                  Ada.Streams.Stream_IO.Out_File, 
 > 	                                  Filename);
 > 	Ada.Streams.Stream_IO.Write (F, AWS.Response.Message_Body (Data));
 > 	Ada.Streams.Stream_IO.Close (F);
 > end;

Here you are using the same algo than demos/agent, so this definitly won't
work for big responses. Use Unbounded_String instead. This is a workaround, in
2.0 there is a Message_Body stream oriented routine which is a cleaner way to
handle large responses. demos/agent is now using this new routine.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595