Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
dgud committed Jan 25, 2024
1 parent a5d4806 commit f20ed3c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/ssl/src/tls_dtls_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ handle_session(#server_hello{cipher_suite = CipherSuite},

case ssl_session:is_new(Session, NewId) of
true ->
handle_new_session(NewId, CipherSuite, State#state{connection_states = ConnectionStates});
handle_new_session(NewId, CipherSuite, State);
false ->
handle_resumed_session(NewId, State#state{connection_states = ConnectionStates})
handle_resumed_session(NewId, State)
end.


Expand Down
9 changes: 6 additions & 3 deletions lib/ssl/src/tls_record.erl
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ binary_from_front(SplitSize, [Bin|Front], Size, Rear, []) ->
BinSize = byte_size(Bin),
if
SplitSize < BinSize ->
{RetBin, Rest} = erlang:split_binary(Bin, SplitSize),
<<RetBin:SplitSize/binary, Rest/binary>> = Bin,
%% {RetBin, Rest} = erlang:split_binary(Bin, SplitSize),
{RetBin, {[Rest|Front],Size - SplitSize,Rear}};
BinSize < SplitSize ->
binary_from_front(SplitSize - BinSize, Front, Size, Rear, [Bin]);
Expand All @@ -622,7 +623,8 @@ binary_from_front(SplitSize, [Bin|Front], Size, Rear, Acc) ->
BinSize = byte_size(Bin),
if
SplitSize < BinSize ->
{Last, Rest} = erlang:split_binary(Bin, SplitSize),
<<Last:SplitSize/binary, Rest/binary>> = Bin,
%% {Last, Rest} = erlang:split_binary(Bin, SplitSize),
RetBin = iolist_to_binary(lists:reverse(Acc, [Last])),
{RetBin, {[Rest|Front],Size - byte_size(RetBin),Rear}};
BinSize < SplitSize ->
Expand Down Expand Up @@ -703,7 +705,8 @@ split_iovec([Bin|Data] = Bin_Data, SplitSize, Acc) ->
SplitSize == 0 ->
{lists:reverse(Acc), Bin_Data};
SplitSize < BinSize ->
{Last, Rest} = erlang:split_binary(Bin, SplitSize),
<<Last:SplitSize/binary, Rest/binary>> = Bin,
%% {Last, Rest} = erlang:split_binary(Bin, SplitSize),
{lists:reverse(Acc, [Last]), [Rest|Data]}
end;
split_iovec([], _SplitSize, Acc) ->
Expand Down
5 changes: 3 additions & 2 deletions lib/ssl/src/tls_sender.erl
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,9 @@ time_to_rekey(_, _Data,
is_time_to_renegotiate(Num, RenegotiateAt).

chunk_data(Data, Size) ->
{Chunk, Rest} = split_binary(iolist_to_binary(Data), Size),
{[Chunk], [Rest]}.
split_binary(iolist_to_binary(Data), Size).
%% <<Chunk:Size/binary, Rest/binary>> = iolist_to_binary(Data),
%% {Chunk, Rest}.

is_time_to_renegotiate(N, M) when N < M->
false;
Expand Down
5 changes: 3 additions & 2 deletions lib/ssl/test/ssl_bench_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ count(Config) ->
-define(EPROF_CLIENT, false).
-define(EPROF_SERVER, false).

-define(TPROF_CLIENT, false).
-define(TPROF_CLIENT, true).
%% -define(TPROF_CLIENT, false).
-define(TPROF_SERVER, false). %% untested

%% Current numbers gives roughly a testcase per minute on todays hardware..
Expand Down Expand Up @@ -359,7 +360,7 @@ do_test(Type, {Func, _}=TC, Loop, ParallellConnections, Server) ->
[receive Pid -> ok end || Pid <- Pids]
end,
io:format("~nStarting in 5 seconds~n perf record --call-graph=fp --pid ~s~n~n", [os:getpid()]),
timer:sleep(5000),
timer:sleep(2000),
io:format("Starting~n"),
{TimeInMicro, _} = timer:tc(Run),
TotalTests = ParallellConnections * Loop,
Expand Down

0 comments on commit f20ed3c

Please sign in to comment.