Skip to content

Commit 8262ef4

Browse files
KensanTurboGit
authored andcommitted
Support content ranges larger than 2 GB
Use Ada.Streams.Stream_Element_Offset as base for AWS.Client.Content_Bound type to increase addressable content ranges.
1 parent 621d703 commit 8262ef4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/core/aws-client-http_utils.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,15 @@ package body AWS.Client.HTTP_Utils is
405405
Append (Result, "bytes=");
406406

407407
if Data_Range.First /= Undefined then
408-
Append (Result, Utils.Image (Natural (Data_Range.First)));
408+
Append
409+
(Result, Utils.Image (Stream_Element_Offset (Data_Range.First)));
409410
end if;
410411

411412
Append (Result, "-");
412413

413414
if Data_Range.Last /= Undefined then
414-
Append (Result, Utils.Image (Natural (Data_Range.Last)));
415+
Append
416+
(Result, Utils.Image (Stream_Element_Offset (Data_Range.Last)));
415417
end if;
416418

417419
return To_String (Result);

src/core/aws-client.ads

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ package AWS.Client is
103103
-- Messages --
104104
--------------
105105

106-
type Content_Bound is new Integer range -1 .. Integer'Last;
106+
type Content_Bound is new
107+
Stream_Element_Offset range -1 .. Stream_Element_Offset'Last;
107108

108109
Undefined : constant Content_Bound := -1;
109110

0 commit comments

Comments
 (0)