@@ -258,9 +258,9 @@ public void HandleReceiveComplete(SNIPacket packet, uint sniErrorCode)
258
258
259
259
_currentHeader . Read ( _headerBytes ) ;
260
260
261
- _dataBytesLeft = ( int ) _currentHeader . length ;
262
- _currentPacket = _lowerHandle . RentPacket ( headerSize : 0 , dataSize : ( int ) _currentHeader . length ) ;
263
- }
261
+ _dataBytesLeft = ( int ) _currentHeader . length ;
262
+ _currentPacket = _lowerHandle . RentPacket ( headerSize : 0 , dataSize : ( int ) _currentHeader . length ) ;
263
+ }
264
264
265
265
currentHeader = _currentHeader ;
266
266
currentPacket = _currentPacket ;
@@ -313,22 +313,22 @@ public void HandleReceiveComplete(SNIPacket packet, uint sniErrorCode)
313
313
currentSession . HandleReceiveComplete ( currentPacket , currentHeader ) ;
314
314
}
315
315
316
- if ( _currentHeader . flags == ( byte ) SNISMUXFlags . SMUX_ACK )
317
- {
318
- try
319
- {
320
- currentSession . HandleAck ( currentHeader . highwater ) ;
321
- }
322
- catch ( Exception e )
316
+ if ( _currentHeader . flags == ( byte ) SNISMUXFlags . SMUX_ACK )
323
317
{
324
- SNICommon . ReportSNIError ( SNIProviders . SMUX_PROV , SNICommon . InternalExceptionError , e ) ;
325
- }
318
+ try
319
+ {
320
+ currentSession . HandleAck ( currentHeader . highwater ) ;
321
+ }
322
+ catch ( Exception e )
323
+ {
324
+ SNICommon . ReportSNIError ( SNIProviders . SMUX_PROV , SNICommon . InternalExceptionError , e ) ;
325
+ }
326
326
327
- Debug . Assert ( _currentPacket == currentPacket , "current and _current are not the same" ) ;
328
- ReturnPacket ( currentPacket ) ;
329
- currentPacket = null ;
330
- _currentPacket = null ;
331
- }
327
+ Debug . Assert ( _currentPacket == currentPacket , "current and _current are not the same" ) ;
328
+ ReturnPacket ( currentPacket ) ;
329
+ currentPacket = null ;
330
+ _currentPacket = null ;
331
+ }
332
332
333
333
lock ( this )
334
334
{
@@ -385,6 +385,16 @@ public void DisableSsl()
385
385
}
386
386
}
387
387
388
+ public SNIPacket RentPacket ( int headerSize , int dataSize )
389
+ {
390
+ return _lowerHandle . RentPacket ( headerSize , dataSize ) ;
391
+ }
392
+
393
+ public void ReturnPacket ( SNIPacket packet )
394
+ {
395
+ _lowerHandle . ReturnPacket ( packet ) ;
396
+ }
397
+
388
398
#if DEBUG
389
399
/// <summary>
390
400
/// Test handle for killing underlying connection
0 commit comments