11-- ----------------------------------------------------------------------------
22-- Ada Web Server --
33-- --
4- -- Copyright (C) 2012-2016 , AdaCore --
4+ -- Copyright (C) 2012-2021 , AdaCore --
55-- --
66-- This library is free software; you can redistribute it and/or modify --
77-- it under terms of the GNU General Public License as published by the --
@@ -49,7 +49,8 @@ package body AWS.Net.WebSocket is
4949 end record ;
5050
5151 procedure Unchecked_Free is new Ada.Unchecked_Deallocation
52- (AWS.Client.HTTP_Connection, AWS.Client.HTTP_Connection_Access);
52+ (AWS.Client.HTTP_Connection, AWS.Client.HTTP_Connection_Access);
53+
5354 procedure Unchecked_Free is new Unchecked_Deallocation
5455 (Net.WebSocket.Protocol.State'Class,
5556 Net.WebSocket.Protocol.State_Class);
@@ -87,12 +88,12 @@ package body AWS.Net.WebSocket is
8788 (Socket : in out Object'Class;
8889 URI : String)
8990 is
91+ URL : constant AWS.URL.Object := AWS.URL.Parse (URI);
9092 Headers : AWS.Headers.List := AWS.Headers.Empty_List;
9193 Resp : AWS.Response.Data;
92- Protocol : AWS.Net.WebSocket.Protocol.State_Class;
93- URL : constant AWS.URL.Object := AWS.URL.Parse (URI);
94+ Protocol : Net.WebSocket.Protocol.State_Class;
9495 begin
95- -- Initially, the connection is initiated with standard http GET.
96+ -- Initially, the connection is initiated with standard http GET
9697
9798 Socket.Connection := new AWS.Client.HTTP_Connection;
9899 Protocol := new Net.WebSocket.Protocol.RFC6455.State;
@@ -402,7 +403,7 @@ package body AWS.Net.WebSocket is
402403 function Poll
403404 (Socket : in out Object'Class;
404405 Timeout : Duration)
405- return Boolean
406+ return Boolean
406407 is
407408 procedure Do_Receive
408409 (Socket : not null access Object'Class;
@@ -423,11 +424,11 @@ package body AWS.Net.WebSocket is
423424 end Do_Receive ;
424425
425426 function Read_Message is new AWS.Net.WebSocket.Read_Message
426- (Receive => Do_Receive);
427+ (Receive => Do_Receive);
427428
428429 Obj : Object_Class := Socket'Unrestricted_Access;
429430 Event : AWS.Net.Event_Set;
430- Msg : Ada.Strings.Unbounded. Unbounded_String;
431+ Msg : Unbounded_String;
431432 begin
432433 Event := Socket.Poll
433434 ((AWS.Net.Input => True, others => False), Timeout => Timeout);
@@ -465,8 +466,8 @@ package body AWS.Net.WebSocket is
465466 -- ----------------
466467
467468 function Read_Message
468- (WebSocket : in out Object_Class;
469- Message : in out Ada.Strings.Unbounded. Unbounded_String)
469+ (WebSocket : in out Object_Class;
470+ Message : in out Unbounded_String)
470471 return Boolean
471472 is
472473 Data : Stream_Element_Array (1 .. 4_096 );
0 commit comments