File tree Expand file tree Collapse file tree
src/Microsoft.Owin.Host.HttpListener/RequestProcessing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,22 +62,7 @@ internal void End(Exception ex)
6262 {
6363 if ( ex != null )
6464 {
65- // TODO: LOG
66- // Lazy initialized
67- if ( _cts != null )
68- {
69- try
70- {
71- _cts . Cancel ( ) ;
72- }
73- catch ( ObjectDisposedException )
74- {
75- }
76- catch ( AggregateException )
77- {
78- // TODO: LOG
79- }
80- }
65+ CancelDisconnectToken ( ) ;
8166 }
8267
8368 End ( ) ;
@@ -99,7 +84,26 @@ internal void End()
9984 private static void SetDisconnected ( object state )
10085 {
10186 var context = ( OwinHttpListenerContext ) state ;
102- context . End ( new HttpListenerException ( Constants . ErrorConnectionNoLongerValid ) ) ;
87+ context . CancelDisconnectToken ( ) ;
88+ }
89+
90+ private void CancelDisconnectToken ( )
91+ {
92+ // Lazy initialized
93+ if ( _cts != null )
94+ {
95+ try
96+ {
97+ _cts . Cancel ( ) ;
98+ }
99+ catch ( ObjectDisposedException )
100+ {
101+ }
102+ catch ( AggregateException )
103+ {
104+ // TODO: LOG
105+ }
106+ }
103107 }
104108
105109 public void Dispose ( )
You can’t perform that action at this time.
0 commit comments