[pgsqlclient-checkins] pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls SslClie
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2004-02-15 21:57:48
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32147 Modified Files: SslClientStream.cs Log Message: 2004-2-15 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/SslClientStream.cs: - Added specific control od available data for Network Streams on Read ( Thanks to Francisco Figueiredo Jr. for his feedback ). - Removed test code. Index: SslClientStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SslClientStream.cs 10 Feb 2004 09:43:42 -0000 1.1 --- SslClientStream.cs 15 Feb 2004 21:50:14 -0000 1.2 *************** *** 389,410 **** throw new NotSupportedException(); - - /* - try - { - IAsyncResult result = this.innerStream.BeginRead( - buffer, - offset, - count, - callback, - state); - - return result; - } - catch (Exception ex) - { - throw new IOException("An error occurred on the underlying stream. See the inner exception for details on the error.", ex); - } - */ } --- 389,392 ---- *************** *** 431,447 **** throw new NotSupportedException(); - - /* - try - { - int readed = this.innerStream.EndRead(asyncResult); - - return readed; - } - catch (Exception ex) - { - throw new IOException("An error occurred on the underlying stream. See the inner exception for details on the error.", ex); - } - */ } --- 413,416 ---- *************** *** 480,485 **** if (!this.context.HandshakeFinished) { ! // Start handshake negotiation ! this.doHandshake(); } --- 449,453 ---- if (!this.context.HandshakeFinished) { ! this.doHandshake(); // Handshake negotiation } *************** *** 528,533 **** byte[] record = this.receiveRecord(); ! if (record != null && ! record.Length > 0) { // Write new data to the inputBuffer --- 496,500 ---- byte[] record = this.receiveRecord(); ! if (record != null && record.Length > 0) { // Write new data to the inputBuffer *************** *** 545,548 **** --- 512,525 ---- } } + + // TODO: Review if we need to check the Length + // property of the innerStream for other types + // of streams, to check that there are data available + // for read + if (this.innerStream is NetworkStream && + !((NetworkStream)this.innerStream).DataAvailable) + { + break; + } } *************** *** 652,656 **** // Try to read the Record Content Type ! int type = innerStream.ReadByte(); // There are no more data for read --- 629,633 ---- // Try to read the Record Content Type ! int type = this.innerStream.ReadByte(); // There are no more data for read |