Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls
In directory sc8-pr-cvs1:/tmp/cvs-serv28189
Modified Files:
SslClientStream.cs
Log Message:
2003-12-23 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/SslClientStream.cs:
- Try to improve record reading.
Index: SslClientStream.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SslClientStream.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** SslClientStream.cs 21 Dec 2003 14:36:14 -0000 1.11
--- SslClientStream.cs 23 Dec 2003 18:26:14 -0000 1.12
***************
*** 498,503 ****
long position = this.inputBuffer.Position;
byte[] record = this.receiveRecord();
!
! if (record.Length > 0)
{
// Write new data to the inputBuffer
--- 498,504 ----
long position = this.inputBuffer.Position;
byte[] record = this.receiveRecord();
!
! if (record != null &&
! record.Length > 0)
{
// Write new data to the inputBuffer
***************
*** 508,511 ****
--- 509,519 ----
this.inputBuffer.Seek(position, SeekOrigin.Begin);
}
+ else
+ {
+ if (record == null)
+ {
+ break;
+ }
+ }
}
***************
*** 614,618 ****
}
! TlsContentType contentType = (TlsContentType)innerStream.ReadByte();
SecurityProtocolType protocol = (SecurityProtocolType)this.ReadShort();
short length = this.ReadShort();
--- 622,635 ----
}
! // Try to read the Record Content Type
! int type = innerStream.ReadByte();
!
! // There are no more data for read
! if (type == -1)
! {
! return null;
! }
!
! TlsContentType contentType = (TlsContentType)type;
SecurityProtocolType protocol = (SecurityProtocolType)this.ReadShort();
short length = this.ReadShort();
|