diff options
Diffstat (limited to 'lib/inets/src/http_lib/http_chunk.erl')
-rw-r--r-- | lib/inets/src/http_lib/http_chunk.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/inets/src/http_lib/http_chunk.erl b/lib/inets/src/http_lib/http_chunk.erl index 74f4cc1b3d..0588937275 100644 --- a/lib/inets/src/http_lib/http_chunk.erl +++ b/lib/inets/src/http_lib/http_chunk.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2022. All Rights Reserved. +%% Copyright Ericsson AB 2004-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -71,8 +71,8 @@ decode(ChunkedBody, MaxBodySize, MaxHeaderSize) -> %% input format. When sending the data on the both formats %% are accepted. %%------------------------------------------------------------------------- -encode(Chunk) when is_binary(Chunk)-> - HEXSize = list_to_binary(http_util:integer_to_hexlist(size(Chunk))), +encode(Chunk) when is_binary(Chunk) -> + HEXSize = list_to_binary(http_util:integer_to_hexlist(byte_size(Chunk))), <<HEXSize/binary, ?CR, ?LF, Chunk/binary, ?CR, ?LF>>; encode([<<>>]) -> @@ -202,7 +202,7 @@ ignore_extensions(<<_Octet, Rest/binary>>, RemainingSize, TotalMaxHeaderSize, Ne decode_data(ChunkSize, TotalChunk, Info = {MaxBodySize, BodySoFar, AccLength, MaxHeaderSize}) - when ChunkSize =< size(TotalChunk) -> + when is_binary(TotalChunk), ChunkSize =< byte_size(TotalChunk) -> case TotalChunk of %% Last chunk <<Data:ChunkSize/binary, ?CR, ?LF, "0", ";">> -> |