Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
brew install curl zip unzip gnu-sed kerl unixodbc freetds
echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
- uses: actions/cache@v4
id: cache
with:
path: ~/.kerl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
brew install curl zip unzip gnu-sed kerl unixodbc freetds
echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
- uses: actions/cache@v4
id: cache
with:
path: ~/.kerl
Expand Down
23 changes: 13 additions & 10 deletions src/emqtt_bench.erl
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ connect(Parent, N, PubSub, Opts) ->
Prometheus = lists:member(prometheus, Opts),
GoSignalPid = proplists:get_value(publish_signal_pid, Opts),
SendGoSignal = proplists:get_value(send_go_signal, Opts),
IsQuic = is_quic(Opts),
MRef = case is_pid(GoSignalPid) of
true -> monitor(process, GoSignalPid);
_ -> undefined
Expand Down Expand Up @@ -578,7 +577,7 @@ connect(Parent, N, PubSub, Opts) ->
case ConnRet of
{ok, _Props} ->
inc_counter(Prometheus, connect_succ),
(not IsQuic) andalso maybe_record_keylogfile(Client),
_ = maybe_record_keylogfile(Client, Opts),
Res =
case PubSub of
conn ->
Expand Down Expand Up @@ -995,10 +994,8 @@ ssl_opts([{sslversion, Vsn} | Opts], Acc) ->
ssl_opts(Opts, [{versions, [Vsn]} | Acc]);
ssl_opts([{ssl, IsSSL} | Opts], Acc) when is_boolean(IsSSL) ->
ssl_opts(Opts, Acc);
ssl_opts([{nst_dets_file, DetsFile}| Opts], Acc) ->
ok = prepare_nst(DetsFile),
io:format("enable session_tickets~n"),
ssl_opts(Opts, [{session_tickets, manual}|Acc]);
ssl_opts([{nst_dets_file, _DetsFile}| Opts], Acc) ->
ssl_opts(Opts, [{session_tickets, manual} | Acc]);
ssl_opts([{ciphers, Ciphers}| Opts], Acc) ->
CipherList = [ssl:str_to_suite(X) || X <- string:tokens(Ciphers, ",")],
ssl_opts(Opts, [{ciphers, CipherList} | Acc]);
Expand Down Expand Up @@ -1552,6 +1549,10 @@ maybe_prefix_payload(Payload, ClientOpts) ->
is_quic(Opts) ->
proplists:get_value(quic, Opts) =/= false.

-spec is_tls(proplists:proplist()) -> boolean().
is_tls(Opts) ->
proplists:get_bool(ssl, Opts).

quic_opts_from_arg(Opts)->
case proplists:get_value(quic, Opts) of
V when is_boolean(V) ->
Expand Down Expand Up @@ -1584,11 +1585,13 @@ prepare_quicer(Opts) ->
end.

%% @doc write SSL keylog file, for Wireshark TLS decryption.
%% SSL only, doesn't work for other transport
%% SSL only, doesn't work for other transports
%% @end
-spec maybe_record_keylogfile(emqtt:client()) -> ok.
maybe_record_keylogfile(Client) when is_pid(Client) ->
do_write_keylogfile(persistent_term:get(sslkeylogfile, false), Client).
-spec maybe_record_keylogfile(emqtt:client(), proplists:proplist()) -> _.
maybe_record_keylogfile(Client, Opts) when is_pid(Client) ->
is_tls(Opts) andalso
not is_quic(Opts) andalso
do_write_keylogfile(persistent_term:get(sslkeylogfile, false), Client).
do_write_keylogfile(false, _Client) ->
ok;
do_write_keylogfile(Keylogpath, Client) ->
Expand Down
Loading