pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 30)
Status: Inactive
Brought to you by:
carlosga_fb
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(120) |
Aug
(95) |
Sep
(95) |
Oct
(213) |
Nov
(114) |
Dec
(64) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(6) |
Feb
(134) |
Mar
(88) |
Apr
(28) |
May
(22) |
Jun
(15) |
Jul
(23) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(6) |
Dec
|
| 2005 |
Jan
(8) |
Feb
(6) |
Mar
|
Apr
(42) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
(84) |
Apr
(46) |
May
(40) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <car...@us...> - 2003-12-02 11:38:30
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv27930
Modified Files:
PgCommand.cs
Log Message:
2003-12-02 Carlos Guzmán Álvarez <car...@te...>
* source/PgCommand.cs:
* source/NPgClient/PgStatement.cs:
- Minor uimprovement to prepare process.
Index: PgCommand.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** PgCommand.cs 26 Nov 2003 14:58:37 -0000 1.19
--- PgCommand.cs 2 Dec 2003 11:38:27 -0000 1.20
***************
*** 447,458 ****
parseParameterNames());
! // Parse the statment
! this.statement.Parse();
!
! if (this.parameters.Count != 0)
! {
! // Describe parameters
! this.statement.Describe();
! }
}
else
--- 447,452 ----
parseParameterNames());
! // Prepare the statment
! this.statement.Prepare();
}
else
|
|
From: <car...@us...> - 2003-11-28 17:24:10
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls
In directory sc8-pr-cvs1:/tmp/cvs-serv22740
Modified Files:
SslClientStream.cs
Log Message:
2003-11-28 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/SslClientStream.cs:
- Added new exceptions.
Index: SslClientStream.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SslClientStream.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SslClientStream.cs 23 Nov 2003 12:50:08 -0000 1.6
--- SslClientStream.cs 28 Nov 2003 17:24:07 -0000 1.7
***************
*** 30,33 ****
--- 30,34 ----
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
+ using System.Threading;
using Mono.Security.Protocol.Tls.Alerts;
***************
*** 70,73 ****
--- 71,76 ----
private bool ownsStream;
private bool disposed;
+ private string read;
+ private string write;
#endregion
***************
*** 257,260 ****
--- 260,265 ----
this.innerStream = stream;
this.ownsStream = ownsStream;
+ this.read = String.Empty;
+ this.write = String.Empty;
}
***************
*** 329,335 ****
throw new ObjectDisposedException("The SslClientStream is closed.");
}
!
! #warning "Throw exception: A read operation is already in progress."
!
if (buffer == null)
{
--- 334,338 ----
throw new ObjectDisposedException("The SslClientStream is closed.");
}
!
if (buffer == null)
{
***************
*** 352,356 ****
throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
!
try
{
--- 355,362 ----
throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
!
! throw new NotSupportedException();
!
! /*
try
{
***************
*** 368,371 ****
--- 374,378 ----
throw new IOException("An error occurred on the underlying stream. See the inner exception for details on the error.", ex);
}
+ */
}
***************
*** 391,400 ****
}
try
{
int readed = this.innerStream.EndRead(asyncResult);
!
! #warning "Decrypt readed data here"
!
return readed;
}
--- 398,408 ----
}
+ throw new NotSupportedException();
+
+ /*
try
{
int readed = this.innerStream.EndRead(asyncResult);
!
return readed;
}
***************
*** 403,406 ****
--- 411,415 ----
throw new IOException("An error occurred on the underlying stream. See the inner exception for details on the error.", ex);
}
+ */
}
***************
*** 436,442 ****
throw new ObjectDisposedException("The SslClientStream is closed.");
}
!
! #warning "Throw exception: A read operation is already in progress."
!
if (!this.context.HandshakeFinished)
{
--- 445,449 ----
throw new ObjectDisposedException("The SslClientStream is closed.");
}
!
if (!this.context.HandshakeFinished)
{
***************
*** 465,471 ****
throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
!
try
{
// If actual buffer is full readed reset it
if (this.inputBuffer.Position == this.inputBuffer.Length &&
--- 472,484 ----
throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
!
! if (!Monitor.TryEnter(this.read))
! {
! throw new InvalidOperationException("A read operation is already in progress.");
! }
try
{
+ System.Threading.Monitor.Enter(this.read);
+
// If actual buffer is full readed reset it
if (this.inputBuffer.Position == this.inputBuffer.Length &&
***************
*** 504,507 ****
--- 517,524 ----
throw new IOException("IO exception during read.", ex);
}
+ finally
+ {
+ System.Threading.Monitor.Exit(this.read);
+ }
}
***************
*** 528,533 ****
}
- #warning "Throw exception: A write operation is already in progress."
-
if (!this.context.HandshakeFinished)
{
--- 545,548 ----
***************
*** 557,562 ****
--- 572,583 ----
}
+ if (!Monitor.TryEnter(this.write))
+ {
+ throw new InvalidOperationException("A write operation is already in progress.");
+ }
try
{
+ Monitor.Enter(this.write);
+
// Send the buffer as a TLS record
byte[] recordData = new byte[count];
***************
*** 573,576 ****
--- 594,601 ----
throw new IOException("IO exception during Write.", ex);
}
+ finally
+ {
+ Monitor.Exit(this.write);
+ }
}
|
|
From: <car...@us...> - 2003-11-26 14:59:32
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv18335 Modified Files: changelog.txt Log Message: 2003-11-26 Carlos Guzmán Álvarez <car...@te...> * source/PgCommand.cs: * source/NPgClient/PgStatement.cs: - Added minor improvement for call Describe only when it's needed. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** changelog.txt 24 Nov 2003 16:40:28 -0000 1.83 --- changelog.txt 26 Nov 2003 14:59:29 -0000 1.84 *************** *** 2,5 **** --- 2,13 ---- ------------------------------------------------------- + 2003-11-26 Carlos Guzmán Álvarez <car...@te...> + + * source/PgCommand.cs: + * source/NPgClient/PgStatement.cs: + + - Added minor improvement for call Describe only when it's needed. + + 2003-11-24 Carlos Guzmán Álvarez <car...@te...> |
|
From: <car...@us...> - 2003-11-26 14:59:15
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1:/tmp/cvs-serv18263 Modified Files: PgStatement.cs Log Message: 2003-11-26 Carlos Guzmán Álvarez <car...@te...> * source/PgCommand.cs: * source/NPgClient/PgStatement.cs: - Added minor improvement for call Describe only when it's needed. Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgStatement.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PgStatement.cs 23 Nov 2003 20:10:03 -0000 1.13 --- PgStatement.cs 26 Nov 2003 14:59:12 -0000 1.14 *************** *** 212,215 **** --- 212,219 ---- // Update status this.status = PgStatementStatus.Parsed; + + // Initialize RowDescriptor and Parameters + rowDescriptor = new PgRowDescriptor(0); + parameters = new PgParameter[0]; } catch (PgClientException ex) *************** *** 261,264 **** --- 265,269 ---- } + /* // Set a default row descriptor for NODATA query result if (response.Message == PgBackendCodes.NODATA) *************** *** 266,269 **** --- 271,275 ---- rowDescriptor = new PgRowDescriptor(0); } + */ // Update status |
|
From: <car...@us...> - 2003-11-26 14:58:40
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv18134
Modified Files:
PgCommand.cs
Log Message:
2003-11-26 Carlos Guzmán Álvarez <car...@te...>
* source/PgCommand.cs:
* source/NPgClient/PgStatement.cs:
- Added minor improvement for call Describe only when it's needed.
Index: PgCommand.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** PgCommand.cs 24 Nov 2003 16:38:58 -0000 1.18
--- PgCommand.cs 26 Nov 2003 14:58:37 -0000 1.19
***************
*** 449,455 ****
// Parse the statment
this.statement.Parse();
!
! // Describe parameters
! this.statement.Describe();
}
else
--- 449,458 ----
// Parse the statment
this.statement.Parse();
!
! if (this.parameters.Count != 0)
! {
! // Describe parameters
! this.statement.Describe();
! }
}
else
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client
In directory sc8-pr-cvs1:/tmp/cvs-serv13528
Modified Files:
TlsClientCertificate.cs TlsClientCertificateVerify.cs
TlsClientFinished.cs TlsClientHello.cs TlsClientKeyExchange.cs
TlsServerCertificate.cs TlsServerCertificateRequest.cs
TlsServerFinished.cs TlsServerHello.cs TlsServerHelloDone.cs
TlsServerKeyExchange.cs
Log Message:
Minor change in constructor
Index: TlsClientCertificate.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TlsClientCertificate.cs 14 Nov 2003 13:42:54 -0000 1.10
--- TlsClientCertificate.cs 25 Nov 2003 12:36:06 -0000 1.11
***************
*** 34,38 ****
public TlsClientCertificate(TlsContext context)
! : base(context, TlsHandshakeType.Certificate, TlsContentType.Handshake)
{
}
--- 34,38 ----
public TlsClientCertificate(TlsContext context)
! : base(context, TlsHandshakeType.Certificate)
{
}
***************
*** 42,48 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Reset();
}
--- 42,48 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Reset();
}
Index: TlsClientCertificateVerify.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** TlsClientCertificateVerify.cs 14 Nov 2003 13:42:54 -0000 1.12
--- TlsClientCertificateVerify.cs 25 Nov 2003 12:36:06 -0000 1.13
***************
*** 36,40 ****
public TlsClientCertificateVerify(TlsContext context)
! : base(context, TlsHandshakeType.Finished, TlsContentType.Handshake)
{
}
--- 36,40 ----
public TlsClientCertificateVerify(TlsContext context)
! : base(context, TlsHandshakeType.Finished)
{
}
***************
*** 44,50 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Reset();
}
--- 44,50 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Reset();
}
Index: TlsClientFinished.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** TlsClientFinished.cs 14 Nov 2003 13:42:54 -0000 1.12
--- TlsClientFinished.cs 25 Nov 2003 12:36:06 -0000 1.13
***************
*** 35,39 ****
public TlsClientFinished(TlsContext context)
! : base(context, TlsHandshakeType.Finished, TlsContentType.Handshake)
{
}
--- 35,39 ----
public TlsClientFinished(TlsContext context)
! : base(context, TlsHandshakeType.Finished)
{
}
***************
*** 43,49 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Reset();
}
--- 43,49 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Reset();
}
Index: TlsClientHello.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TlsClientHello.cs 14 Nov 2003 13:42:54 -0000 1.10
--- TlsClientHello.cs 25 Nov 2003 12:36:06 -0000 1.11
***************
*** 39,43 ****
public TlsClientHello(TlsContext context)
! : base(context, TlsHandshakeType.ClientHello, TlsContentType.Handshake)
{
}
--- 39,43 ----
public TlsClientHello(TlsContext context)
! : base(context, TlsHandshakeType.ClientHello)
{
}
***************
*** 47,53 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Context.ClientRandom = random;
--- 47,53 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Context.ClientRandom = random;
Index: TlsClientKeyExchange.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TlsClientKeyExchange.cs 14 Nov 2003 13:42:54 -0000 1.10
--- TlsClientKeyExchange.cs 25 Nov 2003 12:36:06 -0000 1.11
***************
*** 35,40 ****
public TlsClientKeyExchange (TlsContext context) :
base(context,
! TlsHandshakeType.ClientKeyExchange,
! TlsContentType.Handshake)
{
}
--- 35,39 ----
public TlsClientKeyExchange (TlsContext context) :
base(context,
! TlsHandshakeType.ClientKeyExchange)
{
}
Index: TlsServerCertificate.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** TlsServerCertificate.cs 18 Nov 2003 13:57:27 -0000 1.12
--- TlsServerCertificate.cs 25 Nov 2003 12:36:06 -0000 1.13
***************
*** 53,59 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Context.ServerSettings.Certificates = certificates;
}
--- 53,59 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Context.ServerSettings.Certificates = certificates;
}
Index: TlsServerCertificateRequest.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TlsServerCertificateRequest.cs 14 Nov 2003 13:42:54 -0000 1.7
--- TlsServerCertificateRequest.cs 25 Nov 2003 12:36:06 -0000 1.8
***************
*** 49,55 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Context.ServerSettings.CertificateTypes = this.certificateTypes;
--- 49,55 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Context.ServerSettings.CertificateTypes = this.certificateTypes;
Index: TlsServerFinished.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** TlsServerFinished.cs 14 Nov 2003 13:42:54 -0000 1.12
--- TlsServerFinished.cs 25 Nov 2003 12:36:06 -0000 1.13
***************
*** 43,49 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
// Reset Hahdshake messages information
--- 43,49 ----
#region METHODS
! public override void Update()
{
! base.Update();
// Reset Hahdshake messages information
Index: TlsServerHello.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** TlsServerHello.cs 18 Nov 2003 13:57:27 -0000 1.13
--- TlsServerHello.cs 25 Nov 2003 12:36:06 -0000 1.14
***************
*** 50,56 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Context.SessionId = this.sessionId;
--- 50,56 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Context.SessionId = this.sessionId;
Index: TlsServerHelloDone.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TlsServerHelloDone.cs 14 Nov 2003 13:42:54 -0000 1.6
--- TlsServerHelloDone.cs 25 Nov 2003 12:36:06 -0000 1.7
***************
*** 40,46 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Context.HelloDone = true;
--- 40,46 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Context.HelloDone = true;
Index: TlsServerKeyExchange.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** TlsServerKeyExchange.cs 14 Nov 2003 13:42:54 -0000 1.13
--- TlsServerKeyExchange.cs 25 Nov 2003 12:36:06 -0000 1.14
***************
*** 52,58 ****
#region METHODS
! public override void UpdateSession()
{
! base.UpdateSession();
this.Context.ServerSettings.ServerKeyExchange = true;
--- 52,58 ----
#region METHODS
! public override void Update()
{
! base.Update();
this.Context.ServerSettings.ServerKeyExchange = true;
|
|
From: <car...@us...> - 2003-11-24 16:40:31
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv26157 Modified Files: changelog.txt Log Message: 2003-11-24 Carlos Guzmán Álvarez <car...@te...> * source/PgConnection.cs: * source/PgCommand.cs: * source/PgTransaction.cs: - Added better handling of connection active transaction, (some checks done using the ODBC data provider). Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** changelog.txt 23 Nov 2003 22:28:44 -0000 1.82 --- changelog.txt 24 Nov 2003 16:40:28 -0000 1.83 *************** *** 2,5 **** --- 2,14 ---- ------------------------------------------------------- + 2003-11-24 Carlos Guzmán Álvarez <car...@te...> + + * source/PgConnection.cs: + * source/PgCommand.cs: + * source/PgTransaction.cs: + + - Added better handling of connection active transaction, + (some checks done using the ODBC data provider). + 2003-11-23 Carlos Guzmán Álvarez <car...@te...> |
|
From: <car...@us...> - 2003-11-24 16:39:01
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv25794
Modified Files:
PgCommand.cs PgConnection.cs PgTransaction.cs
Log Message:
2003-11-24 Carlos Guzmán Álvarez <car...@te...>
* source/PgConnection.cs:
* source/PgCommand.cs:
* source/PgTransaction.cs:
- Added better handling of connection active transaction,
(some checks done using the ODBC data provider).
Index: PgCommand.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PgCommand.cs 21 Nov 2003 21:55:54 -0000 1.17
--- PgCommand.cs 24 Nov 2003 16:38:58 -0000 1.18
***************
*** 579,582 ****
--- 579,615 ----
#region PRIVATE_METHODS
+ private void checkCommand()
+ {
+ if (this.transaction != null &&
+ this.transaction.IsUpdated)
+ {
+ this.transaction = null;
+ }
+ if (this.connection == null ||
+ this.connection.State != ConnectionState.Open)
+ {
+ throw new InvalidOperationException("Connection must valid and open");
+ }
+ if (this.connection.DataReader != null)
+ {
+ throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first.");
+ }
+ if (this.connection.ActiveTransaction != null &&
+ !this.connection.ActiveTransaction.IsUpdated &&
+ this.Transaction == null)
+ {
+ throw new InvalidOperationException("Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized.");
+ }
+ if (this.transaction != null &&
+ !this.connection.Equals(Transaction.Connection))
+ {
+ throw new InvalidOperationException("Command Connection is not equal to Transaction Connection");
+ }
+ if (this.commandText == String.Empty || this.commandText == null)
+ {
+ throw new InvalidOperationException ("The command text for this Command has not been set.");
+ }
+ }
+
private string parseSPCommandText()
{
***************
*** 682,713 ****
}
}
- }
- }
-
- private void checkCommand()
- {
- if (this.connection == null ||
- this.connection.State != ConnectionState.Open)
- {
- throw new InvalidOperationException("Connection must valid and open");
- }
- if (this.connection.DataReader != null)
- {
- throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first.");
- }
- if (this.connection.ActiveTransaction != null &&
- !this.connection.ActiveTransaction.IsUpdated &&
- this.Transaction == null)
- {
- throw new InvalidOperationException("Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized.");
- }
- if (this.transaction != null &&
- !this.connection.Equals(Transaction.Connection))
- {
- throw new InvalidOperationException("Command Connection is not equal to Transaction Connection");
- }
- if (this.commandText == String.Empty || this.commandText == null)
- {
- throw new InvalidOperationException ("The command text for this Command has not been set.");
}
}
--- 715,718 ----
Index: PgConnection.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PgConnection.cs 21 Nov 2003 18:04:19 -0000 1.8
--- PgConnection.cs 24 Nov 2003 16:38:58 -0000 1.9
***************
*** 191,194 ****
--- 191,195 ----
{
get { return activeTransaction; }
+ set { activeTransaction = value; }
}
Index: PgTransaction.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTransaction.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgTransaction.cs 12 Nov 2003 19:54:19 -0000 1.2
--- PgTransaction.cs 24 Nov 2003 16:38:58 -0000 1.3
***************
*** 66,69 ****
--- 66,79 ----
{
get { return isUpdated; }
+ set
+ {
+ if (connection != null &&
+ value)
+ {
+ connection.ActiveTransaction = null;
+ connection = null;
+ }
+ isUpdated = value;
+ }
}
***************
*** 79,83 ****
internal PgTransaction(PgConnection connection) : this(connection, IsolationLevel.ReadCommitted)
{
! }
internal PgTransaction(PgConnection connection, IsolationLevel isolation)
--- 89,93 ----
internal PgTransaction(PgConnection connection) : this(connection, IsolationLevel.ReadCommitted)
{
! }
internal PgTransaction(PgConnection connection, IsolationLevel isolation)
***************
*** 96,99 ****
--- 106,113 ----
}
+ #endregion
+
+ #region IDISPOSABLE_METHODS
+
public void Dispose()
{
***************
*** 118,123 ****
finally
{
! connection = null;
disposed = true;
}
}
--- 132,142 ----
finally
{
! if (connection != null)
! {
! connection.ActiveTransaction = null;
! connection = null;
! }
disposed = true;
+ isUpdated = true;
}
}
***************
*** 144,149 ****
connection.DbConnection.DB.CommitTransaction();
! isUpdated = true;
! connection = null;
}
catch (PgClientException ex)
--- 163,167 ----
connection.DbConnection.DB.CommitTransaction();
! IsUpdated = true;
}
catch (PgClientException ex)
***************
*** 168,173 ****
connection.DbConnection.DB.RollbackTransction();
! isUpdated = true;
! connection = null;
}
catch (PgClientException ex)
--- 186,190 ----
connection.DbConnection.DB.RollbackTransction();
! IsUpdated = true;
}
catch (PgClientException ex)
***************
*** 183,187 ****
connection.DbConnection.DB.BeginTransaction(isolationLevel);
! isUpdated = false;
}
catch (PgClientException ex)
--- 200,204 ----
connection.DbConnection.DB.BeginTransaction(isolationLevel);
! IsUpdated = false;
}
catch (PgClientException ex)
|
|
From: <car...@us...> - 2003-11-23 22:28:46
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv3932 Modified Files: changelog.txt Log Message: update changelog.txt Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** changelog.txt 23 Nov 2003 20:11:35 -0000 1.81 --- changelog.txt 23 Nov 2003 22:28:44 -0000 1.82 *************** *** 11,15 **** * source/NPgClient/PgStatement.cs: ! - Removed invalid case in switch, in method processDataRow. --- 11,15 ---- * source/NPgClient/PgStatement.cs: ! - Removed invalid case in switch, in method processDataRow ( Thanks to Ishpal Singh for his feedback ). *************** *** 28,32 **** * source/NPgClient/PgDbClient.cs: ! - Make SslClientStream to be public * source/NPgClient/PgDbClient.cs: --- 28,32 ---- * source/NPgClient/PgDbClient.cs: ! - Make SslClientStream to be public. * source/NPgClient/PgDbClient.cs: *************** *** 37,41 **** * source/NPgClient/PgOutputPacket.cs: ! - Make conversion of datatime parameters using Convert.ToDateTime() - Make conversion of timespan parameters using TimeSpan.Parse() --- 37,41 ---- * source/NPgClient/PgOutputPacket.cs: ! - Make conversion of datatime parameters using Convert.ToDateTime() ( Thanks to Ishpal Singh for his feedback ) - Make conversion of timespan parameters using TimeSpan.Parse() *************** *** 43,47 **** * source/PgCommand.cs: ! - Added change for try to make a correct replace of named parameters. --- 43,47 ---- * source/PgCommand.cs: ! - Added change for try to make a correct replace of named parameters ( Thanks to Ishpal Singh for his feedback ). |
|
From: <car...@us...> - 2003-11-23 20:11:38
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv10288 Modified Files: changelog.txt Log Message: * source/NPgClient/PgStatement.cs: - Removed invalid case in switch, in method processDataRow. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** changelog.txt 23 Nov 2003 13:24:52 -0000 1.80 --- changelog.txt 23 Nov 2003 20:11:35 -0000 1.81 *************** *** 9,12 **** --- 9,17 ---- - Minor changes to exception handling. + * source/NPgClient/PgStatement.cs: + + - Removed invalid case in switch, in method processDataRow. + + 2003-11-22 Carlos Guzmán Álvarez <car...@te...> |
|
From: <car...@us...> - 2003-11-23 20:10:08
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1:/tmp/cvs-serv10025 Modified Files: PgStatement.cs Log Message: * source/NPgClient/PgResponsePacket.cs: - Removed invalid case in switch, in method processDataRow. Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgStatement.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PgStatement.cs 21 Nov 2003 18:01:04 -0000 1.12 --- PgStatement.cs 23 Nov 2003 20:10:03 -0000 1.13 *************** *** 747,753 **** break; - case 0: - break; - default: values[i] = packet.ReadValue( --- 747,750 ---- |
|
From: <car...@us...> - 2003-11-23 13:24:55
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv2102 Modified Files: changelog.txt Log Message: 2003-11-23 Carlos Guzmán Álvarez <car...@te...> * source/NPgClient/PgDbClient.cs: - Minor changes to exception handling. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** changelog.txt 21 Nov 2003 21:56:39 -0000 1.79 --- changelog.txt 23 Nov 2003 13:24:52 -0000 1.80 *************** *** 3,6 **** --- 3,18 ---- + 2003-11-23 Carlos Guzmán Álvarez <car...@te...> + + * source/NPgClient/PgDbClient.cs: + + - Minor changes to exception handling. + + 2003-11-22 Carlos Guzmán Álvarez <car...@te...> + + * source/NPgClient/PgDbClient.cs: + + - Added correct processing of SSLRequest message. + 2003-11-21 Carlos Guzmán Álvarez <car...@te...> |
|
From: <car...@us...> - 2003-11-23 13:24:44
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv2065
Modified Files:
PgDbClient.cs
Log Message:
2003-11-23 Carlos Guzmán Álvarez <car...@te...>
* source/NPgClient/PgDbClient.cs:
- Minor changes to exception handling.
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** PgDbClient.cs 22 Nov 2003 14:42:08 -0000 1.37
--- PgDbClient.cs 23 Nov 2003 13:24:37 -0000 1.38
***************
*** 193,213 ****
}
}
! catch (TlsException ex)
{
! // If the exception is fatal close connection
! sslStream.Close();
!
throw new PgClientException(ex.Message);
}
catch (PgClientException ex)
{
! if (sslStream != null)
! {
! sslStream.Close();
! }
! if (networkStream != null)
! {
! networkStream.Close();
! }
throw ex;
}
--- 193,204 ----
}
}
! catch (IOException ex)
{
! detach();
throw new PgClientException(ex.Message);
}
catch (PgClientException ex)
{
! detach();
throw ex;
}
***************
*** 222,236 ****
SendData(packet.GetPacketBytes(PgFrontEndCodes.TERMINATE));
! // Close streams
! if (sslStream != null)
! {
! sslStream.Close();
! }
! if (networkStream != null)
! {
! networkStream.Close();
! }
}
! catch (TlsException ex)
{
throw new PgClientException(ex.Message);
--- 213,219 ----
SendData(packet.GetPacketBytes(PgFrontEndCodes.TERMINATE));
! detach();
}
! catch (IOException ex)
{
throw new PgClientException(ex.Message);
***************
*** 244,248 ****
internal void SendData(byte[] data)
{
! send.Write(data);
}
--- 227,238 ----
internal void SendData(byte[] data)
{
! try
! {
! send.Write(data);
! }
! catch (IOException ex)
! {
! throw ex;
! }
}
***************
*** 299,314 ****
PgResponsePacket responsePacket = null;
! char type = this.receive.ReadChar();
! int length = IPAddress.HostToNetworkOrder(this.receive.ReadInt32()) - 4;
! // Read the message data
! byte[] buffer = new byte[length];
! int received = 0;
! while (received < length)
{
! received += this.receive.Read(buffer, received, length - received);
}
- responsePacket = new PgResponsePacket(type, buffer);
- responsePacket.Encoding = Settings.Encoding;
return responsePacket;
--- 289,311 ----
PgResponsePacket responsePacket = null;
! try
! {
! char type = this.receive.ReadChar();
! int length = IPAddress.HostToNetworkOrder(this.receive.ReadInt32()) - 4;
! // Read the message data
! byte[] buffer = new byte[length];
! int received = 0;
! while (received < length)
! {
! received += this.receive.Read(buffer, received, length - received);
! }
! responsePacket = new PgResponsePacket(type, buffer);
! responsePacket.Encoding = Settings.Encoding;
! }
! catch (IOException ex)
{
! throw ex;
}
return responsePacket;
***************
*** 832,835 ****
--- 829,849 ----
this.receive = new BinaryReader(this.networkStream);
this.send = new BinaryWriter(this.networkStream);
+ }
+
+ private void detach()
+ {
+ // Close streams
+ if (sslStream != null)
+ {
+ sslStream.Close();
+ }
+ if (networkStream != null)
+ {
+ networkStream.Close();
+ }
+ if (socket != null)
+ {
+ socket.Close();
+ }
}
|
|
From: <car...@us...> - 2003-11-23 12:52:27
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv29476 Modified Files: changelog.txt Log Message: 2003-11-23 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/SslServerStream.cs: - Added new SslServerStream class with empty methods. * Mono.Security.Protocol.Tls.Handshake.Server: - New directory with class definitions of handshake message classes for the server implementation. - Class names for server handshake messages are the same as for client implementation. * Mono.Security.Protocol.Tls/SslClientStream.cs: - Throw exception in constrctors when the targetHost or the streams are invalid. - Added correct exception throwing in read/write methods. - Added initial implementation of BeginRead and EndRead methods. * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs: - Added new constructor. - Changed UpdateSession() method to Update() and replaced method name in derived classes. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/changelog.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** changelog.txt 22 Nov 2003 14:44:40 -0000 1.14 --- changelog.txt 23 Nov 2003 12:52:24 -0000 1.15 *************** *** 2,5 **** --- 2,36 ---- --------------- ----------- ----------------------------------------- + 2003-11-23 Carlos Guzmán Álvarez <car...@te...> + + * Mono.Security.Protocol.Tls/SslServerStream.cs: + + - Added new SslServerStream class with empty methods. + + * Mono.Security.Protocol.Tls.Handshake.Server: + + - New directory with class definitions of handshake message classes + for the server implementation. + + - Class names for server handshake messages are the same as for + client implementation. + + * Mono.Security.Protocol.Tls/SslClientStream.cs: + + - Throw exception in constrctors when the targetHost or the streams are invalid. + + - Added correct exception throwing in read/write methods. + + - Added initial implementation of BeginRead and EndRead methods. + + * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs: + + - Added new constructor. + + - Changed UpdateSession() method to Update() and replaced method + name in derived classes. + + ------------------------- Updated Mono Sources ---------------------- + 2003-11-22 Carlos Guzmán Álvarez <car...@te...> |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts
In directory sc8-pr-cvs1:/tmp/cvs-serv29386
Modified Files:
TlsAlert.cs TlsCloseNotifyAlert.cs
Log Message:
2003-11-23 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/SslServerStream.cs:
- Added new SslServerStream class with empty methods.
* Mono.Security.Protocol.Tls.Handshake.Server:
- New directory with class definitions of handshake message classes
for the server implementation.
- Class names for server handshake messages are the same as for
client implementation.
* Mono.Security.Protocol.Tls/SslClientStream.cs:
- Throw exception in constrctors when the targetHost or the streams are invalid.
- Added correct exception throwing in read/write methods.
- Added initial implementation of BeginRead and EndRead methods.
* Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs:
- Added new constructor.
- Changed UpdateSession() method to Update() and replaced method
name in derived classes.
Index: TlsAlert.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsAlert.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TlsAlert.cs 14 Nov 2003 13:41:20 -0000 1.5
--- TlsAlert.cs 23 Nov 2003 12:51:54 -0000 1.6
***************
*** 101,105 ****
#region ABSTRACT_METHODS
! public abstract void UpdateSession();
#endregion
--- 101,105 ----
#region ABSTRACT_METHODS
! public abstract void Update();
#endregion
Index: TlsCloseNotifyAlert.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Alerts/TlsCloseNotifyAlert.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TlsCloseNotifyAlert.cs 14 Nov 2003 13:41:20 -0000 1.2
--- TlsCloseNotifyAlert.cs 23 Nov 2003 12:51:54 -0000 1.3
***************
*** 37,41 ****
}
! public override void UpdateSession()
{
this.Context.ConnectionEnd = true;
--- 37,41 ----
}
! public override void Update()
{
this.Context.ConnectionEnd = true;
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1:/tmp/cvs-serv29334 Added Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHello.cs TlsClientKeyExchange.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHello.cs TlsServerHelloDone.cs TlsServerKeyExchange.cs Log Message: 2003-11-23 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/SslServerStream.cs: - Added new SslServerStream class with empty methods. * Mono.Security.Protocol.Tls.Handshake.Server: - New directory with class definitions of handshake message classes for the server implementation. - Class names for server handshake messages are the same as for client implementation. * Mono.Security.Protocol.Tls/SslClientStream.cs: - Throw exception in constrctors when the targetHost or the streams are invalid. - Added correct exception throwing in read/write methods. - Added initial implementation of BeginRead and EndRead methods. * Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs: - Added new constructor. - Changed UpdateSession() method to Update() and replaced method name in derived classes. --- NEW FILE: TlsClientCertificate.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientCertificateVerify.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientFinished.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientHello.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsClientKeyExchange.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerCertificate.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerCertificateRequest.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerFinished.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerHello.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerHelloDone.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: TlsServerKeyExchange.cs --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1:/tmp/cvs-serv29220/Mono.Security.Protocol.Tls.Handshake.Server Log Message: Directory /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/Mono.Security.Protocol.Tls.Handshake.Server added to the repository |
|
From: <car...@us...> - 2003-11-23 12:50:31
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake
In directory sc8-pr-cvs1:/tmp/cvs-serv29178
Modified Files:
TlsHandshakeMessage.cs
Log Message:
2003-11-23 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/SslServerStream.cs:
- Added new SslServerStream class with empty methods.
* Mono.Security.Protocol.Tls.Handshake.Server:
- New directory with class definitions of handshake message classes
for the server implementation.
- Class names for server handshake messages are the same as for
client implementation.
* Mono.Security.Protocol.Tls/SslClientStream.cs:
- Throw exception in constrctors when the targetHost or the streams are invalid.
- Added correct exception throwing in read/write methods.
- Added initial implementation of BeginRead and EndRead methods.
* Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs:
- Added new constructor.
- Changed UpdateSession() method to Update() and replaced method
name in derived classes.
Index: TlsHandshakeMessage.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** TlsHandshakeMessage.cs 14 Nov 2003 13:42:26 -0000 1.12
--- TlsHandshakeMessage.cs 23 Nov 2003 12:50:26 -0000 1.13
***************
*** 61,64 ****
--- 61,71 ----
public TlsHandshakeMessage(
TlsContext context,
+ TlsHandshakeType handshakeType)
+ : this(context, handshakeType, TlsContentType.Handshake)
+ {
+ }
+
+ public TlsHandshakeMessage(
+ TlsContext context,
TlsHandshakeType handshakeType,
TlsContentType contentType) : base()
***************
*** 110,114 ****
}
! public virtual void UpdateSession()
{
if (CanWrite)
--- 117,121 ----
}
! public virtual void Update()
{
if (CanWrite)
|
|
From: <car...@us...> - 2003-11-23 12:50:12
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls
In directory sc8-pr-cvs1:/tmp/cvs-serv29141
Modified Files:
SslClientStream.cs
Added Files:
SslServerStream.cs
Log Message:
2003-11-23 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/SslServerStream.cs:
- Added new SslServerStream class with empty methods.
* Mono.Security.Protocol.Tls.Handshake.Server:
- New directory with class definitions of handshake message classes
for the server implementation.
- Class names for server handshake messages are the same as for
client implementation.
* Mono.Security.Protocol.Tls/SslClientStream.cs:
- Throw exception in constrctors when the targetHost or the streams are invalid.
- Added correct exception throwing in read/write methods.
- Added initial implementation of BeginRead and EndRead methods.
* Mono.Security.Protocol.Tls.Handshake/TlsHandshakeMessage.cs:
- Added new constructor.
- Changed UpdateSession() method to Update() and replaced method
name in derived classes.
--- NEW FILE: SslServerStream.cs ---
(This appears to be a binary file; contents omitted.)
Index: SslClientStream.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/SslClientStream.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SslClientStream.cs 21 Nov 2003 12:24:26 -0000 1.5
--- SslClientStream.cs 23 Nov 2003 12:50:08 -0000 1.6
***************
*** 99,103 ****
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
-
}
--- 99,102 ----
***************
*** 195,253 ****
#endregion
- #region DESTRUCTOR
-
- ~SslClientStream()
- {
- this.Dispose(false);
- }
-
- #endregion
-
- #region IDISPOSABLE
-
- void IDisposable.Dispose()
- {
- this.Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if (!disposed)
- {
- if (disposing)
- {
- if (this.innerStream != null)
- {
- // Write close notify
- TlsCloseNotifyAlert alert = new TlsCloseNotifyAlert(this.context);
- this.SendAlert(alert);
-
- if (this.ownsStream)
- {
- // Close inner stream
- this.innerStream.Close();
- }
- }
- this.ownsStream = false;
- this.innerStream = null;
- if (this.ClientCertSelection != null)
- {
- this.ClientCertSelection -= this.clientCertSelectionDelegate;
- }
- if (this.ServerCertValidation != null)
- {
- this.ServerCertValidation -= this.serverCertValidationDelegate;
- }
- this.serverCertValidationDelegate = null;
- this.clientCertSelectionDelegate = null;
- }
-
- disposed = true;
- }
- }
-
- #endregion
-
#region CONSTRUCTORS
--- 194,197 ----
***************
*** 292,295 ****
--- 236,252 ----
X509CertificateCollection clientCertificates)
{
+ if (stream == null)
+ {
+ throw new ArgumentNullException("stream is null.");
+ }
+ if (!stream.CanRead || !stream.CanWrite)
+ {
+ throw new ArgumentNullException("stream is not both readable and writable.");
+ }
+ if (targetHost == null || targetHost.Length == 0)
+ {
+ throw new ArgumentNullException("targetHost is null or an empty string.");
+ }
+
this.context = new TlsContext(
this,
***************
*** 304,307 ****
--- 261,319 ----
#endregion
+ #region DESTRUCTOR
+
+ ~SslClientStream()
+ {
+ this.Dispose(false);
+ }
+
+ #endregion
+
+ #region IDISPOSABLE
+
+ void IDisposable.Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!this.disposed)
+ {
+ if (disposing)
+ {
+ if (this.innerStream != null)
+ {
+ // Write close notify
+ TlsCloseNotifyAlert alert = new TlsCloseNotifyAlert(this.context);
+ this.SendAlert(alert);
+
+ if (this.ownsStream)
+ {
+ // Close inner stream
+ this.innerStream.Close();
+ }
+ }
+ this.ownsStream = false;
+ this.innerStream = null;
+ if (this.ClientCertSelection != null)
+ {
+ this.ClientCertSelection -= this.clientCertSelectionDelegate;
+ }
+ if (this.ServerCertValidation != null)
+ {
+ this.ServerCertValidation -= this.serverCertValidationDelegate;
+ }
+ this.serverCertValidationDelegate = null;
+ this.clientCertSelectionDelegate = null;
+ }
+
+ this.disposed = true;
+ }
+ }
+
+ #endregion
+
#region METHODS
***************
*** 313,317 ****
object state)
{
! throw new NotSupportedException();
}
--- 325,371 ----
object state)
{
! if (this.disposed)
! {
! throw new ObjectDisposedException("The SslClientStream is closed.");
! }
!
! #warning "Throw exception: A read operation is already in progress."
!
! if (buffer == null)
! {
! throw new ArgumentNullException("buffer is a null reference.");
! }
! if (offset < 0)
! {
! throw new ArgumentOutOfRangeException("offset is less than 0.");
! }
! if (offset > buffer.Length)
! {
! throw new ArgumentOutOfRangeException("offset is greater than the length of buffer.");
! }
! if (count < 0)
! {
! throw new ArgumentOutOfRangeException("count is less than 0.");
! }
! if (count > (buffer.Length - offset))
! {
! throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
! }
!
! 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);
! }
}
***************
*** 328,332 ****
public override int EndRead(IAsyncResult asyncResult)
{
! throw new NotSupportedException();
}
--- 382,406 ----
public override int EndRead(IAsyncResult asyncResult)
{
! if (this.disposed)
! {
! throw new ObjectDisposedException("The SslClientStream is closed.");
! }
! if (asyncResult == null)
! {
! throw new ArgumentNullException("asyncResult is null or was not obtained by calling BeginRead.");
! }
!
! try
! {
! int readed = this.innerStream.EndRead(asyncResult);
!
! #warning "Decrypt readed data here"
!
! 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);
! }
}
***************
*** 345,349 ****
if (this.disposed)
{
! throw new ObjectDisposedException("The NetworkStream is closed.");
}
--- 419,423 ----
if (this.disposed)
{
! throw new ObjectDisposedException("The SslClientStream is closed.");
}
***************
*** 356,361 ****
}
! public override int Read(byte[] buffer, int offset, int size)
{
if (!this.context.HandshakeFinished)
{
--- 430,442 ----
}
! public override int Read(byte[] buffer, int offset, int count)
{
+ if (this.disposed)
+ {
+ throw new ObjectDisposedException("The SslClientStream is closed.");
+ }
+
+ #warning "Throw exception: A read operation is already in progress."
+
if (!this.context.HandshakeFinished)
{
***************
*** 376,390 ****
throw new ArgumentOutOfRangeException("offset is greater than the length of buffer.");
}
! if (size < 0)
! {
! throw new ArgumentOutOfRangeException("size is less than 0.");
! }
! if (size > (buffer.Length - offset))
{
! throw new ArgumentOutOfRangeException("size is less than the length of buffer minus the value of the offset parameter.");
}
! if (this.disposed)
{
! throw new ObjectDisposedException("The NetworkStream is closed.");
}
--- 457,467 ----
throw new ArgumentOutOfRangeException("offset is greater than the length of buffer.");
}
! if (count < 0)
{
! throw new ArgumentOutOfRangeException("count is less than 0.");
}
! if (count > (buffer.Length - offset))
{
! throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
***************
*** 400,404 ****
// Check if we have space in the middle buffer
// if not Read next TLS record and update the inputBuffer
! while ((this.inputBuffer.Length - this.inputBuffer.Position) < size)
{
// Read next record and write it into the inputBuffer
--- 477,481 ----
// Check if we have space in the middle buffer
// if not Read next TLS record and update the inputBuffer
! while ((this.inputBuffer.Length - this.inputBuffer.Position) < count)
{
// Read next record and write it into the inputBuffer
***************
*** 415,433 ****
this.inputBuffer.Seek(position, SeekOrigin.Begin);
}
-
- #warning "Think on how to solve this"
- /*
- if (base.Available == 0)
- {
- break;
- }
- */
}
! return this.inputBuffer.Read(buffer, offset, size);
}
catch (TlsException ex)
{
! throw ex;
}
catch (Exception ex)
--- 492,502 ----
this.inputBuffer.Seek(position, SeekOrigin.Begin);
}
}
! return this.inputBuffer.Read(buffer, offset, count);
}
catch (TlsException ex)
{
! throw new IOException("The authentication or decryption has failed.", ex);
}
catch (Exception ex)
***************
*** 452,457 ****
}
! public override void Write(byte[] buffer, int offset, int size)
{
if (!this.context.HandshakeFinished)
{
--- 521,533 ----
}
! public override void Write(byte[] buffer, int offset, int count)
{
+ if (this.disposed)
+ {
+ throw new ObjectDisposedException("The SslClientStream is closed.");
+ }
+
+ #warning "Throw exception: A write operation is already in progress."
+
if (!this.context.HandshakeFinished)
{
***************
*** 472,486 ****
throw new ArgumentOutOfRangeException("offset is greater than the length of buffer.");
}
! if (size < 0)
! {
! throw new ArgumentOutOfRangeException("size is less than 0.");
! }
! if (size > (buffer.Length - offset))
{
! throw new ArgumentOutOfRangeException("size is less than the length of buffer minus the value of the offset parameter.");
}
! if (disposed)
{
! throw new ObjectDisposedException("The NetworkStream is closed.");
}
--- 548,558 ----
throw new ArgumentOutOfRangeException("offset is greater than the length of buffer.");
}
! if (count < 0)
{
! throw new ArgumentOutOfRangeException("count is less than 0.");
}
! if (count > (buffer.Length - offset))
{
! throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter.");
}
***************
*** 488,493 ****
{
// Send the buffer as a TLS record
! byte[] recordData = new byte[size];
! System.Array.Copy(buffer, offset, recordData, 0, size);
this.sendRecord(TlsContentType.ApplicationData, recordData);
--- 560,565 ----
{
// Send the buffer as a TLS record
! byte[] recordData = new byte[count];
! System.Array.Copy(buffer, offset, recordData, 0, count);
this.sendRecord(TlsContentType.ApplicationData, recordData);
***************
*** 495,499 ****
catch (TlsException ex)
{
! throw ex;
}
catch (Exception ex)
--- 567,571 ----
catch (TlsException ex)
{
! throw new IOException("The authentication or decryption has failed.", ex);
}
catch (Exception ex)
***************
*** 595,599 ****
// Update session
! alert.UpdateSession();
// Reset message contents
--- 667,671 ----
// Update session
! alert.Update();
// Reset message contents
***************
*** 609,613 ****
// Update session
! msg.UpdateSession();
// Reset message contents
--- 681,685 ----
// Update session
! msg.Update();
// Reset message contents
***************
*** 787,791 ****
if (message != null)
{
! message.UpdateSession();
}
}
--- 859,863 ----
if (message != null)
{
! message.Update();
}
}
|
|
From: <car...@us...> - 2003-11-22 14:45:19
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1:/tmp/cvs-serv29801 Modified Files: changelog.txt Log Message: 2003-11-22 Carlos Guzmán Álvarez <car...@te...> * Mono.Security.Protocol.Tls/CipherSuite.cs: - Better handling of padding bytes on message encryption. * Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs: - Uncommented AES ciphersuites. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/changelog.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** changelog.txt 21 Nov 2003 12:25:08 -0000 1.13 --- changelog.txt 22 Nov 2003 14:44:40 -0000 1.14 *************** *** 2,5 **** --- 2,16 ---- --------------- ----------- ----------------------------------------- + 2003-11-22 Carlos Guzmán Álvarez <car...@te...> + + * Mono.Security.Protocol.Tls/CipherSuite.cs: + + - Better handling of padding bytes on message encryption. + + * Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs: + + - Uncommented AES ciphersuites. + + 2003-11-21 Carlos Guzmán Álvarez <car...@te...> |
|
From: <car...@us...> - 2003-11-22 14:44:35
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls
In directory sc8-pr-cvs1:/tmp/cvs-serv29725
Modified Files:
CipherSuite.cs TlsCipherSuiteFactory.cs
Log Message:
2003-11-22 Carlos Guzmán Álvarez <car...@te...>
* Mono.Security.Protocol.Tls/CipherSuite.cs:
- Better handling of padding bytes on message encryption.
* Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs:
- Uncommented AES ciphersuites.
Index: CipherSuite.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/CipherSuite.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** CipherSuite.cs 13 Nov 2003 09:21:51 -0000 1.9
--- CipherSuite.cs 22 Nov 2003 14:43:51 -0000 1.10
***************
*** 285,290 ****
{
// Calculate padding_length
! int fragmentLength = fragment.Length + mac.Length + 1;
! int paddingLength = this.blockSize - fragmentLength % this.blockSize;
if (paddingLength == this.blockSize)
{
--- 285,290 ----
{
// Calculate padding_length
! byte fragmentLength = (byte)(fragment.Length + mac.Length + 1);
! byte paddingLength = (byte)(this.blockSize - fragmentLength % this.blockSize);
if (paddingLength == this.blockSize)
{
***************
*** 293,303 ****
// Write padding length byte
for (int i = 0; i < (paddingLength + 1); i++)
{
! cs.WriteByte((byte)paddingLength);
}
}
! // cs.FlushFinalBlock();
! cs.Close();
return ms.ToArray();
--- 293,306 ----
// Write padding length byte
+ byte[] padding = new byte[(paddingLength + 1)];
for (int i = 0; i < (paddingLength + 1); i++)
{
! padding[i] = paddingLength;
}
+
+ cs.Write(padding, 0, padding.Length);
}
! cs.FlushFinalBlock();
! cs.Close();
return ms.ToArray();
***************
*** 317,334 ****
{
// Calculate padding_length
! paddingLength = buffer[buffer.Length - 1];
!
! /* Review this that is valid way for TLS1 but not for SSL3
! for (int i = (buffer.Length - 1); i > (buffer.Length - (paddingLength + 1)); i--)
! {
! if (buffer[i] != paddingLength)
! {
! paddingLength = 0;
! break;
! }
! }
! */
!
! fragmentSize = (buffer.Length - (paddingLength + 1)) - this.HashSize;
}
else
--- 320,325 ----
{
// Calculate padding_length
! paddingLength = buffer[buffer.Length - 1];
! fragmentSize = (buffer.Length - (paddingLength + 1)) - this.HashSize;
}
else
Index: TlsCipherSuiteFactory.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security.Protocol.Tls/Mono.Security.Protocol.Tls/TlsCipherSuiteFactory.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TlsCipherSuiteFactory.cs 14 Nov 2003 13:40:40 -0000 1.11
--- TlsCipherSuiteFactory.cs 22 Nov 2003 14:43:51 -0000 1.12
***************
*** 51,56 ****
// Supported ciphers
! // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16);
! // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16);
scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8);
scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8);
--- 51,56 ----
// Supported ciphers
! scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16);
! scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16);
scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8);
scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8);
|
|
From: <car...@us...> - 2003-11-22 14:42:56
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv29543
Modified Files:
PgDbClient.cs
Log Message:
2003-11-22 Carlos Guzmán Álvarez <car...@te...>
* source/NPgClient/PgDbClient.cs:
- Added correct processing of SSLRequest message.
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** PgDbClient.cs 21 Nov 2003 23:15:58 -0000 1.36
--- PgDbClient.cs 22 Nov 2003 14:42:08 -0000 1.37
***************
*** 251,255 ****
#region RESPONSE_METHODS
! public PgResponsePacket ReceiveResponsePacket(params bool[] sslRequest)
{
PgResponsePacket responsePacket = null;
--- 251,255 ----
#region RESPONSE_METHODS
! public PgResponsePacket ReceiveResponsePacket()
{
PgResponsePacket responsePacket = null;
***************
*** 257,267 ****
lock (this)
{
! bool isSslRequest = false;
! if (sslRequest.Length != 0)
! {
! isSslRequest = sslRequest[0];
! }
!
! responsePacket = this.receiveStandardPacket(isSslRequest);
switch (responsePacket.Message)
--- 257,261 ----
lock (this)
{
! responsePacket = this.receiveStandardPacket();
switch (responsePacket.Message)
***************
*** 285,289 ****
this.InfoMessage(this, new PgClientMessageEventArgs(ex));
}
! break;
case PgBackendCodes.NOTIFICATION_RESPONSE:
--- 279,283 ----
this.InfoMessage(this, new PgClientMessageEventArgs(ex));
}
! break;
case PgBackendCodes.NOTIFICATION_RESPONSE:
***************
*** 291,298 ****
processNotificationResponse(responsePacket);
}
! break;
default:
! break;
}
}
--- 285,292 ----
processNotificationResponse(responsePacket);
}
! break;
default:
! break;
}
}
***************
*** 301,329 ****
}
! private PgResponsePacket receiveStandardPacket(bool isSslRequest)
{
PgResponsePacket responsePacket = null;
- int length = 0;
char type = this.receive.ReadChar();
! if (!isSslRequest)
! {
! length = IPAddress.HostToNetworkOrder(this.receive.ReadInt32()) - 4;
! }
! if (isSslRequest || length == 0)
! {
! responsePacket = new PgResponsePacket(type, new byte[0]{});
! }
! else
{
! // Read the message data
! byte[] buffer = new byte[length];
! int received = 0;
! while (received < length)
! {
! received += this.receive.Read(buffer, received, length - received);
! }
! responsePacket = new PgResponsePacket(type, buffer);
}
responsePacket.Encoding = Settings.Encoding;
--- 295,313 ----
}
! private PgResponsePacket receiveStandardPacket()
{
PgResponsePacket responsePacket = null;
char type = this.receive.ReadChar();
! int length = IPAddress.HostToNetworkOrder(this.receive.ReadInt32()) - 4;
!
! // Read the message data
! byte[] buffer = new byte[length];
! int received = 0;
! while (received < length)
{
! received += this.receive.Read(buffer, received, length - received);
}
+ responsePacket = new PgResponsePacket(type, buffer);
responsePacket.Encoding = Settings.Encoding;
***************
*** 652,658 ****
// Receive server response
! PgResponsePacket response = ReceiveResponsePacket(true);
! switch (response.Message)
{
case 'S':
--- 636,642 ----
// Receive server response
! char sslSupport = Convert.ToChar(this.networkStream.ReadByte());
! switch (sslSupport)
{
case 'S':
|
|
From: <car...@us...> - 2003-11-21 23:16:01
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv6717
Modified Files:
PgDbClient.cs
Log Message:
Finish read before raise exception in Sync method.
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** PgDbClient.cs 21 Nov 2003 18:01:04 -0000 1.35
--- PgDbClient.cs 21 Nov 2003 23:15:58 -0000 1.36
***************
*** 601,604 ****
--- 601,611 ----
catch (Exception ex)
{
+ PgResponsePacket response = new PgResponsePacket();
+ while (response.Message != PgBackendCodes.READY_FOR_QUERY)
+ {
+ response = ReceiveResponsePacket();
+ processResponsePacket(response);
+ }
+
throw ex;
}
|
|
From: <car...@us...> - 2003-11-21 21:56:42
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1:/tmp/cvs-serv24291 Modified Files: changelog.txt Log Message: * source/PgCommand.cs: - Added change for try to make a correct replace of named parameters. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** changelog.txt 21 Nov 2003 18:04:37 -0000 1.78 --- changelog.txt 21 Nov 2003 21:56:39 -0000 1.79 *************** *** 24,27 **** --- 24,31 ---- - Make conversion of timespan parameters using TimeSpan.Parse() + * source/PgCommand.cs: + + - Added change for try to make a correct replace of named parameters. + 2003-11-20 Carlos Guzmán Álvarez <car...@te...> |
|
From: <car...@us...> - 2003-11-21 21:55:57
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv24163
Modified Files:
PgCommand.cs
Log Message:
* source/PgCommand.cs:
- Added change for try to make a correct replace of named parameters.
Index: PgCommand.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** PgCommand.cs 21 Nov 2003 18:04:19 -0000 1.16
--- PgCommand.cs 21 Nov 2003 21:55:54 -0000 1.17
***************
*** 49,52 ****
--- 49,54 ----
private Regex search;
private MatchCollection namedParameters;
+ private int matchIndex;
+ private Hashtable matchReplaces;
private PgStatement statement;
***************
*** 219,223 ****
this.designTimeVisible = true;
this.parameters = new PgParameterCollection();
! this.search = new Regex("(@([a-zA-Z-$][a-zA-Z0-9_$]*))");
GC.SuppressFinalize(this);
--- 221,225 ----
this.designTimeVisible = true;
this.parameters = new PgParameterCollection();
! this.search = new Regex("(@[a-zA-Z-$][a-zA-Z0-9_$]*)");
GC.SuppressFinalize(this);
***************
*** 623,633 ****
if (namedParameters.Count != 0)
{
! for (int i = 0; i < namedParameters.Count; i++)
! {
! sql = search.Replace(sql, @"$$" + (i + 1).ToString(), 1);
! }
}
return sql;
}
--- 625,649 ----
if (namedParameters.Count != 0)
{
! matchIndex = 0;
! matchReplaces = new Hashtable();
!
! sql = search.Replace(
! sql,
! new MatchEvaluator(matchEvaluator));
!
! matchReplaces.Clear();
}
return sql;
+ }
+
+ private string matchEvaluator(Match match)
+ {
+ if (!matchReplaces.ContainsKey(match.Value))
+ {
+ matchReplaces.Add(match.Value, "$" + ((matchIndex++) + 1).ToString());
+ }
+
+ return matchReplaces[match.Value].ToString();
}
|