Skip to content

Commit e533c32

Browse files
committed
Minor code clean-up.
Part of S507-051.
1 parent 49c1587 commit e533c32

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

src/http2/aws-http2-frame-ping.ads

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ package AWS.HTTP2.Frame.Ping is
3939

4040
type Opaque_Data is new Stream_Element_Array (1 .. 8);
4141

42-
Default_Data : constant Opaque_Data := (0, 0, 0, 0, 0, 0, 0, 0);
42+
Default_Data : constant Opaque_Data;
4343

4444
function Create
4545
(Data : Opaque_Data := Default_Data;
@@ -57,6 +57,8 @@ package AWS.HTTP2.Frame.Ping is
5757

5858
private
5959

60+
Default_Data : constant Opaque_Data := (0, 0, 0, 0, 0, 0, 0, 0);
61+
6062
-- RFC-7540 6.7
6163
--
6264
-- +---------------------------------------------------------------+

src/http2/aws-http2-frame.ads

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
------------------------------------------------------------------------------
2929

3030
with Ada.Finalization;
31-
with Ada.Streams;
3231

3332
with System;
3433

@@ -41,7 +40,6 @@ private with AWS.Utils;
4140
package AWS.HTTP2.Frame is
4241

4342
use Ada;
44-
use Ada.Streams;
4543

4644
type Object is new Finalization.Controlled with private;
4745

src/http2/aws-http2-hpack.ads

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@
2929

3030
-- Support for HAPCK (Header compression) for HTTP/2 protocol
3131

32-
with Ada.Streams;
33-
3432
with AWS.Headers;
3533

3634
limited with AWS.HTTP2.HPACK.Table;
3735
limited with AWS.HTTP2.Connection;
3836

3937
package AWS.HTTP2.HPACK is
4038

41-
use Ada.Streams;
42-
4339
generic
4440
with function End_Of_Stream return Boolean;
4541
with function Get_Byte return Stream_Element;

src/http2/aws-http2-message.ads

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
-- covered by the GNU Public License. --
2828
------------------------------------------------------------------------------
2929

30-
with Ada.Streams;
31-
3230
with AWS.Headers;
3331
with AWS.HTTP2.Frame.List;
3432
with AWS.Response;
@@ -42,8 +40,6 @@ limited with AWS.HTTP2.Stream;
4240

4341
package AWS.HTTP2.Message is
4442

45-
use Ada.Streams;
46-
4743
use type AWS.HTTP2.Frame.List.Count_Type;
4844
use type Response.Data_Mode;
4945

src/http2/aws-http2-stream.ads

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
-- covered by the GNU Public License. --
2828
------------------------------------------------------------------------------
2929

30-
with Ada.Streams;
31-
3230
with AWS.Net;
3331
with AWS.Server.Context;
3432

@@ -41,8 +39,6 @@ with AWS.Status;
4139

4240
package AWS.HTTP2.Stream is
4341

44-
use Ada.Streams;
45-
4642
type State_Kind is (Idle, Reserved_Local, Reserved_Remote, Open,
4743
Half_Closed_Local, Half_Closed_Remote, Closed);
4844
-- RFC 7540 5.1 Stream States

src/http2/aws-http2.ads

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ with Ada.Streams;
3131

3232
package AWS.HTTP2 is
3333

34+
use Ada.Streams;
35+
3436
type Bit_1 is mod 2 ** 1 with Size => 1;
3537

3638
type Byte_1 is mod 2 ** 8 with Size => 8;
@@ -49,16 +51,15 @@ package AWS.HTTP2 is
4951
C_Enhance_Your_CALM, C_Inadequate_Security, C_HTTP_1_1_Required);
5052
-- Error codes that are used in RST_Stream and GoAway frames
5153

52-
Client_Connection_Preface : constant Ada.Streams.Stream_Element_Array :=
53-
(16#50#, 16#52#, 16#49#, 16#20#, 16#2a#,
54-
16#20#, 16#48#, 16#54#, 16#54#, 16#50#,
55-
16#2f#, 16#32#, 16#2e#, 16#30#, 16#0d#,
56-
16#0a#, 16#0d#, 16#0a#, 16#53#, 16#4d#,
57-
16#0d#, 16#0a#, 16#0d#, 16#0a#);
58-
-- "PRI * HTTP/2.0" & CRLF & CRLF & "SM" & CRLF & CRLF
59-
6054
Client_Connection_Preface_1 : constant String := "PRI * HTTP/2.0";
55+
-- Connection preface first part
56+
6157
Client_Connection_Preface_2 : constant String := "SM";
58+
-- Connection preface second part
59+
60+
Client_Connection_Preface : constant Stream_Element_Array;
61+
-- The full connection preface:
62+
-- "PRI * HTTP/2.0" & CRLF & CRLF & "SM" & CRLF & CRLF
6263

6364
function Exception_Message
6465
(Error : Error_Codes; Message : String) return String;
@@ -74,6 +75,13 @@ package AWS.HTTP2 is
7475

7576
private
7677

78+
Client_Connection_Preface : constant Stream_Element_Array :=
79+
(16#50#, 16#52#, 16#49#, 16#20#, 16#2a#,
80+
16#20#, 16#48#, 16#54#, 16#54#, 16#50#,
81+
16#2f#, 16#32#, 16#2e#, 16#30#, 16#0d#,
82+
16#0a#, 16#0d#, 16#0a#, 16#53#, 16#4d#,
83+
16#0d#, 16#0a#, 16#0d#, 16#0a#);
84+
7785
for Error_Codes use (C_No_Error => 16#0#,
7886
C_Protocol_Error => 16#1#,
7987
C_Internal_Error => 16#2#,

0 commit comments

Comments
 (0)