Blob Blame History Raw
From 4644c9071f0b272c95f99331bfbe5f6ca356fc77 Mon Sep 17 00:00:00 2001
From: Pascal Obry <obry@adacore.com>
Date: Mon, 19 Aug 2019 19:28:16 +0200
Subject: [PATCH] Fix invalid code to conform to last GNAT version.

Some class-wide conversions were not properly detected as needed.

Part of S521-062.
---
 src/core/aws-net-acceptors.adb      | 6 +++---
 src/core/aws-server.adb             | 2 +-
 src/extended/aws-server-hotplug.adb | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/core/aws-net-acceptors.adb b/src/core/aws-net-acceptors.adb
index 0631d1f56..7c2f16a70 100644
--- a/src/core/aws-net-acceptors.adb
+++ b/src/core/aws-net-acceptors.adb
@@ -507,7 +507,7 @@ package body AWS.Net.Acceptors is
 
       procedure Add (S : not null access Socket_Type'Class) is
       begin
-         Sockets.Append (S);
+         Sockets.Append (Socket_Access (S));
       end Add;
 
       -----------
@@ -647,7 +647,7 @@ package body AWS.Net.Acceptors is
                       and then Acceptor.W_Signal /= null;
 
          if Success then
-            Buffer.Append (S);
+            Buffer.Append (Socket_Access (S));
             Acceptor.W_Signal.Send ((1 => Socket_Command));
          end if;
       end Add;
diff --git a/src/core/aws-server.adb b/src/core/aws-server.adb
index 419124460..4f6ce774e 100644
--- a/src/core/aws-server.adb
+++ b/src/core/aws-server.adb
@@ -898,7 +898,7 @@ package body AWS.Server is
       begin
          pragma Assert (Count > 0);
 
-         Table (Index).Sock := Socket;
+         Table (Index).Sock := Socket_Access (Socket);
          Table (Index).Alive_Counter := 0;
          Table (Index).Alive_Time_Stamp := Ada.Calendar.Clock;
          Table (Index).Activity_Counter := Table (Index).Activity_Counter + 1;
diff --git a/src/extended/aws-server-hotplug.adb b/src/extended/aws-server-hotplug.adb
index c5176eec1..68d55a64d 100644
--- a/src/extended/aws-server-hotplug.adb
+++ b/src/extended/aws-server-hotplug.adb
@@ -120,7 +120,7 @@ package body AWS.Server.Hotplug is
       Line   : String_Split.Slice_Set;
       N      : Natural := 0;
    begin
-      Hotplug_Server.Start (Port, Web_Server, Host => Host);
+      Hotplug_Server.Start (Port, HTTP_Access (Web_Server), Host => Host);
       AWS.Hotplug.Set_Mode (Web_Server.Filters, Register_Mode);
 
       Text_IO.Open (File, Text_IO.In_File, Authorization_File);
From 364dab06828c4b6e519956cff6ce2ab3f08ef15c Mon Sep 17 00:00:00 2001
From: Dmitriy Anisimkov <anisimko@adacore.com>
Date: Thu, 11 Jul 2019 19:56:17 +0600
Subject: [PATCH] Don't reconstruct the socket address

K530-015

Set Port to Get_Address_Info call instead. This need because Sock_Addr_Type
going to became more complex when Unix local socket will be implemented.
---
 config/src/aws-net-std__gnat.adb | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/config/src/aws-net-std__gnat.adb b/config/src/aws-net-std__gnat.adb
index 2963fd961..c74bb8aa5 100644
--- a/config/src/aws-net-std__gnat.adb
+++ b/config/src/aws-net-std__gnat.adb
@@ -121,7 +121,8 @@ package body AWS.Net.Std is
          Keep_Excp : Exceptions.Exception_Occurrence;
          Addresses : Address_Info_Array :=
                        Get_Address_Info
-                         (Host, "", To_GNAT (Family), Passive => True);
+                         (Host, Utils.Image (Port), To_GNAT (Family),
+                          Passive => True);
       begin
          if Family = Family_Unspec then
             Sort (Addresses, IPv6_TCP_Preferred'Access);
@@ -145,10 +146,7 @@ package body AWS.Net.Std is
                  (Socket.S.FD, Socket_Level,
                   Option => (Sockets.Reuse_Address, Enabled => Reuse_Address));
 
-               Bind_Socket
-                 (Socket.S.FD,
-                  (Addr_Info.Addr.Family, Addr_Info.Addr.Addr,
-                   Sockets.Port_Type (Port)));
+               Bind_Socket (Socket.S.FD, Addr_Info.Addr);
 
                return;