[Need Confirm]: ReadString will clear away receive buffer?

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
applespring
Posts: 22
Joined: Tue 15 May 2012 14:01

[Need Confirm]: ReadString will clear away receive buffer?

Post by applespring » Fri 22 Aug 2014 03:48

Hello

While reading the source code of securebridge to solve the problem of 8 thousand connection
http://forums.devart.com/viewtopic.php?f=27&t=30039 for clear away any possible memory usage due to received response from destination. I need following confirmation

1. Can I use ReadString to clear away the receive buffer and reduce the memory usage, in case of "alarm-storm" case when I would like to ignore any response?

2.
unit ScSSHChannel.pas
procedure ReadString
line 889
the var "buf" is allocated by a call of "SetLength", when do we release the allocated memory by "buf:=nil"? Is here a possible memory leakage?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: [Need Confirm]: ReadString will clear away receive buffer?

Post by Dimon » Wed 01 Oct 2014 08:50

1. You can use the TScSSHChannel.SkipBuffer method to skip some data with no reading it to buffer.
2. The buf variable is released automatically on exit from the ReadString method.

Post Reply