From bab411303a53522268937db6b3434c7e1b8a09d1 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Tue, 5 Apr 2022 21:16:13 +0800 Subject: [PATCH] Fix typos --- README.md | 2 +- src/mtp_codec.erl | 2 +- src/mtp_down_conn.erl | 2 +- src/mtp_handler.erl | 2 +- test/mtp_test_client.erl | 2 +- test/prop_mtp_statefull.erl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e0f64ee..d076126 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ This will: ### Try to start in foreground mode -This step is optional, but it can be usefull to test if everything works as expected +This step is optional, but it can be useful to test if everything works as expected ```bash ./start.sh diff --git a/src/mtp_codec.erl b/src/mtp_codec.erl index 44f4c77..8ff4b69 100644 --- a/src/mtp_codec.erl +++ b/src/mtp_codec.erl @@ -1,7 +1,7 @@ %%% @author Sergey %%% @copyright (C) 2018, Sergey %%% @doc -%%% This module provieds a comination of crypto and packet codecs. +%%% This module provieds a combination of crypto and packet codecs. %%% Crypto is always outer layer and packet is inner: %%% ( --- packet --- ) %%% (-- crypto --) diff --git a/src/mtp_down_conn.erl b/src/mtp_down_conn.erl index 54dd73a..4579115 100644 --- a/src/mtp_down_conn.erl +++ b/src/mtp_down_conn.erl @@ -346,7 +346,7 @@ build_backpressure_conf(UpstreamsPerDownstream, BpConf) -> orelse error({invalid_bytes_per_upstream, PacketsPerUpstream}), {PacketsTotal, BytesTotal, PacketsPerUpstream, BytesPerUpstream}. -%% Bumb counters of non-acked packets +%% Bump counters of non-acked packets non_ack_bump(Upstream, Size, #state{non_ack_count = Cnt, non_ack_bytes = Oct, upstreams = Ups} = St) -> diff --git a/src/mtp_handler.erl b/src/mtp_handler.erl index 5752af8..b3ae299 100644 --- a/src/mtp_handler.erl +++ b/src/mtp_handler.erl @@ -503,7 +503,7 @@ do_check_health([{qlen, Limit} | _], #{message_queue_len := QLen} = Health) when overflow; do_check_health([{gc, Limit} | Other], #{total_mem := TotalMem}) when TotalMem > Limit -> %% Maybe it doesn't makes sense to do GC if queue len is more than, eg, 50? - %% In this case allmost all memory will be in msg queue + %% In this case almost all memory will be in msg queue mtp_metric:count_inc([?APP, healthcheck, total], 1, #{labels => [force_gc]}), erlang:garbage_collect(self()), diff --git a/test/mtp_test_client.erl b/test/mtp_test_client.erl index 9c07a38..8ef14de 100644 --- a/test/mtp_test_client.erl +++ b/test/mtp_test_client.erl @@ -159,7 +159,7 @@ ping_session(Host, Port, Secret, DcId, Protocol, Timeout) -> unencrypted_cli_packet(Payload) -> Now = erlang:system_time(microsecond), %% Is 128 enough? - PadSize = rand:uniform(128 div 4) * 4, % should be alined to 4b + PadSize = rand:uniform(128 div 4) * 4, % should be aligned to 4b Padding = crypto:strong_rand_bytes(PadSize), unencrypted_cli_packet(Payload, Now, Padding). diff --git a/test/prop_mtp_statefull.erl b/test/prop_mtp_statefull.erl index bb1c15b..e5c0dad 100644 --- a/test/prop_mtp_statefull.erl +++ b/test/prop_mtp_statefull.erl @@ -278,7 +278,7 @@ stop(Cfg) -> Cfg. -%% Proces - wrapper holding client connections and states +%% Process - wrapper holding client connections and states shim_add(Id, Conn) -> ?MODULE ! {add, Id, Conn}.