Skip to content

Commit ba859f6

Browse files
authored
Fix missing session created on failure (cosullivan#239)
1 parent 8a5bce4 commit ba859f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/SmtpServer/SmtpSessionManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ async Task RunAsync(SmtpSessionHandle handle, CancellationToken cancellationToke
3535

3636
try
3737
{
38+
_smtpServer.OnSessionCreated(new SessionEventArgs(handle.SessionContext));
39+
3840
await UpgradeAsync(handle, linkedTokenSource.Token);
3941

4042
linkedTokenSource.Token.ThrowIfCancellationRequested();
4143

42-
_smtpServer.OnSessionCreated(new SessionEventArgs(handle.SessionContext));
43-
4444
await handle.Session.RunAsync(linkedTokenSource.Token);
4545

4646
_smtpServer.OnSessionCompleted(new SessionEventArgs(handle.SessionContext));

0 commit comments

Comments
 (0)