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 --
@@ -53,7 +53,8 @@ package body AWS.Net.WebSocket is
5353 end record ;
5454
5555 procedure Unchecked_Free is new Ada.Unchecked_Deallocation
56- (AWS.Client.HTTP_Connection, AWS.Client.HTTP_Connection_Access);
56+ (AWS.Client.HTTP_Connection, AWS.Client.HTTP_Connection_Access);
57+
5758 procedure Unchecked_Free is new Unchecked_Deallocation
5859 (Net.WebSocket.Protocol.State'Class,
5960 Net.WebSocket.Protocol.State_Class);
@@ -91,12 +92,12 @@ package body AWS.Net.WebSocket is
9192 (Socket : in out Object'Class;
9293 URI : String)
9394 is
95+ URL : constant AWS.URL.Object := AWS.URL.Parse (URI);
9496 Headers : AWS.Headers.List := AWS.Headers.Empty_List;
9597 Resp : AWS.Response.Data;
96- Protocol : AWS.Net.WebSocket.Protocol.State_Class;
97- URL : constant AWS.URL.Object := AWS.URL.Parse (URI);
98+ Protocol : Net.WebSocket.Protocol.State_Class;
9899 begin
99- -- Initially, the connection is initiated with standard http GET.
100+ -- Initially, the connection is initiated with standard http GET
100101
101102 Socket.Connection := new AWS.Client.HTTP_Connection;
102103 Protocol := new Net.WebSocket.Protocol.RFC6455.State;
@@ -406,7 +407,7 @@ package body AWS.Net.WebSocket is
406407 function Poll
407408 (Socket : in out Object'Class;
408409 Timeout : Duration)
409- return Boolean
410+ return Boolean
410411 is
411412 procedure Do_Receive
412413 (Socket : Object'Class;
@@ -427,11 +428,10 @@ package body AWS.Net.WebSocket is
427428 end Do_Receive ;
428429
429430 function Read_Message is new AWS.Net.WebSocket.Read_Message
430- (Receive => Do_Receive);
431+ (Receive => Do_Receive);
431432
432433 Event : AWS.Net.Event_Set;
433- Msg : Ada.Strings.Unbounded.Unbounded_String;
434-
434+ Msg : Unbounded_String;
435435 begin
436436 Event := Socket.Poll
437437 ((AWS.Net.Input => True, others => False), Timeout => Timeout);
@@ -471,8 +471,8 @@ package body AWS.Net.WebSocket is
471471 -- ----------------
472472
473473 function Read_Message
474- (WebSocket : in out Object'Class;
475- Message : in out Ada.Strings.Unbounded. Unbounded_String)
474+ (WebSocket : in out Object'Class;
475+ Message : in out Unbounded_String)
476476 return Boolean
477477 is
478478 Data : Stream_Element_Array (1 .. 4_096 );
0 commit comments