Skip to content

Commit

Permalink
Simplify try_send code
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Jan 7, 2025
1 parent bd7fae3 commit 8782699
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/gen_smtp_server_session.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1358,13 +1358,9 @@ check_bare_crlf(Binary, _Prev, Op, Offset) ->
end
end.

try_send(#state{transport = Transport, socket = Sock} = St, Data) ->
case Transport:send(Sock, Data) of
ok ->
ok;
{error, _Err} ->
ok
end.
try_send(#state{transport = Transport, socket = Sock}, Data) ->
Transport:send(Sock, Data),
ok.

send(#state{transport = Transport, socket = Sock} = St, Data) ->
case Transport:send(Sock, Data) of
Expand Down

0 comments on commit 8782699

Please sign in to comment.