Skip to content

Commit

Permalink
Fix missing session created on failure (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Oct 1, 2024
1 parent 8a5bce4 commit ba859f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/SmtpServer/SmtpSessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ async Task RunAsync(SmtpSessionHandle handle, CancellationToken cancellationToke

try
{
_smtpServer.OnSessionCreated(new SessionEventArgs(handle.SessionContext));

await UpgradeAsync(handle, linkedTokenSource.Token);

linkedTokenSource.Token.ThrowIfCancellationRequested();

_smtpServer.OnSessionCreated(new SessionEventArgs(handle.SessionContext));

await handle.Session.RunAsync(linkedTokenSource.Token);

_smtpServer.OnSessionCompleted(new SessionEventArgs(handle.SessionContext));
Expand Down

0 comments on commit ba859f6

Please sign in to comment.