@@ -233,6 +233,7 @@ private static async Task HandleHttpSessionRequest(TcpClient client, string http
233
233
Dispose ( client , clientStream , clientStreamReader , clientStreamWriter , null ) ;
234
234
break ;
235
235
}
236
+
236
237
#endif
237
238
args . WebSession . Request . RequestUri = httpRemoteUri ;
238
239
@@ -269,7 +270,7 @@ await TcpHelper.SendRaw(clientStream, httpCmd, args.WebSession.Request.RequestHe
269
270
}
270
271
271
272
//construct the web request that we are going to issue on behalf of the client.
272
- connection = await TcpConnectionManager . GetClient ( args . WebSession . Request . RequestUri . Host , args . WebSession . Request . RequestUri . Port , args . IsHttps , version ) . ConfigureAwait ( false ) ;
273
+ connection = await TcpConnectionManager . GetClient ( args . WebSession . Request . RequestUri . Host , args . WebSession . Request . RequestUri . Port , args . IsHttps , version ) . ConfigureAwait ( false ) ;
273
274
274
275
275
276
args . WebSession . Request . RequestLocked = true ;
@@ -343,6 +344,8 @@ await WriteResponseStatus(args.WebSession.Response.HttpVersion, "417",
343
344
return ;
344
345
}
345
346
347
+ await TcpConnectionManager . ReleaseClient ( connection ) ;
348
+
346
349
// read the next request
347
350
httpCmd = await clientStreamReader . ReadLineAsync ( ) . ConfigureAwait ( false ) ;
348
351
@@ -355,8 +358,6 @@ await WriteResponseStatus(args.WebSession.Response.HttpVersion, "417",
355
358
356
359
}
357
360
358
- if ( connection != null )
359
- await TcpConnectionManager . ReleaseClient ( connection ) ;
360
361
}
361
362
362
363
private static async Task WriteConnectResponse ( StreamWriter clientStreamWriter , Version httpVersion )
0 commit comments