[pgsqlclient-checkins] pgsqlclient_10/PgSqlClient.Security.Tls/source TlsNetworkStream.cs,1.2,1.3 Tl
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-09-17 14:44:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source In directory sc8-pr-cvs1:/tmp/cvs-serv28641 Modified Files: TlsNetworkStream.cs TlsSocket.cs Log Message: * Added DataAvailable property to the TlsNEtworkStream class. * Added minor change to the main Receive method overload on the TlsScoket class ( needs testing but seems to work ). Index: TlsNetworkStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsNetworkStream.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsNetworkStream.cs 16 Sep 2003 22:29:26 -0000 1.2 --- TlsNetworkStream.cs 17 Sep 2003 14:44:16 -0000 1.3 *************** *** 64,67 **** --- 64,90 ---- } + public bool DataAvailable + { + get + { + if (socket == null) + { + throw new IOException(); + } + + if (this.socket.Session.IsSecure) + { + if ((this.socket.InputBuffer.Length - this.socket.InputBuffer.Position) > 0) + { + return true; + } + } + + // If there are bytes in the socket buffer return true + // otherwise false + return this.socket.Available != 0; + } + } + #endregion Index: TlsSocket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PgSqlClient.Security.Tls/source/TlsSocket.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsSocket.cs 17 Sep 2003 09:51:59 -0000 1.4 --- TlsSocket.cs 17 Sep 2003 14:44:17 -0000 1.5 *************** *** 30,34 **** namespace System.Security.Tls { ! public class TlsSocket : Socket { #region FIELDS --- 30,34 ---- namespace System.Security.Tls { ! public sealed class TlsSocket : Socket { #region FIELDS *************** *** 39,42 **** --- 39,56 ---- #endregion + #region PROPERTIES + + internal TlsSession Session + { + get { return this.session; } + } + + internal BufferedStream InputBuffer + { + get { return inputBuffer; } + } + + #endregion + #region CONSTRUCTORS *************** *** 115,118 **** --- 129,138 ---- // Restore buffer position inputBuffer.Seek(position, SeekOrigin.Begin); + } + + #warning "This needs testing" + if (base.Available == 0) + { + break; } } |