Skip to content

Commit 0e670cb

Browse files
TurboGittonunaks
authored andcommitted
Server.Start add way to specify the host to bind to.
Starting a server with the simple Start API was only supporting binding to all available devices. eng/toolchain/aws#50.
1 parent b4647b9 commit 0e670cb

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/core/aws-net.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ package body AWS.Net is
645645
-----------------
646646

647647
procedure Socket_Pair (S1, S2 : out Socket_Type) is
648-
Server : Std.Socket_Type;
649648
subtype STC is Socket_Type'Class;
650649
Local_Host : constant String := "127.0.0.1";
650+
Server : Std.Socket_Type;
651651
begin
652652
Std.Bind (Server, Host => Local_Host, Port => 0);
653653
Std.Listen (Server);

src/core/aws-server.adb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ package body AWS.Server is
11871187
Callback : Response.Callback;
11881188
Max_Connection : Positive := Default.Max_Connection;
11891189
Admin_URI : String := Default.Admin_URI;
1190+
Host : String := "";
11901191
Port : Natural := Default.Server_Port;
11911192
Security : Boolean := False;
11921193
Session : Boolean := False;
@@ -1196,6 +1197,7 @@ package body AWS.Server is
11961197
begin
11971198
CNF.Set.Server_Name (Web_Server.Properties, Name);
11981199
CNF.Set.Admin_URI (Web_Server.Properties, Admin_URI);
1200+
CNF.Set.Server_Host (Web_Server.Properties, Host);
11991201
CNF.Set.Server_Port (Web_Server.Properties, Port);
12001202
CNF.Set.Security (Web_Server.Properties, Security);
12011203
CNF.Set.Session (Web_Server.Properties, Session);

src/core/aws-server.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ package AWS.Server is
9999
Callback : Response.Callback;
100100
Max_Connection : Positive := Default.Max_Connection;
101101
Admin_URI : String := Default.Admin_URI;
102+
Host : String := "";
102103
Port : Natural := Default.Server_Port;
103104
Security : Boolean := False;
104105
Session : Boolean := False;

0 commit comments

Comments
 (0)