From 12eda11d9d3ccf03378c80034d9e2ecc4108437d Mon Sep 17 00:00:00 2001 From: Alexey Radkov Date: Mon, 29 Apr 2024 03:23:22 +0400 Subject: [PATCH] replace httpd_util functions removed in OTP26 see details [here](https://www.erlang.org/doc/general_info/removed), the removed functions were replaced by proposed erlang functions which existed since very early releases and had the same behavior, so the change must be ok with older OTP versions too --- src/tsung/ts_digest.erl | 4 ++-- src/tsung/ts_http.erl | 2 +- src/tsung/ts_http_common.erl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tsung/ts_digest.erl b/src/tsung/ts_digest.erl index e12d979bb..38105c6fd 100644 --- a/src/tsung/ts_digest.erl +++ b/src/tsung/ts_digest.erl @@ -72,13 +72,13 @@ shahex(Clear) -> %%%---------------------------------------------------------------------- tohex(A)-> Fun = fun(X)-> - ts_utils:to_lower(padhex(httpd_util:integer_to_hexlist(X))) + ts_utils:to_lower(padhex(erlang:integer_to_list(X, 16))) end, lists:flatten( lists:map(Fun, A) ). %%%---------------------------------------------------------------------- %%% Func: padhex/1 -%%% Purpose: needed because httpd_util:integer_to_hexlist returns hex +%%% Purpose: needed because erlang:integer_to_list(X, 16) returns hex %%% values <10 as only 1 character, ie. "0F" is simply returned as %%% "F". For our digest, we need these leading zeros to be present. %%% ---------------------------------------------------------------------- diff --git a/src/tsung/ts_http.erl b/src/tsung/ts_http.erl index 5bd7e2c16..0526c0e2d 100644 --- a/src/tsung/ts_http.erl +++ b/src/tsung/ts_http.erl @@ -315,7 +315,7 @@ decode_chunk_size(<>, Headers, Body, <<>>) when Hea ?Debug("decode chunk: crlf, no digit"), decode_chunk_size(Data, Headers, Body, <<>>); decode_chunk_size(<>, Headers, Body,Digits) when Head == << "\r\n" >> -> - case httpd_util:hexlist_to_integer(binary_to_list(Digits)) of + case erlang:list_to_integer(binary_to_list(Digits), 16) of 0 -> decode_chunk_size(Data, Headers, Body ,<<>>); Size -> diff --git a/src/tsung/ts_http_common.erl b/src/tsung/ts_http_common.erl index 346751e28..cb9241264 100644 --- a/src/tsung/ts_http_common.erl +++ b/src/tsung/ts_http_common.erl @@ -405,7 +405,7 @@ parse_chunked(Body, State)-> %%---------------------------------------------------------------------- read_chunk(<<>>, State, Int, Acc) -> ?LOGF("No data in chunk [Int=~p, Acc=~p] ~n", [Int,Acc],?INFO), - AccInt = list_to_binary(httpd_util:integer_to_hexlist(Int)), + AccInt = list_to_binary(erlang:integer_to_list(Int, 16)), { State#state_rcv{acc = AccInt, ack_done = false }, [] }; % read more data %% this code has been inspired by inets/http_lib.erl %% Extensions not implemented