pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 17)
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: Carlos Guzm?n ?l. <car...@us...> - 2004-05-06 08:17:24
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31977 Modified Files: PgDbClient.cs Log Message: 2004-05-06 Carlos Guzman Alvarez <car...@te...> * PostgreSql/Data/PgSqlClient/NPgClient/PgDbClient.cs: - Changes for patch (#948340) ( Disable the nagle algorithm on socket setup ) Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** PgDbClient.cs 10 Apr 2004 20:16:07 -0000 1.47 --- PgDbClient.cs 6 May 2004 08:17:16 -0000 1.48 *************** *** 861,864 **** --- 861,874 ---- SocketOptionName.SendBuffer, settings.PacketSize); + + #if (!LINUX) + // Disables the Nagle algorithm for send coalescing. + // This seems to be not supported in Linux (using mono::) + this.socket.SetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.NoDelay, + 1); + #endif + // Make the socket to connect to the Server this.socket.Connect(EPhost); |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-05-03 20:31:34
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25029 Modified Files: changelog.txt Log Message: 2004-05-03 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PGSqlClient/PgCommand.cs: - Clenaup. * PostgreSql.Data.PGSqlClient/NPgClient/PgOutputPacket.cs: - Fix bytea field handling. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** changelog.txt 2 May 2004 14:22:53 -0000 1.114 --- changelog.txt 3 May 2004 20:31:25 -0000 1.115 *************** *** 2,5 **** --- 2,16 ---- ------------------------------------------------------- + 2004-05-03 Carlos Guzman Alvarez <car...@te...> + + * PostgreSql.Data.PGSqlClient/PgCommand.cs: + + - Clenaup. + + + * PostgreSql.Data.PGSqlClient/NPgClient/PgOutputPacket.cs: + + - Fix bytea field handling. + 2004-05-02 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-05-03 20:31:06
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24734 Modified Files: PgCommand.cs Log Message: 2004-05-03 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PGSqlClient/PgCommand.cs: - Clenaup. Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** PgCommand.cs 2 May 2004 14:21:10 -0000 1.35 --- PgCommand.cs 3 May 2004 20:30:15 -0000 1.36 *************** *** 116,128 **** set { ! if (this.connection != null && ! this.connection.DataReader != null) { throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); } if (this.transaction != null && !this.transaction.IsUpdated) { throw new InvalidOperationException("The Connection property was changed while a transaction was in progress."); } if (this.connection != value) { --- 116,131 ---- set { ! if (this.connection != null && this.connection.DataReader != null) { throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); } + + /* if (this.transaction != null && !this.transaction.IsUpdated) { throw new InvalidOperationException("The Connection property was changed while a transaction was in progress."); } + */ + if (this.connection != value) { *************** *** 174,179 **** set { ! if (this.connection != null && ! this.connection.DataReader != null) { throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); --- 177,181 ---- set { ! if (this.connection != null && this.connection.DataReader != null) { throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-05-03 20:29:44
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24494 Modified Files: PgOutputPacket.cs Log Message: 2004-05-03 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PGSqlClient/NPgClient/PgOutputPacket.cs: - Fix bytea field handling. Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PgOutputPacket.cs 10 Apr 2004 20:16:07 -0000 1.24 --- PgOutputPacket.cs 3 May 2004 20:29:36 -0000 1.25 *************** *** 257,262 **** else { ! if (parameter.DataType.DataType == PgDataType.Binary || ! parameter.DataType.DataType == PgDataType.Array || parameter.DataType.DataType == PgDataType.Vector) { --- 257,261 ---- else { ! if (parameter.DataType.DataType == PgDataType.Array || parameter.DataType.DataType == PgDataType.Vector) { |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-05-02 14:23:01
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20383 Modified Files: changelog.txt Log Message: 2004-05-02 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PGSqlClient/PgCommand.cs: - Changes on named parameters support. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** changelog.txt 26 Apr 2004 09:21:42 -0000 1.113 --- changelog.txt 2 May 2004 14:22:53 -0000 1.114 *************** *** 2,5 **** --- 2,10 ---- ------------------------------------------------------- + 2004-05-02 Carlos Guzman Alvarez <car...@te...> + + * PostgreSql.Data.PGSqlClient/PgCommand.cs: + + - Changes on named parameters support. 2004-04-26 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-05-02 14:21:22
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20101 Modified Files: PgCommand.cs Log Message: Changes on implicit transaction support Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** PgCommand.cs 10 Apr 2004 20:15:32 -0000 1.34 --- PgCommand.cs 2 May 2004 14:21:10 -0000 1.35 *************** *** 467,471 **** if (this.commandType == CommandType.StoredProcedure) { ! this.commands[actualCommand] = parseSPCommandText(); } --- 467,471 ---- if (this.commandType == CommandType.StoredProcedure) { ! this.commands[actualCommand] = this.buildStoredProcedureSql(); } *************** *** 600,610 **** 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"); --- 600,608 ---- 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"); *************** *** 620,629 **** 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."); --- 618,626 ---- 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 == null || this.commandText.Length == 0) { throw new InvalidOperationException ("The command text for this Command has not been set."); *************** *** 631,637 **** } ! private string parseSPCommandText() { ! string result = CommandText; if (!commandText.Trim().ToLower().StartsWith("select ")) --- 628,634 ---- } ! private string buildStoredProcedureSql() { ! string commandText = this.commands[actualCommand]; if (!commandText.Trim().ToLower().StartsWith("select ")) *************** *** 640,644 **** // Append the stored proc parameter name ! paramsText.Append(CommandText); paramsText.Append("("); --- 637,641 ---- // Append the stored proc parameter name ! paramsText.Append(commandText); paramsText.Append("("); *************** *** 661,668 **** paramsText.Replace(",)", ")"); ! result = "select * from " + paramsText.ToString(); } ! return result; } --- 658,665 ---- paramsText.Replace(",)", ")"); ! commandText = "select * from " + paramsText.ToString(); } ! return commandText; } *************** *** 733,752 **** for (int i = 0; i < this.statement.Parameters.Length; i++) { ! string parameterName = parameters[i].ParameterName; ! if (this.namedParameters.Count != 0) { ! try ! { ! parameterName = this.namedParameters[i].Trim(); ! } ! catch ! { ! parameterName = this.parameters[i].ParameterName; ! } } - int index = this.parameters.IndexOf(parameterName); - if (this.parameters[index].Direction == ParameterDirection.Input || this.parameters[index].Direction == ParameterDirection.InputOutput) --- 730,740 ---- for (int i = 0; i < this.statement.Parameters.Length; i++) { ! int index = i; ! if (this.namedParameters.Count > 0) { ! index = this.parameters.IndexOf(this.namedParameters[i]); } if (this.parameters[index].Direction == ParameterDirection.Input || this.parameters[index].Direction == ParameterDirection.InputOutput) |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-30 11:58:23
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21683 Modified Files: ServerRecordProtocol.cs Log Message: Fixed issue Index: ServerRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ServerRecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.6 --- ServerRecordProtocol.cs 30 Apr 2004 11:58:14 -0000 1.7 *************** *** 50,53 **** --- 50,54 ---- // Create the record message HandshakeMessage msg = this.createServerHandshakeMessage(type); + msg.Process(); // Write record |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-30 11:56:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21326 Modified Files: ClientRecordProtocol.cs Log Message: Fixed issue Index: ClientRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClientRecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.9 --- ClientRecordProtocol.cs 30 Apr 2004 11:56:15 -0000 1.10 *************** *** 48,54 **** public override void SendRecord(HandshakeType type) { ! // Create the record message HandshakeMessage msg = this.createClientHandshakeMessage(type); ! DebugHelper.WriteLine(">>>> Write handshake record ({0}|{1})", context.Protocol, msg.ContentType); --- 48,55 ---- public override void SendRecord(HandshakeType type) { ! // Create and process the record message HandshakeMessage msg = this.createClientHandshakeMessage(type); ! msg.Process(); ! DebugHelper.WriteLine(">>>> Write handshake record ({0}|{1})", context.Protocol, msg.ContentType); |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-26 09:21:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27135 Modified Files: changelog.txt Log Message: 2004-04-26 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteCollection.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/SecurityCompressionType.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Changes for fix FxCop Rules. * Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs: - Changes for fix FxCop Rules. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** changelog.txt 10 Apr 2004 20:16:31 -0000 1.112 --- changelog.txt 26 Apr 2004 09:21:42 -0000 1.113 *************** *** 2,5 **** --- 2,27 ---- ------------------------------------------------------- + + 2004-04-26 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/Alert.cs: + * Mono.Security.Protocol.Tls/CipherSuite.cs: + * Mono.Security.Protocol.Tls/CipherSuiteCollection.cs: + * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: + * Mono.Security.Protocol.Tls/Context.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Protocol.Tls/SecurityCompressionType.cs: + * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: + * Mono.Security.Protocol.Tls/SslServerStream.cs: + * Mono.Security.Protocol.Tls/TlsClientSettings.cs: + + - Changes for fix FxCop Rules. + + * Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs: + + - Changes for fix FxCop Rules. + + + 2004-04-10 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-26 09:21:10
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26993 Modified Files: changelog.txt Log Message: 2004-04-26 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteCollection.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/SecurityCompressionType.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Changes for fix FxCop Rules. * Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs: - Changes for fix FxCop Rules. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** changelog.txt 21 Apr 2004 12:59:45 -0000 1.28 --- changelog.txt 26 Apr 2004 09:21:01 -0000 1.29 *************** *** 3,6 **** --- 3,25 ---- + 2004-04-26 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/Alert.cs: + * Mono.Security.Protocol.Tls/CipherSuite.cs: + * Mono.Security.Protocol.Tls/CipherSuiteCollection.cs: + * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: + * Mono.Security.Protocol.Tls/Context.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Protocol.Tls/SecurityCompressionType.cs: + * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: + * Mono.Security.Protocol.Tls/SslServerStream.cs: + * Mono.Security.Protocol.Tls/TlsClientSettings.cs: + + - Changes for fix FxCop Rules. + + * Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs: + + - Changes for fix FxCop Rules. + 2004-04-22 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-26 09:20:03
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26771 Modified Files: HandshakeMessage.cs Log Message: * Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs: - Changes for fix FxCop Rules. Index: HandshakeMessage.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HandshakeMessage.cs 4 Mar 2004 15:38:03 -0000 1.2 --- HandshakeMessage.cs 26 Apr 2004 09:19:39 -0000 1.3 *************** *** 73,79 **** this.handshakeType = handshakeType; this.contentType = contentType; - - // Process message - this.process(); } --- 73,76 ---- *************** *** 81,91 **** Context context, HandshakeType handshakeType, ! byte[] data) : base(data) { this.context = context; ! this.handshakeType = handshakeType; ! ! // Process message ! this.process(); } --- 78,85 ---- Context context, HandshakeType handshakeType, ! byte[] data) : base(data) { this.context = context; ! this.handshakeType = handshakeType; } *************** *** 102,106 **** #region Methods ! private void process() { switch (this.Context.SecurityProtocol) --- 96,100 ---- #region Methods ! public void Process() { switch (this.Context.SecurityProtocol) |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-26 09:18:54
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26547 Modified Files: Alert.cs CipherSuite.cs CipherSuiteCollection.cs ClientRecordProtocol.cs Context.cs RecordProtocol.cs SecurityCompressionType.cs ServerRecordProtocol.cs SslServerStream.cs TlsClientSettings.cs Log Message: 2004-04-26 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/CipherSuite.cs: * Mono.Security.Protocol.Tls/CipherSuiteCollection.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/SecurityCompressionType.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/TlsClientSettings.cs: - Changes for fix FxCop Rules. Index: Alert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alert.cs 10 Apr 2004 21:44:02 -0000 1.3 --- Alert.cs 26 Apr 2004 09:18:45 -0000 1.4 *************** *** 98,105 **** --- 98,107 ---- } + /* public bool IsFatal { get { return this.level == AlertLevel.Fatal ? true : false; } } + */ public bool IsCloseNotify Index: SslServerStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SslServerStream.cs 10 Apr 2004 11:16:24 -0000 1.11 --- SslServerStream.cs 26 Apr 2004 09:18:45 -0000 1.12 *************** *** 719,723 **** #region Event Methods ! internal virtual bool RaiseClientCertificateValidation( X509Certificate certificate, int[] certificateErrors) --- 719,723 ---- #region Event Methods ! internal bool RaiseClientCertificateValidation( X509Certificate certificate, int[] certificateErrors) Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RecordProtocol.cs 21 Apr 2004 12:49:17 -0000 1.16 --- RecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.17 *************** *** 43,52 **** #region Properties - public Stream InnerStream - { - get { return this.innerStream; } - set { this.innerStream = value; } - } - public Context Context { --- 43,46 ---- Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Context.cs 21 Apr 2004 12:49:17 -0000 1.9 --- Context.cs 26 Apr 2004 09:18:45 -0000 1.10 *************** *** 178,182 **** { get { return this.serverSettings; } - set { this.serverSettings = value; } } --- 178,181 ---- *************** *** 184,188 **** { get { return this.clientSettings; } - set { this.clientSettings = value; } } --- 183,186 ---- Index: CipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CipherSuiteCollection.cs 10 Apr 2004 21:44:02 -0000 1.3 --- CipherSuiteCollection.cs 26 Apr 2004 09:18:45 -0000 1.4 *************** *** 30,59 **** namespace Mono.Security.Protocol.Tls { ! internal sealed class CipherSuiteCollection : ArrayList { #region Fields ! private SecurityProtocolType protocol; #endregion ! #region Properties public CipherSuite this[string name] { ! get { return (CipherSuite)this[IndexOf(name)]; } ! set { this[IndexOf(name)] = (CipherSuite)value; } } public CipherSuite this[short code] { ! get { return (CipherSuite)base[IndexOf(code)]; } ! set { base[IndexOf(code)] = (CipherSuite)value; } } ! public new CipherSuite this[int code] { ! get { return (CipherSuite)base[code]; } ! set { base[code] = (CipherSuite)value; } } --- 30,99 ---- namespace Mono.Security.Protocol.Tls { ! internal sealed class CipherSuiteCollection : ICollection, IList, IEnumerable { #region Fields ! private ArrayList cipherSuites; ! private SecurityProtocolType protocol; #endregion ! #region Indexers public CipherSuite this[string name] { ! get { return (CipherSuite)this.cipherSuites[this.IndexOf(name)]; } ! set { this.cipherSuites[this.IndexOf(name)] = (CipherSuite)value; } ! } ! ! public CipherSuite this[int index] ! { ! get { return (CipherSuite)this.cipherSuites[index]; } ! set { this.cipherSuites[index] = (CipherSuite)value; } } public CipherSuite this[short code] { ! get { return (CipherSuite)this.cipherSuites[this.IndexOf(code)]; } ! set { this.cipherSuites[this.IndexOf(code)] = (CipherSuite)value; } } ! object IList.this[int index] { ! get { return this[index]; } ! set { this[index] = (CipherSuite)value; } ! } ! ! #endregion ! ! #region ICollection Properties ! ! bool ICollection.IsSynchronized ! { ! get { return this.cipherSuites.IsSynchronized; } ! } ! ! object ICollection.SyncRoot ! { ! get { return this.cipherSuites.SyncRoot; } ! } ! ! public int Count ! { ! get { return this.cipherSuites.Count; } ! } ! ! #endregion ! ! #region IList Properties ! ! public bool IsFixedSize ! { ! get { return this.cipherSuites.IsFixedSize; } ! } ! ! public bool IsReadOnly ! { ! get { return this.cipherSuites.IsReadOnly; } } *************** *** 64,86 **** public CipherSuiteCollection(SecurityProtocolType protocol) : base() { ! this.protocol = protocol; } #endregion ! #region Methods ! ! public bool Contains(string name) { ! return (-1 != this.IndexOf(name)); } public int IndexOf(string name) { int index = 0; ! foreach (CipherSuite suite in this) { ! if (this.cultureAwareCompare(suite.Name, name)) { return index; --- 104,150 ---- public CipherSuiteCollection(SecurityProtocolType protocol) : base() { ! this.protocol = protocol; ! this.cipherSuites = new ArrayList(); } #endregion ! #region ICollection Methods ! ! public void CopyTo(Array array, int index) { ! this.cipherSuites.CopyTo(array, index); } + #endregion + + #region IEnumerable Methods + + IEnumerator IEnumerable.GetEnumerator() + { + return this.cipherSuites.GetEnumerator(); + } + + #endregion + + #region IList Methods + + public void Clear() + { + this.cipherSuites.Clear(); + } + + bool IList.Contains(object value) + { + return this.cipherSuites.Contains(value as CipherSuite); + } + public int IndexOf(string name) { int index = 0; ! foreach (CipherSuite cipherSuite in this.cipherSuites) { ! if (this.cultureAwareCompare(cipherSuite.Name, name)) { return index; *************** *** 96,102 **** int index = 0; ! foreach (CipherSuite suite in this) { ! if (suite.Code == code) { return index; --- 160,166 ---- int index = 0; ! foreach (CipherSuite cipherSuite in this.cipherSuites) { ! if (cipherSuite.Code == code) { return index; *************** *** 108,114 **** } ! public void RemoveAt(string errorMessage) { ! this.RemoveAt(this.IndexOf(errorMessage)); } --- 172,193 ---- } ! int IList.IndexOf(object value) { ! return this.cipherSuites.IndexOf(value as CipherSuite); ! } ! ! void IList.Insert(int index, object value) ! { ! this.cipherSuites.Insert(index, value as CipherSuite); ! } ! ! void IList.Remove(object value) ! { ! this.cipherSuites.Remove(value as CipherSuite); ! } ! ! void IList.RemoveAt(int index) ! { ! this.cipherSuites.RemoveAt(index); } *************** *** 145,149 **** private TlsCipherSuite add(TlsCipherSuite cipherSuite) { ! base.Add(cipherSuite); return cipherSuite; --- 224,228 ---- private TlsCipherSuite add(TlsCipherSuite cipherSuite) { ! this.cipherSuites.Add(cipherSuite); return cipherSuite; *************** *** 152,160 **** private SslCipherSuite add(SslCipherSuite cipherSuite) { ! base.Add(cipherSuite); return cipherSuite; } private bool cultureAwareCompare(string strA, string strB) { --- 231,244 ---- private SslCipherSuite add(SslCipherSuite cipherSuite) { ! this.cipherSuites.Add(cipherSuite); return cipherSuite; } + int IList.Add(object value) + { + return this.cipherSuites.Add(value as CipherSuite); + } + private bool cultureAwareCompare(string strA, string strB) { Index: CipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CipherSuite.cs 19 Mar 2004 22:44:47 -0000 1.12 --- CipherSuite.cs 26 Apr 2004 09:18:45 -0000 1.13 *************** *** 190,197 **** --- 190,199 ---- } + /* public byte BlockSize { get { return this.blockSize; } } + */ public Context Context *************** *** 255,258 **** --- 257,261 ---- } + /* public void UpdateServerCipherIV(byte[] iv) { *************** *** 266,269 **** --- 269,273 ---- } } + */ public byte[] EncryptRecord(byte[] fragment, byte[] mac) Index: ServerRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ServerRecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.5 --- ServerRecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.6 *************** *** 24,27 **** --- 24,28 ---- using System; + using System.Globalization; using System.IO; *************** *** 87,90 **** --- 88,92 ---- // Create and process the server message message = this.createClientHandshakeMessage(handshakeType, data); + message.Process(); // Update the last handshake message *************** *** 125,129 **** throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format("Unknown server handshake message received ({0})", type.ToString())); } } --- 127,133 ---- throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format(CultureInfo.CurrentUICulture, ! "Unknown server handshake message received ({0})", ! type.ToString())); } } Index: SecurityCompressionType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SecurityCompressionType.cs 10 Feb 2004 09:43:42 -0000 1.1 --- SecurityCompressionType.cs 26 Apr 2004 09:18:45 -0000 1.2 *************** *** 30,34 **** // can be found in: // draft-ietf-tls-compression-05.txt (http://www.ietf.org/internet-drafts/draft-ietf-tls-compression-05.txt) ! public enum SecurityCompressionType : byte { None = 0, --- 30,34 ---- // can be found in: // draft-ietf-tls-compression-05.txt (http://www.ietf.org/internet-drafts/draft-ietf-tls-compression-05.txt) ! public enum SecurityCompressionType { None = 0, Index: ClientRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClientRecordProtocol.cs 21 Apr 2004 12:49:06 -0000 1.8 --- ClientRecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.9 *************** *** 24,27 **** --- 24,28 ---- using System; + using System.Globalization; using System.IO; *************** *** 88,91 **** --- 89,93 ---- // Create and process the server message message = this.createServerHandshakeMessage(handshakeType, data); + message.Process(); // Update the last handshake message *************** *** 168,172 **** throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format("Unknown server handshake message received ({0})", type.ToString())); } } --- 170,176 ---- throw new TlsException( AlertDescription.UnexpectedMessage, ! String.Format(CultureInfo.CurrentUICulture, ! "Unknown server handshake message received ({0})", ! type.ToString())); } } Index: TlsClientSettings.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsClientSettings.cs 9 Apr 2004 08:42:21 -0000 1.2 --- TlsClientSettings.cs 26 Apr 2004 09:18:45 -0000 1.3 *************** *** 56,72 **** set { this.certificates = value; } } - - public SecurityCompressionType CompressionMethod - { - get { return this.compressionMethod; } - set - { - if (value != SecurityCompressionType.None) - { - throw new NotSupportedException("Specified compression method is not supported"); - } - this.compressionMethod = value; - } - } public X509Certificate ClientCertificate --- 56,59 ---- *************** *** 85,88 **** --- 72,90 ---- } + /* + public SecurityCompressionType CompressionMethod + { + get { return this.compressionMethod; } + set + { + if (value != SecurityCompressionType.None) + { + throw new NotSupportedException("Specified compression method is not supported"); + } + this.compressionMethod = value; + } + } + */ + #endregion |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-21 13:00:00
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19453 Modified Files: changelog.txt Log Message: Updated changelog.txt Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** changelog.txt 10 Apr 2004 11:16:55 -0000 1.27 --- changelog.txt 21 Apr 2004 12:59:45 -0000 1.28 *************** *** 3,6 **** --- 3,52 ---- + 2004-04-22 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/DebugHelper.cs: + + - New class. + + * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Protocol.Tls/Context.cs: + * Mono.Security.Protocol.Tls/Context.cs: + * Mono.Security.Protocol.Tls/SslCipherSuite.cs: + * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: + * Mono.Security.Protocol.Tls/SslClientStream.cs: + + - Added debug capabilities. + + * Mono.Security.Protocol.Tls/ServerContext.cs: + + - Added initialization of requested CertificateTypes and CA's + + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs: + + - Modfied exception handling + + - Added debug capabilities. + + + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs: + + - Modify SSL implementation. + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs: + + - Initial implementation. + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: + + - Modfied exception handling + + 2004-04-10 Carlos Guzman Alvarez <car...@te...> |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-21 12:59:28
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19220 Modified Files: TlsClientCertificateVerify.cs TlsClientFinished.cs TlsClientHello.cs TlsServerCertificateRequest.cs Log Message: 2004-04-22 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/DebugHelper.cs: - New class. Index: TlsClientFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsClientFinished.cs 10 Apr 2004 11:15:08 -0000 1.7 --- TlsClientFinished.cs 21 Apr 2004 12:58:11 -0000 1.8 *************** *** 80,86 **** if (decryptError) { ! throw new TlsException( ! AlertDescription.DecryptError, ! "Decrypt error."); } } --- 80,84 ---- if (decryptError) { ! throw new TlsException(AlertDescription.DecryptError, "Decrypt error."); } } *************** *** 118,124 **** if (decryptError) { ! throw new TlsException( ! AlertDescription.DecryptError, ! "Decrypt error."); } } --- 116,120 ---- if (decryptError) { ! throw new TlsException(AlertDescription.DecryptError, "Decrypt error."); } } Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsClientCertificateVerify.cs 10 Apr 2004 11:15:08 -0000 1.6 --- TlsClientCertificateVerify.cs 21 Apr 2004 12:58:10 -0000 1.7 *************** *** 56,66 **** (int)context.HandshakeMessages.Length); ! if (!hash.VerifySignature( ! context.ClientSettings.CertificateRSA, ! signature)) { ! throw new TlsException( ! AlertDescription.HandshakeFailiure, ! "Handshake Failiure."); } } --- 56,62 ---- (int)context.HandshakeMessages.Length); ! if (!hash.VerifySignature(context.ClientSettings.CertificateRSA, signature)) { ! throw new TlsException(AlertDescription.HandshakeFailiure, "Handshake Failiure."); } } *************** *** 78,84 **** (int)context.HandshakeMessages.Length); ! if (!hash.VerifySignature( ! context.ClientSettings.CertificateRSA, ! signature)) { throw new TlsException( --- 74,78 ---- (int)context.HandshakeMessages.Length); ! if (!hash.VerifySignature(context.ClientSettings.CertificateRSA, signature)) { throw new TlsException( Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsServerCertificateRequest.cs 10 Apr 2004 11:15:08 -0000 1.5 --- TlsServerCertificateRequest.cs 21 Apr 2004 12:58:12 -0000 1.6 *************** *** 44,53 **** protected override void ProcessAsSsl3() { ! throw new NotSupportedException(); } protected override void ProcessAsTls1() { ! throw new NotSupportedException(); } --- 44,82 ---- protected override void ProcessAsSsl3() { ! this.ProcessAsTls1(); } protected override void ProcessAsTls1() { ! ServerContext context = (ServerContext)this.Context; ! ! int count = context.ServerSettings.CertificateTypes.Length; ! ! this.WriteByte(Convert.ToByte(count)); ! ! // Write requested certificate types ! for (int i = 0; i < count; i++) ! { ! this.WriteByte((byte)context.ServerSettings.CertificateTypes[i]); ! } ! ! /* ! * Write requested certificate authorities (Distinguised Names) ! * ! * Name ::= SEQUENCE OF RelativeDistinguishedName ! * ! * RelativeDistinguishedName ::= SET OF AttributeValueAssertion ! * ! * AttributeValueAssertion ::= SEQUENCE { ! * attributeType OBJECT IDENTIFIER ! * attributeValue ANY } ! */ ! ! this.Write(Convert.ToInt16(context.ServerSettings.DistinguisedNames.Length)); ! ! for (int i = 0; i < context.ServerSettings.DistinguisedNames.Length; i++) ! { ! #warning "Write certificate authorities list" ! } } Index: TlsClientHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsClientHello.cs 10 Apr 2004 11:15:08 -0000 1.9 --- TlsClientHello.cs 21 Apr 2004 12:58:12 -0000 1.10 *************** *** 119,125 **** else { ! throw new TlsException( ! AlertDescription.ProtocolVersion, ! "Incorrect protocol version received from server"); } } --- 119,123 ---- else { ! throw new TlsException(AlertDescription.ProtocolVersion, "Incorrect protocol version received from server"); } } *************** *** 140,146 **** if (this.Context.Cipher == null) { ! throw new TlsException( ! AlertDescription.InsuficientSecurity, ! "Insuficient Security"); } } --- 138,142 ---- if (this.Context.Cipher == null) { ! throw new TlsException(AlertDescription.InsuficientSecurity, "Insuficient Security"); } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-21 12:56:20
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18403 Modified Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsServerCertificate.cs TlsServerCertificateRequest.cs TlsServerFinished.cs TlsServerHello.cs Log Message: 2004-04-22 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/DebugHelper.cs: - New class. Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsClientCertificateVerify.cs 10 Apr 2004 11:15:43 -0000 1.6 --- TlsClientCertificateVerify.cs 21 Apr 2004 12:54:52 -0000 1.7 *************** *** 65,71 **** if (privKey == null) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate Private Key unavailable."); } else --- 65,69 ---- if (privKey == null) { ! throw new TlsException(AlertDescription.UserCancelled, "Client certificate Private Key unavailable."); } else *************** *** 97,103 **** if (privKey == null) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate Private Key unavailable."); } else --- 95,99 ---- if (privKey == null) { ! throw new TlsException(AlertDescription.UserCancelled, "Client certificate Private Key unavailable."); } else Index: TlsServerCertificateRequest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsServerCertificateRequest.cs 10 Mar 2004 15:48:48 -0000 1.5 --- TlsServerCertificateRequest.cs 21 Apr 2004 12:54:54 -0000 1.6 *************** *** 64,68 **** protected override void ProcessAsSsl3() { ! throw new NotSupportedException(); } --- 64,68 ---- protected override void ProcessAsSsl3() { ! this.ProcessAsTls1(); } Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TlsServerCertificate.cs 10 Apr 2004 11:15:43 -0000 1.9 --- TlsServerCertificate.cs 21 Apr 2004 12:54:53 -0000 1.10 *************** *** 97,100 **** --- 97,104 ---- readed += certLength; + + DebugHelper.WriteLine( + String.Format("Server Certificate {0}", certificates.Count), + buffer); } } Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsClientCertificate.cs 10 Apr 2004 11:15:43 -0000 1.6 --- TlsClientCertificate.cs 21 Apr 2004 12:54:41 -0000 1.7 *************** *** 62,72 **** #warning "Client certificate selection is unfinished" ClientContext context = (ClientContext)this.Context; if (context.ClientSettings.Certificates == null || context.ClientSettings.Certificates.Count == 0) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate requested by the server and no client certificate specified."); } --- 62,71 ---- #warning "Client certificate selection is unfinished" ClientContext context = (ClientContext)this.Context; + string msg = "Client certificate requested by the server and no client certificate specified."; if (context.ClientSettings.Certificates == null || context.ClientSettings.Certificates.Count == 0) { ! throw new TlsException(AlertDescription.UserCancelled, msg); } *************** *** 82,88 **** if (clientCert == null) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate requested by the server and no client certificate specified."); } --- 81,85 ---- if (clientCert == null) { ! throw new TlsException(AlertDescription.UserCancelled, msg); } Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TlsServerHello.cs 10 Apr 2004 11:15:43 -0000 1.6 --- TlsServerHello.cs 21 Apr 2004 12:54:54 -0000 1.7 *************** *** 59,62 **** --- 59,66 ---- this.Context.ProtocolNegotiated = true; + DebugHelper.WriteLine("Selected Cipher Suite {0}", this.cipherSuite.Name); + DebugHelper.WriteLine("Client random", this.Context.ClientRandom); + DebugHelper.WriteLine("Server random", this.Context.ServerRandom); + // Compute ClientRandom + ServerRandom TlsStream random = new TlsStream(); *************** *** 64,68 **** random.Write(this.Context.ServerRandom); this.Context.RandomCS = random.ToArray(); ! // Server Random + Client Random random.Reset(); --- 68,72 ---- random.Write(this.Context.ServerRandom); this.Context.RandomCS = random.ToArray(); ! // Server Random + Client Random random.Reset(); *************** *** 90,94 **** // Read random - Unix time + Random bytes this.random = this.ReadBytes(32); ! // Read Session id int length = (int)ReadByte(); --- 94,98 ---- // Read random - Unix time + Random bytes this.random = this.ReadBytes(32); ! // Read Session id int length = (int)ReadByte(); *************** *** 103,107 **** { // The server has sent an invalid ciphersuite ! throw new TlsException("Invalid cipher suite received from server"); } this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; --- 107,111 ---- { // The server has sent an invalid ciphersuite ! throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid cipher suite received from server"); } this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; *************** *** 126,129 **** --- 130,135 ---- this.Context.SupportedCiphers = null; this.Context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(serverProtocol); + + DebugHelper.WriteLine("Selected protocol {0}", serverProtocol); } else Index: TlsServerFinished.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsServerFinished.cs 9 Mar 2004 22:05:30 -0000 1.5 --- TlsServerFinished.cs 21 Apr 2004 12:54:54 -0000 1.6 *************** *** 77,81 **** if (clientHash.Length != serverHash.Length) { ! throw new TlsException("Invalid ServerFinished message received."); } for (int i = 0; i < serverHash.Length; i++) --- 77,82 ---- if (clientHash.Length != serverHash.Length) { ! #warning Review that selected alert is correct ! throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received."); } for (int i = 0; i < serverHash.Length; i++) *************** *** 83,87 **** if (clientHash[i] != serverHash[i]) { ! throw new TlsException("Invalid ServerFinished message received."); } } --- 84,88 ---- if (clientHash[i] != serverHash[i]) { ! throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received."); } } *************** *** 109,113 **** if (clientPRF[i] != serverPRF[i]) { ! throw new TlsException("Invalid ServerFinished message received."); } } --- 110,114 ---- if (clientPRF[i] != serverPRF[i]) { ! throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received."); } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-21 12:51:41
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17841 Added Files: DebugHelper.cs Log Message: 2004-04-22 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/DebugHelper.cs: - New class. --- NEW FILE: DebugHelper.cs --- /* Transport Security Layer (TLS) * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ using System; using System.Diagnostics; namespace Mono.Security.Protocol.Tls { internal class DebugHelper { private static bool isInitialized; [Conditional("DEBUG")] public static void Initialize() { if (!isInitialized) { // Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); Debug.Listeners.Add(new TextWriterTraceListener(@"c:\ssl.log")); Debug.AutoFlush = true; Debug.Indent(); isInitialized = true; } } [Conditional("DEBUG")] public static void WriteLine(string format, params object[] args) { Initialize(); Debug.WriteLine(String.Format(format, args)); } [Conditional("DEBUG")] public static void WriteLine(string message) { Initialize(); Debug.WriteLine(message); } [Conditional("DEBUG")] public static void WriteLine(string message, byte[] buffer) { Initialize(); DebugHelper.WriteLine(String.Format("{0} ({1} bytes))", message, buffer.Length)); DebugHelper.WriteBuffer(buffer); } [Conditional("DEBUG")] public static void WriteBuffer(byte[] buffer) { Initialize(); DebugHelper.WriteBuffer(buffer, 0, buffer.Length); } [Conditional("DEBUG")] public static void WriteBuffer(byte[] buffer, int index, int length) { Initialize(); for (int i = index; i < length; i += 16) { int count = (length - i) >= 16 ? 16 : (length - i); for (int j = 0; j < count; j++) { Debug.Write(buffer[i + j].ToString("x2") + " "); } Debug.WriteLine(""); } } } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-21 12:50:38
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17374 Modified Files: ClientRecordProtocol.cs Context.cs RecordProtocol.cs ServerContext.cs SslCipherSuite.cs SslClientStream.cs TlsCipherSuite.cs Log Message: 2004-04-22 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/SslCipherSuite.cs: * Mono.Security.Protocol.Tls/TlsCipherSuite.cs: * Mono.Security.Protocol.Tls/SslClientStream.cs: - Added debug capabilities. * Mono.Security.Protocol.Tls/ServerContext.cs: - Added initialization of requested CertificateTypes and CA's Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.15 --- RecordProtocol.cs 21 Apr 2004 12:49:17 -0000 1.16 *************** *** 109,112 **** --- 109,118 ---- } + DebugHelper.WriteLine( + ">>>> Read record ({0}|{1})", + this.context.DecodeProtocolCode(protocol), + contentType); + DebugHelper.WriteLine("Record data", buffer); + TlsStream message = new TlsStream(buffer); *************** *** 132,135 **** --- 138,143 ---- contentType, message.ToArray()); + + DebugHelper.WriteLine("Decrypted record data", message.ToArray()); } } *************** *** 223,227 **** public void SendAlert(Alert alert) ! { // Write record this.SendRecord( --- 231,237 ---- public void SendAlert(Alert alert) ! { ! DebugHelper.WriteLine(">>>> Write Alert ({0}|{1})", alert.Description, alert.Message); ! // Write record this.SendRecord( *************** *** 241,244 **** --- 251,256 ---- public void SendChangeCipherSpec() { + DebugHelper.WriteLine(">>>> Write Change Cipher Spec"); + // Send Change Cipher Spec message as a plain message this.context.IsActual = false; *************** *** 327,330 **** --- 339,344 ---- record.Write(fragment); + DebugHelper.WriteLine("Record data", fragment); + // Update buffer position position += fragmentLength; *************** *** 354,357 **** --- 368,373 ---- } + DebugHelper.WriteLine(">>>> Record MAC", mac); + // Encrypt the message byte[] ecr = this.context.Cipher.EncryptRecord(fragment, mac); *************** *** 406,409 **** --- 422,427 ---- } + DebugHelper.WriteLine(">>>> Record MAC", mac); + // Check record MAC if (mac.Length != dcrMAC.Length) *************** *** 425,434 **** if (badRecordMac) { ! if (this.context is ServerContext) ! { ! this.Context.RecordProtocol.SendAlert(AlertDescription.BadRecordMAC); ! } ! ! throw new TlsException("Bad record MAC"); } --- 443,447 ---- if (badRecordMac) { ! throw new TlsException(AlertDescription.BadRecordMAC, "Bad record MAC"); } Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Context.cs 10 Apr 2004 21:44:02 -0000 1.8 --- Context.cs 21 Apr 2004 12:49:17 -0000 1.9 *************** *** 409,422 **** } - public void PrintBuffer(string title, byte[] buffer) - { - Console.WriteLine("{0}\n", title); - for (int i = 0; i < buffer.Length; i++) - { - Console.Write(buffer[i].ToString("x2")); - } - Console.WriteLine("\n\n"); - } - #endregion } --- 409,412 ---- Index: ServerContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ServerContext.cs 19 Mar 2004 22:44:47 -0000 1.3 --- ServerContext.cs 21 Apr 2004 12:49:17 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- using System.Security.Cryptography.X509Certificates; + using Mono.Security.Protocol.Tls.Handshake; using MonoX509 = Mono.Security.X509; *************** *** 74,77 **** --- 75,85 ---- this.ServerSettings.UpdateCertificateRSA(); + + // Add requested certificate types + this.ServerSettings.CertificateTypes = new ClientCertificateType[1]; + this.ServerSettings.CertificateTypes[0] = ClientCertificateType.RSA; + + // Add certificate authorities + this.ServerSettings.DistinguisedNames = new string[0]; } Index: SslClientStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SslClientStream.cs 10 Apr 2004 11:16:24 -0000 1.20 --- SslClientStream.cs 21 Apr 2004 12:49:18 -0000 1.21 *************** *** 482,487 **** buffer, offset, count, callback, state); } ! catch (TlsException) { throw new IOException("The authentication or decryption has failed."); } --- 482,490 ---- buffer, offset, count, callback, state); } ! catch (TlsException ex) { + this.protocol.SendAlert(ex.Alert); + this.Close(); + throw new IOException("The authentication or decryption has failed."); } *************** *** 547,552 **** record, 0, record.Length, callback, state); } ! catch (TlsException) { throw new IOException("The authentication or decryption has failed."); } --- 550,558 ---- record, 0, record.Length, callback, state); } ! catch (TlsException ex) { + this.protocol.SendAlert(ex.Alert); + this.Close(); + throw new IOException("The authentication or decryption has failed."); } Index: SslCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SslCipherSuite.cs 10 Apr 2004 21:44:02 -0000 1.4 --- SslCipherSuite.cs 21 Apr 2004 12:49:17 -0000 1.5 *************** *** 159,162 **** --- 159,164 ---- this.Context.MasterSecret = masterSecret.ToArray(); + + DebugHelper.WriteLine(">>>> MasterSecret", this.Context.MasterSecret); } *************** *** 251,254 **** --- 253,264 ---- } + DebugHelper.WriteLine(">>>> KeyBlock", keyBlock.ToArray()); + DebugHelper.WriteLine(">>>> ClientWriteKey", this.Context.ClientWriteKey); + DebugHelper.WriteLine(">>>> ClientWriteIV", this.Context.ClientWriteIV); + DebugHelper.WriteLine(">>>> ClientWriteMAC", this.Context.ClientWriteMAC); + DebugHelper.WriteLine(">>>> ServerWriteKey", this.Context.ServerWriteKey); + DebugHelper.WriteLine(">>>> ServerWriteIV", this.Context.ServerWriteIV); + DebugHelper.WriteLine(">>>> ServerWriteMAC", this.Context.ServerWriteMAC); + // Clear no more needed data keyBlock.Reset(); Index: TlsCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsCipherSuite.cs 18 Mar 2004 14:06:31 -0000 1.8 --- TlsCipherSuite.cs 21 Apr 2004 12:49:21 -0000 1.9 *************** *** 116,119 **** --- 116,121 ---- this.Context.MasterSecret = this.PRF( preMasterSecret, "master secret", this.Context.RandomCS, 48); + + DebugHelper.WriteLine(">>>> MasterSecret", this.Context.MasterSecret); } *************** *** 174,177 **** --- 176,187 ---- } + DebugHelper.WriteLine(">>>> KeyBlock", keyBlock.ToArray()); + DebugHelper.WriteLine(">>>> ClientWriteKey", this.Context.ClientWriteKey); + DebugHelper.WriteLine(">>>> ClientWriteIV", this.Context.ClientWriteIV); + DebugHelper.WriteLine(">>>> ClientWriteMAC", this.Context.ClientWriteMAC); + DebugHelper.WriteLine(">>>> ServerWriteKey", this.Context.ServerWriteKey); + DebugHelper.WriteLine(">>>> ServerWriteIV", this.Context.ServerWriteIV); + DebugHelper.WriteLine(">>>> ServerWriteMAC", this.Context.ServerWriteMAC); + // Clear no more needed data keyBlock.Reset(); Index: ClientRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ClientRecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.7 --- ClientRecordProtocol.cs 21 Apr 2004 12:49:06 -0000 1.8 *************** *** 50,53 **** --- 50,55 ---- HandshakeMessage msg = this.createClientHandshakeMessage(type); + DebugHelper.WriteLine(">>>> Write handshake record ({0}|{1})", context.Protocol, msg.ContentType); + // Write record this.SendRecord(msg.ContentType, msg.EncodeMessage()); *************** *** 75,78 **** --- 77,82 ---- HandshakeMessage message = null; + DebugHelper.WriteLine(">>>> Processing Handshake record ({0})", handshakeType); + // Read message length int length = handMsg.ReadInt24(); *************** *** 99,104 **** #region Client Handshake Message Factories ! private HandshakeMessage createClientHandshakeMessage( ! HandshakeType type) { switch (type) --- 103,107 ---- #region Client Handshake Message Factories ! private HandshakeMessage createClientHandshakeMessage(HandshakeType type) { switch (type) |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 21:57:35
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26556 Modified Files: Alert.cs CipherSuiteCollection.cs ClientContext.cs Context.cs RSASslSignatureDeformatter.cs RSASslSignatureFormatter.cs SslCipherSuite.cs SslHandshakeHash.cs TlsException.cs TlsStream.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Started cleanup and unification of this keyword usage tasks. Index: TlsException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TlsException.cs 10 Apr 2004 11:16:24 -0000 1.3 --- TlsException.cs 10 Apr 2004 21:44:02 -0000 1.4 *************** *** 32,36 **** internal sealed class TlsException : Exception { ! #region Private fields private Alert alert; --- 32,36 ---- internal sealed class TlsException : Exception { ! #region Fields private Alert alert; Index: ClientContext.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ClientContext.cs 3 Mar 2004 16:22:36 -0000 1.3 --- ClientContext.cs 10 Apr 2004 21:44:02 -0000 1.4 *************** *** 74,79 **** public override void Clear() { ! this.clientHelloProtocol = 0; ! base.Clear(); } --- 74,78 ---- public override void Clear() { ! this.clientHelloProtocol = 0; base.Clear(); } Index: RSASslSignatureFormatter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RSASslSignatureFormatter.cs 10 Feb 2004 09:43:42 -0000 1.1 --- RSASslSignatureFormatter.cs 10 Apr 2004 21:44:02 -0000 1.2 *************** *** 54,58 **** public override byte[] CreateSignature(byte[] rgbHash) { ! if (key == null) { throw new CryptographicUnexpectedOperationException("The key is a null reference"); --- 54,58 ---- public override byte[] CreateSignature(byte[] rgbHash) { ! if (this.key == null) { throw new CryptographicUnexpectedOperationException("The key is a null reference"); Index: RSASslSignatureDeformatter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RSASslSignatureDeformatter.cs 10 Feb 2004 09:43:42 -0000 1.1 --- RSASslSignatureDeformatter.cs 10 Apr 2004 21:44:02 -0000 1.2 *************** *** 56,60 **** byte[] rgbSignature) { ! if (key == null) { throw new CryptographicUnexpectedOperationException("The key is a null reference"); --- 56,60 ---- byte[] rgbSignature) { ! if (this.key == null) { throw new CryptographicUnexpectedOperationException("The key is a null reference"); Index: TlsStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsStream.cs 15 Mar 2004 13:18:30 -0000 1.2 --- TlsStream.cs 10 Apr 2004 21:44:02 -0000 1.3 *************** *** 62,87 **** public override bool CanWrite { ! get { return canWrite; } } public override bool CanRead { ! get { return canRead; } } public override bool CanSeek { ! get { return buffer.CanSeek; } } public override long Position { ! get { return buffer.Position; } ! set { buffer.Position = value; } } public override long Length { ! get { return buffer.Length; } } --- 62,87 ---- public override bool CanWrite { ! get { return this.canWrite; } } public override bool CanRead { ! get { return this.canRead; } } public override bool CanSeek { ! get { return this.buffer.CanSeek; } } public override long Position { ! get { return this.buffer.Position; } ! set { this.buffer.Position = value; } } public override long Length { ! get { return this.buffer.Length; } } *************** *** 155,159 **** public void Write(byte value) { ! WriteByte(value); } --- 155,159 ---- public void Write(byte value) { ! this.WriteByte(value); } *************** *** 161,165 **** { byte[] bytes = BitConverter.GetBytes((short)IPAddress.HostToNetworkOrder(value)); ! Write(bytes); } --- 161,165 ---- { byte[] bytes = BitConverter.GetBytes((short)IPAddress.HostToNetworkOrder(value)); ! this.Write(bytes); } *************** *** 171,175 **** Buffer.BlockCopy(BitConverter.GetBytes(int24), 1, content, 0, 3); ! Write(content); } --- 171,175 ---- Buffer.BlockCopy(BitConverter.GetBytes(int24), 1, content, 0, 3); ! this.Write(content); } *************** *** 177,181 **** { byte[] bytes = BitConverter.GetBytes((int)IPAddress.HostToNetworkOrder(value)); ! Write(bytes); } --- 177,181 ---- { byte[] bytes = BitConverter.GetBytes((int)IPAddress.HostToNetworkOrder(value)); ! this.Write(bytes); } *************** *** 183,192 **** { byte[] bytes = BitConverter.GetBytes((long)IPAddress.HostToNetworkOrder(value)); ! Write(bytes); } public void Write(byte[] buffer) { ! Write(buffer, 0, buffer.Length); } --- 183,192 ---- { byte[] bytes = BitConverter.GetBytes((long)IPAddress.HostToNetworkOrder(value)); ! this.Write(bytes); } public void Write(byte[] buffer) { ! this.Write(buffer, 0, buffer.Length); } *************** *** 197,207 **** public void Reset() { ! buffer.SetLength(0); ! buffer.Position = 0; } public byte[] ToArray() { ! return buffer.ToArray(); } --- 197,207 ---- public void Reset() { ! this.buffer.SetLength(0); ! this.buffer.Position = 0; } public byte[] ToArray() { ! return this.buffer.ToArray(); } *************** *** 212,231 **** public override void Flush() { ! buffer.Flush(); } public override void SetLength(long length) { ! buffer.SetLength(length); } public override long Seek(long offset, System.IO.SeekOrigin loc) { ! return buffer.Seek(offset, loc); } public override int Read(byte[] buffer, int offset, int count) { ! if (canRead) { return this.buffer.Read(buffer, offset, count); --- 212,231 ---- public override void Flush() { ! this.buffer.Flush(); } public override void SetLength(long length) { ! this.buffer.SetLength(length); } public override long Seek(long offset, System.IO.SeekOrigin loc) { ! return this.buffer.Seek(offset, loc); } public override int Read(byte[] buffer, int offset, int count) { ! if (this.canRead) { return this.buffer.Read(buffer, offset, count); *************** *** 236,240 **** public override void Write(byte[] buffer, int offset, int count) { ! if (canWrite) { this.buffer.Write(buffer, offset, count); --- 236,240 ---- public override void Write(byte[] buffer, int offset, int count) { ! if (this.canWrite) { this.buffer.Write(buffer, offset, count); Index: SslHandshakeHash.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SslHandshakeHash.cs 9 Apr 2004 08:42:21 -0000 1.3 --- SslHandshakeHash.cs 10 Apr 2004 21:44:02 -0000 1.4 *************** *** 66,103 **** public override void Initialize() { ! md5.Initialize(); ! sha.Initialize(); ! initializePad(); ! hashing = false; } protected override byte[] HashFinal() { ! if (!hashing) { ! hashing = true; } // Finalize the md5 hash ! md5.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! md5.TransformFinalBlock(this.innerPadMD5, 0, this.innerPadMD5.Length); ! byte[] firstResultMD5 = md5.Hash; ! md5.Initialize(); ! md5.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! md5.TransformBlock(this.outerPadMD5, 0, this.outerPadMD5.Length, this.outerPadMD5, 0); ! md5.TransformFinalBlock(firstResultMD5, 0, firstResultMD5.Length); // Finalize the sha1 hash ! sha.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! sha.TransformFinalBlock(this.innerPadSHA, 0, this.innerPadSHA.Length); ! byte[] firstResultSHA = sha.Hash; ! sha.Initialize(); ! sha.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! sha.TransformBlock(this.outerPadSHA, 0, this.outerPadSHA.Length, this.outerPadSHA, 0); ! sha.TransformFinalBlock(firstResultSHA, 0, firstResultSHA.Length); this.Initialize(); --- 66,103 ---- public override void Initialize() { ! this.md5.Initialize(); ! this.sha.Initialize(); ! this.initializePad(); ! this.hashing = false; } protected override byte[] HashFinal() { ! if (!this.hashing) { ! this.hashing = true; } // Finalize the md5 hash ! this.md5.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! this.md5.TransformFinalBlock(this.innerPadMD5, 0, this.innerPadMD5.Length); ! byte[] firstResultMD5 = this.md5.Hash; ! this.md5.Initialize(); ! this.md5.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! this.md5.TransformBlock(this.outerPadMD5, 0, this.outerPadMD5.Length, this.outerPadMD5, 0); ! this.md5.TransformFinalBlock(firstResultMD5, 0, firstResultMD5.Length); // Finalize the sha1 hash ! this.sha.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! this.sha.TransformFinalBlock(this.innerPadSHA, 0, this.innerPadSHA.Length); ! byte[] firstResultSHA = this.sha.Hash; ! this.sha.Initialize(); ! this.sha.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); ! this.sha.TransformBlock(this.outerPadSHA, 0, this.outerPadSHA.Length, this.outerPadSHA, 0); ! this.sha.TransformFinalBlock(firstResultSHA, 0, firstResultSHA.Length); this.Initialize(); *************** *** 105,125 **** byte[] result = new byte[36]; ! Buffer.BlockCopy(md5.Hash, 0, result, 0, 16); ! Buffer.BlockCopy(sha.Hash, 0, result, 16, 20); return result; } ! protected override void HashCore( ! byte[] array, ! int ibStart, ! int cbSize) { ! if (!hashing) { ! hashing = true; } ! md5.TransformBlock(array, ibStart, cbSize, array, ibStart); ! sha.TransformBlock(array, ibStart, cbSize, array, ibStart); } --- 105,123 ---- byte[] result = new byte[36]; ! Buffer.BlockCopy(this.md5.Hash, 0, result, 0, 16); ! Buffer.BlockCopy(this.sha.Hash, 0, result, 16, 20); return result; } ! protected override void HashCore(byte[] array, int ibStart, int cbSize) { ! if (!this.hashing) { ! this.hashing = true; } ! ! this.md5.TransformBlock(array, ibStart, cbSize, array, ibStart); ! this.sha.TransformBlock(array, ibStart, cbSize, array, ibStart); } Index: SslCipherSuite.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SslCipherSuite.cs 18 Mar 2004 14:06:31 -0000 1.3 --- SslCipherSuite.cs 10 Apr 2004 21:44:02 -0000 1.4 *************** *** 65,70 **** for (int i = 0; i < padLength; ++i) { ! pad1[i] = 0x36; ! pad2[i] = 0x5C; } } --- 65,70 ---- for (int i = 0; i < padLength; ++i) { ! this.pad1[i] = 0x36; ! this.pad2[i] = 0x5C; } } *************** *** 168,171 **** --- 168,172 ---- char labelChar = 'A'; int count = 1; + while (tmp.Length < this.KeyBlockSize) { *************** *** 188,193 **** // Create keyblock ! TlsStream keyBlock = new TlsStream(tmp.ToArray()); ! this.Context.ClientWriteMAC = keyBlock.ReadBytes(this.HashSize); this.Context.ServerWriteMAC = keyBlock.ReadBytes(this.HashSize); --- 189,194 ---- // Create keyblock ! TlsStream keyBlock = new TlsStream(tmp.ToArray()); ! this.Context.ClientWriteMAC = keyBlock.ReadBytes(this.HashSize); this.Context.ServerWriteMAC = keyBlock.ReadBytes(this.HashSize); Index: Alert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Alert.cs 10 Apr 2004 11:16:24 -0000 1.2 --- Alert.cs 10 Apr 2004 21:44:02 -0000 1.3 *************** *** 95,110 **** public bool IsWarning { ! get ! { ! return this.level == AlertLevel.Warning ? true : false; ! } } public bool IsFatal { ! get ! { ! return this.level == AlertLevel.Fatal ? true : false; ! } } --- 95,104 ---- public bool IsWarning { ! get { return this.level == AlertLevel.Warning ? true : false; } } public bool IsFatal { ! get { return this.level == AlertLevel.Fatal ? true : false; } } Index: CipherSuiteCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CipherSuiteCollection.cs 6 Mar 2004 14:53:13 -0000 1.2 --- CipherSuiteCollection.cs 10 Apr 2004 21:44:02 -0000 1.3 *************** *** 73,77 **** public bool Contains(string name) { ! return(-1 != IndexOf(name)); } --- 73,77 ---- public bool Contains(string name) { ! return (-1 != this.IndexOf(name)); } *************** *** 79,85 **** { int index = 0; foreach (CipherSuite suite in this) { ! if (cultureAwareCompare(suite.Name, name)) { return index; --- 79,86 ---- { int index = 0; + foreach (CipherSuite suite in this) { ! if (this.cultureAwareCompare(suite.Name, name)) { return index; *************** *** 87,90 **** --- 88,92 ---- index++; } + return -1; } *************** *** 93,96 **** --- 95,99 ---- { int index = 0; + foreach (CipherSuite suite in this) { *************** *** 101,104 **** --- 104,108 ---- index++; } + return -1; } *************** *** 106,110 **** public void RemoveAt(string errorMessage) { ! RemoveAt(IndexOf(errorMessage)); } --- 110,114 ---- public void RemoveAt(string errorMessage) { ! this.RemoveAt(this.IndexOf(errorMessage)); } Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Context.cs 10 Apr 2004 11:16:24 -0000 1.7 --- Context.cs 10 Apr 2004 21:44:02 -0000 1.8 *************** *** 420,449 **** #endregion - - /* - #region Exception Methods - - public TlsException CreateException( - AlertLevel alertLevel, - AlertDescription alertDesc) - { - return CreateException(Alert.GetAlertMessage(alertDesc)); - } - - public TlsException CreateException(string format, params object[] args) - { - StringBuilder message = new StringBuilder(); - message.AppendFormat(format, args); - - return CreateException(message.ToString()); - } - - public TlsException CreateException(string message) - { - return new TlsException(message); - } - - #endregion - */ } } --- 420,423 ---- |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 21:49:10
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25168 Modified Files: PgConnectionPool.cs PgDataAdapter.cs PgDataReader.cs PgError.cs PgErrorCollection.cs PgInfoMessageEventArgs.cs PgNotificationEventArgs.cs PgParameter.cs PgParameterCollection.cs PgTransaction.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Started cleanup and unification of this keyword usage tasks. Index: PgInfoMessageEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgInfoMessageEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgInfoMessageEventArgs.cs 9 Feb 2004 14:19:22 -0000 1.2 --- PgInfoMessageEventArgs.cs 10 Apr 2004 21:35:36 -0000 1.3 *************** *** 23,43 **** namespace PostgreSql.Data.PgSqlClient { public delegate void PgInfoMessageEventHandler(object sender, PgInfoMessageEventArgs e); public sealed class PgInfoMessageEventArgs : EventArgs { private PgErrorCollection errors = new PgErrorCollection(); private string message = String.Empty; public PgErrorCollection Errors { ! get { return errors; } } public string Message { ! get { return message; } } internal PgInfoMessageEventArgs(PgClientException ex) { --- 23,57 ---- namespace PostgreSql.Data.PgSqlClient { + #region Delegates + public delegate void PgInfoMessageEventHandler(object sender, PgInfoMessageEventArgs e); + #endregion + public sealed class PgInfoMessageEventArgs : EventArgs { + #region Fields + private PgErrorCollection errors = new PgErrorCollection(); private string message = String.Empty; + #endregion + + #region Properties + public PgErrorCollection Errors { ! get { return this.errors; } } public string Message { ! get { return this.message; } } + #endregion + + #region Constructors + internal PgInfoMessageEventArgs(PgClientException ex) { *************** *** 58,64 **** newError.Routine = error.Routine; ! errors.Add(newError); } } } } \ No newline at end of file --- 72,80 ---- newError.Routine = error.Routine; ! this.errors.Add(newError); } } + + #endregion } } \ No newline at end of file Index: PgConnectionPool.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnectionPool.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgConnectionPool.cs 8 Mar 2004 15:12:26 -0000 1.5 --- PgConnectionPool.cs 10 Apr 2004 21:35:36 -0000 1.6 *************** *** 26,30 **** internal class PgConnectionPool : MarshalByRefObject { ! #region FIELDS private static ConnectionPool pool = null; --- 26,30 ---- internal class PgConnectionPool : MarshalByRefObject { ! #region Fields private static ConnectionPool pool = null; *************** *** 32,36 **** #endregion ! #region METHODS public static void Init() --- 32,36 ---- #endregion ! #region Methods public static void Init() *************** *** 59,63 **** internal class ConnectionPool { ! #region FIELDS private ArrayList locked; --- 59,63 ---- internal class ConnectionPool { ! #region Fields private ArrayList locked; *************** *** 67,86 **** #endregion ! #region CONSTRUCTORS public ConnectionPool() { ! locked = ArrayList.Synchronized(new ArrayList()); ! unlocked = ArrayList.Synchronized(new ArrayList()); ! cleanUpThread = new Thread(new ThreadStart(RunCleanUp)); ! cleanUpThread.Name = "CleanUp Thread"; ! cleanUpThread.Start(); ! cleanUpThread.IsBackground = true; } #endregion ! #region METHODS public PgDbConnection CheckOut(string connectionString) --- 67,86 ---- #endregion ! #region Constructors public ConnectionPool() { ! this.locked = ArrayList.Synchronized(new ArrayList()); ! this.unlocked = ArrayList.Synchronized(new ArrayList()); ! this.cleanUpThread = new Thread(new ThreadStart(RunCleanUp)); ! this.cleanUpThread.Name = "CleanUp Thread"; ! this.cleanUpThread.Start(); ! this.cleanUpThread.IsBackground = true; } #endregion ! #region Methods public PgDbConnection CheckOut(string connectionString) *************** *** 91,107 **** public PgDbConnection CheckOut(string connectionString, PgDbConnection instance) { ! PgDbConnection newConnection = null; long now = System.DateTime.Now.Ticks; lock (typeof(PgConnectionPool)) { ! if (unlocked.Count > 0) { ! PgDbConnection[] list = new PgDbConnection[unlocked.Count]; ! unlocked.CopyTo(0, list, 0, list.Length); foreach (PgDbConnection connection in list) { ! if (Validate(connection, connectionString)) { if (connection.Lifetime != 0) --- 91,107 ---- public PgDbConnection CheckOut(string connectionString, PgDbConnection instance) { ! PgDbConnection newConnection = null; long now = System.DateTime.Now.Ticks; lock (typeof(PgConnectionPool)) { ! if (this.unlocked.Count > 0) { ! PgDbConnection[] list = new PgDbConnection[this.unlocked.Count]; ! this.unlocked.CopyTo(0, list, 0, list.Length); foreach (PgDbConnection connection in list) { ! if (this.Validate(connection, connectionString)) { if (connection.Lifetime != 0) *************** *** 109,135 **** if ((now - connection.Created) > connection.Lifetime) { ! unlocked.Remove(connection); ! Expire(connection); } else { ! unlocked.Remove(connection); ! locked.Add(connection); ! return(connection); } } else { ! unlocked.Remove(connection); ! locked.Add(connection); ! return(connection); } } else { ! unlocked.Remove(connection); ! Expire(connection); } } --- 109,135 ---- if ((now - connection.Created) > connection.Lifetime) { ! this.unlocked.Remove(connection); ! this.Expire(connection); } else { ! this.unlocked.Remove(connection); ! this.locked.Add(connection); ! return connection; } } else { ! this.unlocked.Remove(connection); ! this.locked.Add(connection); ! return connection; } } else { ! this.unlocked.Remove(connection); ! this.Expire(connection); } } *************** *** 138,142 **** if (instance == null) { ! newConnection = Create(connectionString); } else --- 138,142 ---- if (instance == null) { ! newConnection = this.Create(connectionString); } else *************** *** 148,155 **** newConnection.Created = System.DateTime.Now.Ticks; ! locked.Add(newConnection); } ! return(newConnection); } --- 148,155 ---- newConnection.Created = System.DateTime.Now.Ticks; ! this.locked.Add(newConnection); } ! return newConnection; } *************** *** 160,165 **** connection.Created = System.DateTime.Now.Ticks; ! locked.Remove(connection); ! unlocked.Add(connection); } } --- 160,165 ---- connection.Created = System.DateTime.Now.Ticks; ! this.locked.Remove(connection); ! this.unlocked.Add(connection); } } *************** *** 171,175 **** while (true) { ! CleanUp(null); Thread.Sleep(interval); --- 171,175 ---- while (true) { ! this.CleanUp(null); Thread.Sleep(interval); *************** *** 197,201 **** { return (connection.ConnectionString == connectionString && ! connection.Verify()); } catch (Exception ex) --- 197,201 ---- { return (connection.ConnectionString == connectionString && ! connection.Verify()); } catch (Exception ex) *************** *** 224,234 **** long now = System.DateTime.Now.Ticks; ! lock (unlocked.SyncRoot) { ! if (unlocked.Count > 0) { ! PgDbConnection[] list = new PgDbConnection[unlocked.Count]; ! ! unlocked.CopyTo(0, list, 0, list.Length); foreach (PgDbConnection connection in list) { --- 224,234 ---- long now = System.DateTime.Now.Ticks; ! lock (this.unlocked.SyncRoot) { ! if (this.unlocked.Count > 0) { ! PgDbConnection[] list = new PgDbConnection[this.unlocked.Count]; ! this.unlocked.CopyTo(0, list, 0, list.Length); ! foreach (PgDbConnection connection in list) { *************** *** 237,242 **** if ((now - connection.Created) >= connection.Lifetime) { ! unlocked.Remove(connection); ! Expire(connection); } } --- 237,242 ---- if ((now - connection.Created) >= connection.Lifetime) { ! this.unlocked.Remove(connection); ! this.Expire(connection); } } Index: PgError.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgError.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgError.cs 9 Feb 2004 14:19:22 -0000 1.3 --- PgError.cs 10 Apr 2004 21:35:36 -0000 1.4 *************** *** 43,102 **** public string Severity { ! get { return severity; } ! set { severity = value; } } public string Message { ! get { return message; } ! set { message = value; } } public string Code { ! get { return code; } ! set { code = value; } } public string Detail { ! get { return detail; } ! set { detail = value; } } public string Hint { ! get { return hint; } ! set { hint = value; } } public string Where { ! get { return where; } ! set { where = value; } } public string Position { ! get { return position; } ! set { position = value; } } public string File { ! get { return file; } ! set { file = value; } } public int Line { ! get { return line; } ! set { line = value; } } public string Routine { ! get { return routine; } ! set { routine = value; } } --- 43,102 ---- public string Severity { ! get { return this.severity; } ! set { this.severity = value; } } public string Message { ! get { return this.message; } ! set { this.message = value; } } public string Code { ! get { return this.code; } ! set { this.code = value; } } public string Detail { ! get { return this.detail; } ! set { this.detail = value; } } public string Hint { ! get { return this.hint; } ! set { this.hint = value; } } public string Where { ! get { return this.where; } ! set { this.where = value; } } public string Position { ! get { return this.position; } ! set { this.position = value; } } public string File { ! get { return this.file; } ! set { this.file = value; } } public int Line { ! get { return this.line; } ! set { this.line = value; } } public string Routine { ! get { return this.routine; } ! set { this.routine = value; } } Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PgDataReader.cs 6 Apr 2004 14:18:15 -0000 1.21 --- PgDataReader.cs 10 Apr 2004 21:35:36 -0000 1.22 *************** *** 125,142 **** public bool IsClosed { ! get { return !open; } } public int RecordsAffected { ! get { return IsClosed ? recordsAffected : -1; } } public bool HasRows { ! get ! { ! return command.Statement.HasRows; ! } } --- 125,139 ---- public bool IsClosed { ! get { return !this.open; } } public int RecordsAffected { ! get { return this.IsClosed ? this.recordsAffected : -1; } } public bool HasRows { ! get { return this.command.Statement.HasRows; } } *************** *** 203,207 **** if ((this.behavior == CommandBehavior.SingleRow && ! this.position != STARTPOS) || !this.command.Statement.HasRows) { --- 200,204 ---- if ((this.behavior == CommandBehavior.SingleRow && ! this.position != STARTPOS) || !this.command.Statement.HasRows) { *************** *** 215,219 **** this.position++; ! row = command.Statement.FetchRow(); read = (this.row == null) ? false : true; --- 212,216 ---- this.position++; ! row = this.command.Statement.FetchRow(); read = (this.row == null) ? false : true; *************** *** 725,734 **** public IDataReader GetData(int i) { ! if (position == STARTPOS) ! { ! throw new InvalidOperationException("There are no data to read."); ! } ! ! return getData(i); } --- 722,726 ---- public IDataReader GetData(int i) { ! throw new NotSupportedException(); } *************** *** 770,778 **** } - private IDataReader getData(int i) - { - return null; - } - private int getOrdinal(string name) { --- 762,765 ---- *************** *** 812,851 **** private Type getFieldType(int i) { ! return command.Statement.RowDescriptor.Fields[i].DataType.SystemType; } private PgDbType getProviderType(int i) { ! return (PgDbType)command.Statement.RowDescriptor.Fields[i].DataType.DataType; } private string getDataTypeName(int i) { ! return command.Statement.RowDescriptor.Fields[i].DataType.Name; } private object getValue(int i) { ! return row[i]; } private bool isNumeric(int i) { ! if (i < 0 || i >= FieldCount) { throw new IndexOutOfRangeException("Could not find specified column in results."); } ! return command.Statement.RowDescriptor.Fields[i].DataType.IsNumeric(); } private bool isLong(int i) { ! if (i < 0 || i >= FieldCount) { throw new IndexOutOfRangeException("Could not find specified column in results."); } ! return command.Statement.RowDescriptor.Fields[i].DataType.IsLong(); } --- 799,838 ---- private Type getFieldType(int i) { ! return this.command.Statement.RowDescriptor.Fields[i].DataType.SystemType; } private PgDbType getProviderType(int i) { ! return (PgDbType)this.command.Statement.RowDescriptor.Fields[i].DataType.DataType; } private string getDataTypeName(int i) { ! return this.command.Statement.RowDescriptor.Fields[i].DataType.Name; } private object getValue(int i) { ! return this.row[i]; } private bool isNumeric(int i) { ! if (i < 0 || i >= this.FieldCount) { throw new IndexOutOfRangeException("Could not find specified column in results."); } ! return this.command.Statement.RowDescriptor.Fields[i].DataType.IsNumeric(); } private bool isLong(int i) { ! if (i < 0 || i >= this.FieldCount) { throw new IndexOutOfRangeException("Could not find specified column in results."); } ! return this.command.Statement.RowDescriptor.Fields[i].DataType.IsLong(); } *************** *** 854,858 **** bool returnValue = false; ! if (row[i] == System.DBNull.Value) { returnValue = true; --- 841,845 ---- bool returnValue = false; ! if (this.row[i] == System.DBNull.Value) { returnValue = true; *************** *** 872,877 **** bool returnValue = false; ! if (command.Statement.RowDescriptor.Fields[i].OidNumber == 0 && ! command.Statement.RowDescriptor.Fields[i].OidTable == 0) { returnValue = true; --- 859,864 ---- bool returnValue = false; ! if (this.command.Statement.RowDescriptor.Fields[i].OidNumber == 0 && ! this.command.Statement.RowDescriptor.Fields[i].OidTable == 0) { returnValue = true; *************** *** 915,920 **** if (this.command.RecordsAffected != -1) { ! this.recordsAffected = ! this.recordsAffected == -1 ? 0 : this.recordsAffected; this.recordsAffected += this.command.RecordsAffected; } --- 902,906 ---- if (this.command.RecordsAffected != -1) { ! this.recordsAffected = this.recordsAffected == -1 ? 0 : this.recordsAffected; this.recordsAffected += this.command.RecordsAffected; } Index: PgErrorCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgErrorCollection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgErrorCollection.cs 6 Mar 2004 14:51:23 -0000 1.5 --- PgErrorCollection.cs 10 Apr 2004 21:35:36 -0000 1.6 *************** *** 38,73 **** public PgError this[string errorMessage] { ! get { return (PgError)errors[errors.IndexOf(errorMessage)]; } ! set { errors[errors.IndexOf(errorMessage)] = (PgError)value; } } public PgError this[int errorIndex] { ! get { return (PgError)errors[errorIndex]; } ! set { errors[errorIndex] = (PgError)value; } } public int Count { ! get { return errors.Count; } } public bool IsSynchronized { ! get { return errors.IsSynchronized; } } public object SyncRoot { ! get { return errors.SyncRoot; } } #endregion ! #region constructors internal PgErrorCollection() { ! errors = new ArrayList(); } --- 38,73 ---- public PgError this[string errorMessage] { ! get { return (PgError)this.errors[errors.IndexOf(errorMessage)]; } ! set { this.errors[errors.IndexOf(errorMessage)] = (PgError)value; } } public PgError this[int errorIndex] { ! get { return (PgError)this.errors[errorIndex]; } ! set { this.errors[errorIndex] = (PgError)value; } } public int Count { ! get { return this.errors.Count; } } public bool IsSynchronized { ! get { return this.errors.IsSynchronized; } } public object SyncRoot { ! get { return this.errors.SyncRoot; } } #endregion ! #region Constructors internal PgErrorCollection() { ! this.errors = new ArrayList(); } *************** *** 83,92 **** public void CopyTo(Array array, int index) { ! errors.CopyTo(array, index); } internal PgError Add(PgError error) { ! errors.Add(error); return error; --- 83,92 ---- public void CopyTo(Array array, int index) { ! this.errors.CopyTo(array, index); } internal PgError Add(PgError error) { ! this.errors.Add(error); return error; *************** *** 97,101 **** PgError error = new PgError(severity, code, message); ! return Add(error); } --- 97,101 ---- PgError error = new PgError(severity, code, message); ! return this.Add(error); } Index: PgParameterCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgParameterCollection.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgParameterCollection.cs 6 Mar 2004 14:51:23 -0000 1.7 --- PgParameterCollection.cs 10 Apr 2004 21:35:36 -0000 1.8 *************** *** 53,58 **** object IList.this[int parameterIndex] { ! get { return (PgParameter)parameters[parameterIndex]; } ! set { parameters[parameterIndex] = (PgParameter)value; } } --- 53,58 ---- object IList.this[int parameterIndex] { ! get { return (PgParameter)this.parameters[parameterIndex]; } ! set { this.parameters[parameterIndex] = (PgParameter)value; } } *************** *** 61,66 **** public PgParameter this[int parameterIndex] { ! get { return (PgParameter)parameters[parameterIndex]; } ! set { parameters[parameterIndex] = (PgParameter)value; } } --- 61,66 ---- public PgParameter this[int parameterIndex] { ! get { return (PgParameter)this.parameters[parameterIndex]; } ! set { this.parameters[parameterIndex] = (PgParameter)value; } } *************** *** 75,93 **** #endregion ! #region ILIST_PROPERTIES bool IList.IsFixedSize { ! get { return parameters.IsFixedSize; } } bool IList.IsReadOnly { ! get { return parameters.IsReadOnly; } } #endregion ! #region ICOLLECTION_PROPERTIES [Browsable(false), --- 75,93 ---- #endregion ! #region IList Properties bool IList.IsFixedSize { ! get { return this.parameters.IsFixedSize; } } bool IList.IsReadOnly { ! get { return this.parameters.IsReadOnly; } } #endregion ! #region ICollection Properties [Browsable(false), *************** *** 95,136 **** public int Count { ! get { return parameters.Count; } } bool ICollection.IsSynchronized { ! get { return parameters.IsSynchronized; } } object ICollection.SyncRoot { ! get { return parameters.SyncRoot; } } #endregion ! #region ICOLLECTION_METHODS public void CopyTo(Array array, int index) { ! parameters.CopyTo(array, index); } #endregion ! #region ILIST_METHODS public void Clear() { ! parameters.Clear(); } #endregion ! #region IENUMERABLE_METHODS public IEnumerator GetEnumerator() { ! return parameters.GetEnumerator(); } --- 95,136 ---- public int Count { ! get { return this.parameters.Count; } } bool ICollection.IsSynchronized { ! get { return this.parameters.IsSynchronized; } } object ICollection.SyncRoot { ! get { return this.parameters.SyncRoot; } } #endregion ! #region ICollection Methods public void CopyTo(Array array, int index) { ! this.parameters.CopyTo(array, index); } #endregion ! #region IList Methods public void Clear() { ! this.parameters.Clear(); } #endregion ! #region IEnumerable Methods public IEnumerator GetEnumerator() { ! return this.parameters.GetEnumerator(); } *************** *** 141,155 **** public bool Contains(object value) { ! return parameters.Contains(value); } public bool Contains(string parameterName) { ! return(-1 != IndexOf(parameterName)); } public int IndexOf(object value) { ! return parameters.IndexOf(value); } --- 141,155 ---- public bool Contains(object value) { ! return this.parameters.Contains(value); } public bool Contains(string parameterName) { ! return (-1 != this.IndexOf(parameterName)); } public int IndexOf(object value) { ! return this.parameters.IndexOf(value); } *************** *** 160,167 **** foreach (PgParameter item in this.parameters) { ! if (cultureAwareCompare(item.ParameterName, parameterName)) { return index; } index++; } --- 160,168 ---- foreach (PgParameter item in this.parameters) { ! if (this.cultureAwareCompare(item.ParameterName, parameterName)) { return index; } + index++; } *************** *** 172,176 **** public void Insert(int index, object value) { ! parameters.Insert(index, value); } --- 173,177 ---- public void Insert(int index, object value) { ! this.parameters.Insert(index, value); } *************** *** 182,191 **** } ! if (!Contains(value)) { throw new SystemException("The parameter does not exist in the collection."); } ! parameters.Remove(value); } --- 183,192 ---- } ! if (!this.Contains(value)) { throw new SystemException("The parameter does not exist in the collection."); } ! this.parameters.Remove(value); } *************** *** 197,201 **** public void RemoveAt(string parameterName) { ! RemoveAt(IndexOf(parameterName)); } --- 198,202 ---- public void RemoveAt(string parameterName) { ! this.RemoveAt(IndexOf(parameterName)); } *************** *** 207,211 **** } ! return parameters.Add((PgParameter)value); } --- 208,212 ---- } ! return this.parameters.Add((PgParameter)value); } *************** *** 214,218 **** if (param.ParameterName != null) { ! parameters.Add(param); return param; --- 215,219 ---- if (param.ParameterName != null) { ! this.parameters.Add(param); return param; Index: PgNotificationEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgNotificationEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgNotificationEventArgs.cs 9 Feb 2004 14:19:22 -0000 1.2 --- PgNotificationEventArgs.cs 10 Apr 2004 21:35:36 -0000 1.3 *************** *** 23,49 **** namespace PostgreSql.Data.PgSqlClient { public delegate void PgNotificationEventHandler(object sender, PgNotificationEventArgs e); public sealed class PgNotificationEventArgs : EventArgs { private int processID; private string condition; private string aditional; public int ProcessID { ! get { return processID; } } public string Condition { ! get { return condition; } } public string Aditional { ! get { return aditional; } } internal PgNotificationEventArgs(int processID, string condition, string addtional) { --- 23,63 ---- namespace PostgreSql.Data.PgSqlClient { + #region Delegates + public delegate void PgNotificationEventHandler(object sender, PgNotificationEventArgs e); + #endregion + public sealed class PgNotificationEventArgs : EventArgs { + #region Fields + private int processID; private string condition; private string aditional; + #endregion + + #region Properties + public int ProcessID { ! get { return this.processID; } } public string Condition { ! get { return this.condition; } } public string Aditional { ! get { return this.aditional; } } + #endregion + + #region Constructors + internal PgNotificationEventArgs(int processID, string condition, string addtional) { *************** *** 52,55 **** --- 66,71 ---- this.aditional = aditional; } + + #endregion } } Index: PgParameter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgParameter.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PgParameter.cs 9 Feb 2004 14:19:22 -0000 1.11 --- PgParameter.cs 10 Apr 2004 21:35:36 -0000 1.12 *************** *** 41,45 **** int size; PgDbType pgDbType; ! bool defaultCtor; #endregion --- 41,45 ---- int size; PgDbType pgDbType; ! bool inferType; #endregion *************** *** 49,54 **** string IDataParameter.ParameterName { ! get { return ParameterName; } ! set { ParameterName = value; } } --- 49,54 ---- string IDataParameter.ParameterName { ! get { return this.ParameterName; } ! set { this.ParameterName = value; } } *************** *** 56,61 **** public string ParameterName { ! get { return parameterName; } ! set { parameterName = value; } } --- 56,61 ---- public string ParameterName { ! get { return this.parameterName; } ! set { this.parameterName = value; } } *************** *** 63,68 **** public byte Precision { ! get { return precision; } ! set { precision = value; } } --- 63,68 ---- public byte Precision { ! get { return this.precision; } ! set { this.precision = value; } } *************** *** 70,75 **** public byte Scale { ! get { return scale; } ! set { scale = value; } } --- 70,75 ---- public byte Scale { ! get { return this.scale; } ! set { this.scale = value; } } *************** *** 77,82 **** public int Size { ! get { return size; } ! set { size = value; } } --- 77,82 ---- public int Size { ! get { return this.size; } ! set { this.size = value; } } *************** *** 87,92 **** public DbType DbType { ! get { return PgDbTypeToDbType(pgDbType); } ! set { pgDbType = dbTypeToPgType(value); } } --- 87,92 ---- public DbType DbType { ! get { return this.PgDbTypeToDbType(this.pgDbType); } ! set { this.pgDbType = this.dbTypeToPgType(value); } } *************** *** 96,101 **** public PgDbType PgDbType { ! get { return pgDbType; } ! set { pgDbType = value; } } --- 96,104 ---- public PgDbType PgDbType { ! get { return this.pgDbType; } ! set ! { ! this.pgDbType = value; ! } } *************** *** 103,108 **** public ParameterDirection Direction { ! get { return direction; } ! set { direction = value; } } --- 106,111 ---- public ParameterDirection Direction { ! get { return this.direction; } ! set { this.direction = value; } } *************** *** 113,118 **** public bool IsNullable { ! get { return isNullable; } ! set { isNullable = value; } } --- 116,121 ---- public bool IsNullable { ! get { return this.isNullable; } ! set { this.isNullable = value; } } *************** *** 120,125 **** public string SourceColumn { ! get { return sourceColumn; } ! set { sourceColumn = value; } } --- 123,128 ---- public string SourceColumn { ! get { return this.sourceColumn; } ! set { this.sourceColumn = value; } } *************** *** 127,132 **** public DataRowVersion SourceVersion { ! get { return sourceVersion; } ! set { sourceVersion = value; } } --- 130,135 ---- public DataRowVersion SourceVersion { ! get { return this.sourceVersion; } ! set { this.sourceVersion = value; } } *************** *** 144,150 **** } this.value = value; ! if (defaultCtor) { ! setPgTypeFromValue(this.value); } } --- 147,153 ---- } this.value = value; ! if (this.inferType) { ! this.setPgTypeFromValue(this.value); } } *************** *** 161,170 **** this.isNullable = false; this.pgDbType = PgDbType.VarChar; ! this.defaultCtor = true; } public PgParameter(string parameterName, object value) : this() { ! this.defaultCtor = false; this.parameterName = parameterName; this.value = value; --- 164,173 ---- this.isNullable = false; this.pgDbType = PgDbType.VarChar; ! this.inferType = true; } public PgParameter(string parameterName, object value) : this() { ! this.inferType = false; this.parameterName = parameterName; this.value = value; *************** *** 173,177 **** public PgParameter(string parameterName, PgDbType dbType) : this() { ! this.defaultCtor = false; this.parameterName = parameterName; this.pgDbType = dbType; --- 176,180 ---- public PgParameter(string parameterName, PgDbType dbType) : this() { ! this.inferType = false; this.parameterName = parameterName; this.pgDbType = dbType; *************** *** 180,184 **** public PgParameter(string parameterName, PgDbType dbType, int size) : this() { ! this.defaultCtor = false; this.parameterName = parameterName; this.pgDbType = dbType; --- 183,187 ---- public PgParameter(string parameterName, PgDbType dbType, int size) : this() { ! this.inferType = false; this.parameterName = parameterName; this.pgDbType = dbType; *************** *** 186,192 **** } ! public PgParameter(string parameterName, PgDbType dbType, int size, string sourceColumn) : this() { ! this.defaultCtor = false; this.parameterName = parameterName; this.pgDbType = dbType; --- 189,199 ---- } ! public PgParameter( ! string parameterName, ! PgDbType dbType, ! int size, ! string sourceColumn) : this() { ! this.inferType = false; this.parameterName = parameterName; this.pgDbType = dbType; *************** *** 196,211 **** [EditorBrowsable(EditorBrowsableState.Advanced)] ! public PgParameter(string parameterName, ! PgDbType dbType, ! int size, ! ParameterDirection direction, ! bool isNullable, ! byte precision, ! byte scale, ! string sourceColumn, ! DataRowVersion sourceVersion, ! object value) { ! this.defaultCtor = false; this.parameterName = parameterName; this.pgDbType = dbType; --- 203,219 ---- [EditorBrowsable(EditorBrowsableState.Advanced)] ! public PgParameter( ! string parameterName, ! PgDbType dbType, ! int size, ! ParameterDirection direction, ! bool isNullable, ! byte precision, ! byte scale, ! string sourceColumn, ! DataRowVersion sourceVersion, ! object value) { ! this.inferType = false; this.parameterName = parameterName; this.pgDbType = dbType; *************** *** 226,239 **** object ICloneable.Clone() { ! return new PgParameter(parameterName, ! PgDbType, ! size, ! direction, ! isNullable, ! precision, ! scale, ! sourceColumn, ! sourceVersion, ! value); } --- 234,248 ---- object ICloneable.Clone() { ! return new PgParameter( ! this.parameterName, ! this.PgDbType, ! this.size, ! this.direction, ! this.isNullable, ! this.precision, ! this.scale, ! this.sourceColumn, ! this.sourceVersion, ! this.value); } *************** *** 388,396 **** { case TypeCode.Byte: ! PgDbType = PgDbType.Byte; break; case TypeCode.Boolean: ! PgDbType = PgDbType.Boolean; break; --- 397,405 ---- { case TypeCode.Byte: ! this.pgDbType = PgDbType.Byte; break; case TypeCode.Boolean: ! this.pgDbType = PgDbType.Boolean; break; *************** *** 401,433 **** case TypeCode.String: case TypeCode.Char: ! PgDbType = PgDbType.Char; break; case TypeCode.Int16: ! PgDbType = PgDbType.Int2; break; case TypeCode.Int32: ! PgDbType = PgDbType.Int4; break; case TypeCode.Int64: ! PgDbType = PgDbType.Int8; break; case TypeCode.Single: ! PgDbType = PgDbType.Float; break; case TypeCode.Double: ! PgDbType = PgDbType.Double; break; case TypeCode.Decimal: ! PgDbType = PgDbType.Decimal; break; case TypeCode.DateTime: ! PgDbType = PgDbType.Timestamp; break; --- 410,442 ---- case TypeCode.String: case TypeCode.Char: ! this.pgDbType = PgDbType.Char; break; case TypeCode.Int16: ! this.pgDbType = PgDbType.Int2; break; case TypeCode.Int32: ! this.pgDbType = PgDbType.Int4; break; case TypeCode.Int64: ! this.pgDbType = PgDbType.Int8; break; case TypeCode.Single: ! this.pgDbType = PgDbType.Float; break; case TypeCode.Double: ! this.pgDbType = PgDbType.Double; break; case TypeCode.Decimal: ! this.pgDbType = PgDbType.Decimal; break; case TypeCode.DateTime: ! this.pgDbType = PgDbType.Timestamp; break; *************** *** 447,451 **** private DbType PgDbTypeToDbType(PgDbType PgDbType) { ! switch(PgDbType) { case PgDbType.Boolean: --- 456,460 ---- private DbType PgDbTypeToDbType(PgDbType PgDbType) { ! switch(this.pgDbType) { case PgDbType.Boolean: Index: PgDataAdapter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataAdapter.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgDataAdapter.cs 9 Feb 2004 14:19:22 -0000 1.6 --- PgDataAdapter.cs 10 Apr 2004 21:35:36 -0000 1.7 *************** *** 26,30 **** namespace PostgreSql.Data.PgSqlClient { ! #region DELEGATES public delegate void PgRowUpdatedEventHandler(object sender, PgRowUpdatedEventArgs e); --- 26,30 ---- namespace PostgreSql.Data.PgSqlClient { ! #region Delegates public delegate void PgRowUpdatedEventHandler(object sender, PgRowUpdatedEventArgs e); *************** *** 59,82 **** IDbCommand IDbDataAdapter.SelectCommand { ! get { return selectCommand; } ! set { selectCommand = (PgCommand)value; } } IDbCommand IDbDataAdapter.InsertCommand { ! get { return insertCommand; } ! set { insertCommand = (PgCommand)value; } } IDbCommand IDbDataAdapter.UpdateCommand { ! get { return updateCommand; } ! set { updateCommand = (PgCommand)value; } } IDbCommand IDbDataAdapter.DeleteCommand { ! get { return deleteCommand; } ! set { deleteCommand = (PgCommand)value; } } --- 59,82 ---- IDbCommand IDbDataAdapter.SelectCommand { ! get { return this.selectCommand; } ! set { this.selectCommand = (PgCommand)value; } } IDbCommand IDbDataAdapter.InsertCommand { ! get { return this.insertCommand; } ! set { this.insertCommand = (PgCommand)value; } } IDbCommand IDbDataAdapter.UpdateCommand { ! get { return this.updateCommand; } ! set { this.updateCommand = (PgCommand)value; } } IDbCommand IDbDataAdapter.DeleteCommand { ! get { return this.deleteCommand; } ! set { this.deleteCommand = (PgCommand)value; } } *************** *** 84,89 **** public PgCommand SelectCommand { ! get { return selectCommand; } ! set { selectCommand = value; } } --- 84,89 ---- public PgCommand SelectCommand { ! get { return this.selectCommand; } ! set { this.selectCommand = value; } } *************** *** 91,96 **** public PgCommand InsertCommand { ! get { return insertCommand; } ! set { insertCommand = value; } } --- 91,96 ---- public PgCommand InsertCommand { ! get { return this.insertCommand; } ! set { this.insertCommand = value; } } *************** *** 98,103 **** public PgCommand UpdateCommand { ! get { return updateCommand; } ! set { updateCommand = value; } } --- 98,103 ---- public PgCommand UpdateCommand { ! get { return this.updateCommand; } ! set { this.updateCommand = value; } } *************** *** 105,110 **** public PgCommand DeleteCommand { ! get { return deleteCommand; } ! set { deleteCommand = value; } } --- 105,110 ---- public PgCommand DeleteCommand { ! get { return this.deleteCommand; } ! set { this.deleteCommand = value; } } *************** *** 145,159 **** if (disposing) { ! if (selectCommand != null) { ! selectCommand.Dispose(); } ! if (insertCommand != null) { ! insertCommand.Dispose(); } ! if (updateCommand != null) { ! updateCommand.Dispose(); } } --- 145,159 ---- if (disposing) { ! if (this.selectCommand != null) { ! this.selectCommand.Dispose(); } ! if (this.insertCommand != null) { ! this.insertCommand.Dispose(); } ! if (this.updateCommand != null) { ! this.updateCommand.Dispose(); } } Index: PgTransaction.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTransaction.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgTransaction.cs 9 Feb 2004 14:19:22 -0000 1.6 --- PgTransaction.cs 10 Apr 2004 21:35:36 -0000 1.7 *************** *** 40,44 **** IDbConnection IDbTransaction.Connection { ! get { return Connection; } } --- 40,44 ---- IDbConnection IDbTransaction.Connection { ! get { return this.Connection; } } *************** *** 60,78 **** public IsolationLevel IsolationLevel { ! get { return isolationLevel; } } internal bool IsUpdated { ! get { return isUpdated; } set { ! if (connection != null && ! value) { ! connection.ActiveTransaction = null; ! connection = null; } ! isUpdated = value; } } --- 60,77 ---- public IsolationLevel IsolationLevel { ! get { return this.isolationLevel; } } internal bool IsUpdated { ! get { return this.isUpdated; } set { ! if (this.connection != null && value) { ! this.connection.ActiveTransaction = null; ! this.connection = null; } ! this.isUpdated = value; } } *************** *** 84,88 **** private PgTransaction() { ! isolationLevel = IsolationLevel.ReadCommitted; } --- 83,87 ---- private PgTransaction() { ! this.isolationLevel = IsolationLevel.ReadCommitted; } *************** *** 118,122 **** private void Dispose(bool disposing) { ! if (!disposed) { if (disposing) --- 117,121 ---- private void Dispose(bool disposing) { ! if (!this.disposed) { if (disposing) *************** *** 124,128 **** try { ! if (connection != null && !isUpdated) { // Implicitly roll back if the transaction still valid. --- 123,127 ---- try { ! if (this.connection != null && !this.isUpdated) { // Implicitly roll back if the transaction still valid. *************** *** 132,142 **** finally { ! if (connection != null) { ! connection.ActiveTransaction = null; ! connection = null; } ! disposed = true; ! isUpdated = true; } } --- 131,141 ---- finally { ! if (this.connection != null) { ! this.connection.ActiveTransaction = null; ! this.connection = null; } ! this.disposed = true; ! this.isUpdated = true; } } *************** *** 150,158 **** public void Commit() { ! if (isUpdated) { throw new InvalidOperationException("This Transaction has completed; it is no longer usable."); } ! if (Connection.DataReader != null) { throw new InvalidOperationException("PgCommand is currently busy Open, Fetching."); --- 149,157 ---- public void Commit() { ! if (this.isUpdated) { throw new InvalidOperationException("This Transaction has completed; it is no longer usable."); } ! if (this.Connection.DataReader != null) { throw new InvalidOperationException("PgCommand is currently busy Open, Fetching."); *************** *** 161,167 **** try { ! connection.DbConnection.DB.CommitTransaction(); ! IsUpdated = true; } catch (PgClientException ex) --- 160,166 ---- try { ! this.connection.DbConnection.DB.CommitTransaction(); ! this.IsUpdated = true; } catch (PgClientException ex) *************** *** 173,181 **** public void Rollback() { ! if (isUpdated) { throw new InvalidOperationException("This Transaction has completed; it is no longer usable."); } ! if (Connection.DataReader != null) { throw new InvalidOperationException("PgCommand is currently busy Open, Fetching."); --- 172,180 ---- public void Rollback() { ! if (this.isUpdated) { throw new InvalidOperationException("This Transaction has completed; it is no longer usable."); } ! if (this.Connection.DataReader != null) { throw new InvalidOperationException("PgCommand is currently busy Open, Fetching."); *************** *** 184,190 **** try { ! connection.DbConnection.DB.RollbackTransction(); ! IsUpdated = true; } catch (PgClientException ex) --- 183,189 ---- try { ! this.connection.DbConnection.DB.RollbackTransction(); ! this.IsUpdated = true; } catch (PgClientException ex) *************** *** 198,204 **** try { ! connection.DbConnection.DB.BeginTransaction(isolationLevel); ! IsUpdated = false; } catch (PgClientException ex) --- 197,203 ---- try { ! this.connection.DbConnection.DB.BeginTransaction(isolationLevel); ! this.IsUpdated = false; } catch (PgClientException ex) |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 20:30:02
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12320 Modified Files: changelog.txt Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Started cleanup and unification of this keyword usage tasks. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** changelog.txt 1 Apr 2004 16:42:06 -0000 1.111 --- changelog.txt 10 Apr 2004 20:16:31 -0000 1.112 *************** *** 2,5 **** --- 2,47 ---- ------------------------------------------------------- + 2004-04-10 Carlos Guzman Alvarez <car...@te...> + + * Started cleanup and unification of this keyword usage tasks. + + * Mono.Security.Protocol.Tls/SslClientStream.cs: + * Mono.Security.Protocol.Tls/SslServerStream.cs: + * Mono.Security.Protocol.Tls/Alert.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: + * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: + * Mono.Security.Protocol.Tls/Context.cs: + * Mono.Security.Protocol.Tls/TlsException.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: + + - Reworked Alert and Exception (TlsException) handling. + + + 2004-04-09 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/TlsClientSettings.cs: + + - Added new CertificateRSA property. + + * Mono.Security.Protocol.Tls/SslHandshakeHash.cs: + + - Added two new methods: CreateSignature and VerifySignature. + + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: + + - Added Ssl3 implementation. + + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: + + - Added initial implementation. + 2004-04-1 Carlos Guzman Alvarez <car...@te...> |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12209 Modified Files: PgCharSet.cs PgCharSetCollection.cs PgClientError.cs PgClientErrorCollection.cs PgClientException.cs PgClientMessageEventArgs.cs PgClientNotificationEventArgs.cs PgConnectionParams.cs PgDbClient.cs PgFieldDescriptor.cs PgOutputPacket.cs PgParameter.cs PgResponsePacket.cs PgRowDescriptor.cs PgStatement.cs PgType.cs PgTypeCollection.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Started cleanup and unification of this keyword usage tasks. Index: PgResponsePacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgResponsePacket.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PgResponsePacket.cs 9 Feb 2004 14:20:45 -0000 1.24 --- PgResponsePacket.cs 10 Apr 2004 20:16:07 -0000 1.25 *************** *** 41,62 **** public char Message { ! get { return message; } ! set { message = value; } } public Encoding Encoding { ! get { return encoding; } ! set { encoding = value; } } public long Length { ! get { return ((MemoryStream)BaseStream).Length; } } public long Position { ! get { return ((MemoryStream)BaseStream).Position; } } --- 41,62 ---- public char Message { ! get { return this.message; } ! set { this.message = value; } } public Encoding Encoding { ! get { return this.encoding; } ! set { this.encoding = value; } } public long Length { ! get { return ((MemoryStream)this.BaseStream).Length; } } public long Position { ! get { return ((MemoryStream)this.BaseStream).Position; } } *************** *** 65,69 **** get { ! if (Position < Length) { return false; --- 65,69 ---- get { ! if (this.Position < this.Length) { return false; *************** *** 78,82 **** public long Pending { ! get { return Length - Position; } } --- 78,82 ---- public long Pending { ! get { return this.Length - this.Position; } } *************** *** 104,114 **** public void Reset() { ! ((MemoryStream)BaseStream).SetLength(0); ! ((MemoryStream)BaseStream).Position = 0; } public byte[] ToArray() { ! return ((MemoryStream)BaseStream).ToArray(); } --- 104,114 ---- public void Reset() { ! ((MemoryStream)this.BaseStream).SetLength(0); ! ((MemoryStream)this.BaseStream).Position = 0; } public byte[] ToArray() { ! return ((MemoryStream)this.BaseStream).ToArray(); } *************** *** 134,140 **** byte[] buffer = new byte[length]; ! Read(buffer, 0, length); ! return encoding.GetString(buffer); } --- 134,140 ---- byte[] buffer = new byte[length]; ! this.Read(buffer, 0, length); ! return this.encoding.GetString(buffer); } *************** *** 144,150 **** byte[] buffer = new byte[length]; ! Read(buffer, 0, length); ! return encoding.GetString(buffer); } --- 144,150 ---- byte[] buffer = new byte[length]; ! this.Read(buffer, 0, length); ! return this.encoding.GetString(buffer); } *************** *** 182,186 **** public float ReadCurrency() { ! float val = (float)ReadInt(); return val/100; --- 182,186 ---- public float ReadCurrency() { ! float val = (float)this.ReadInt(); return val/100; *************** *** 209,213 **** public DateTime ReadDate() { ! int days = ReadInt(); DateTime date = new DateTime(days); --- 209,213 ---- public DateTime ReadDate() { ! int days = this.ReadInt(); DateTime date = new DateTime(days); *************** *** 228,232 **** public DateTime ReadTime() { ! double seconds = ReadDouble(); return PgCodes.BASE_DATE.AddSeconds(seconds); --- 228,232 ---- public DateTime ReadTime() { ! double seconds = this.ReadDouble(); return PgCodes.BASE_DATE.AddSeconds(seconds); *************** *** 239,242 **** --- 239,243 ---- string sbFormat = "{0:D2}{1}{2:D2}{3}{4:D2}{5:D2}"; + if (timezone >= 0) { *************** *** 274,278 **** public DateTime ReadTimestamp() { ! double seconds = ReadDouble(); return PgCodes.BASE_DATE.AddSeconds(seconds); --- 275,279 ---- public DateTime ReadTimestamp() { ! double seconds = this.ReadDouble(); return PgCodes.BASE_DATE.AddSeconds(seconds); *************** *** 503,507 **** default: ! return ReadBytes(length); } } --- 504,508 ---- default: ! return this.ReadBytes(length); } } *************** *** 620,624 **** // Read array data ! byte[] sourceArray = decodeArrayData(elementType, data.Length, length); Buffer.BlockCopy(sourceArray, 0, data, 0, sourceArray.Length); --- 621,625 ---- // Read array data ! byte[] sourceArray = this.decodeArrayData(elementType, data.Length, length); Buffer.BlockCopy(sourceArray, 0, data, 0, sourceArray.Length); Index: PgTypeCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgTypeCollection.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgTypeCollection.cs 6 Mar 2004 14:52:50 -0000 1.9 --- PgTypeCollection.cs 10 Apr 2004 20:16:07 -0000 1.10 *************** *** 52,56 **** public bool Contains(int oid) { ! return(-1 != IndexOf(oid)); } --- 52,56 ---- public bool Contains(int oid) { ! return (-1 != this.IndexOf(oid)); } *************** *** 58,62 **** { int index = 0; ! foreach(PgType item in this) { if (item.Oid == oid) --- 58,63 ---- { int index = 0; ! ! foreach (PgType item in this) { if (item.Oid == oid) *************** *** 66,69 **** --- 67,71 ---- index++; } + return -1; } *************** *** 72,78 **** { int index = 0; foreach(PgType item in this) { ! if (cultureAwareCompare(item.Name, name)) { return index; --- 74,81 ---- { int index = 0; + foreach(PgType item in this) { ! if (this.cultureAwareCompare(item.Name, name)) { return index; *************** *** 80,83 **** --- 83,87 ---- index++; } + return -1; } *************** *** 85,89 **** public void RemoveAt(string typeName) { ! RemoveAt(IndexOf(typeName)); } --- 89,93 ---- public void RemoveAt(string typeName) { ! this.RemoveAt(IndexOf(typeName)); } Index: PgType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgType.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PgType.cs 9 Feb 2004 14:20:45 -0000 1.11 --- PgType.cs 10 Apr 2004 20:16:07 -0000 1.12 *************** *** 40,59 **** public int Oid { ! get { return oid; } } public PgDataType DataType { ! get { return dataType; } } public string Name { ! get { return name; } } public Type SystemType { ! get { return systemType; } } --- 40,59 ---- public int Oid { ! get { return this.oid; } } public PgDataType DataType { ! get { return this.dataType; } } public string Name { ! get { return this.name; } } public Type SystemType { ! get { return this.systemType; } } *************** *** 75,84 **** public short FormatCode { ! get { return formatCode; } } public int Size { ! get { return size; } } --- 75,84 ---- public short FormatCode { ! get { return this.formatCode; } } public int Size { ! get { return this.size; } } *************** *** 110,116 **** this.dataType == PgDataType.Int4 || this.dataType == PgDataType.Int8 || ! this.dataType == PgDataType.Float || ! this.dataType == PgDataType.Double || ! this.dataType == PgDataType.Decimal || this.dataType == PgDataType.Byte) { --- 110,116 ---- this.dataType == PgDataType.Int4 || this.dataType == PgDataType.Int8 || ! this.dataType == PgDataType.Float || ! this.dataType == PgDataType.Double || ! this.dataType == PgDataType.Decimal || this.dataType == PgDataType.Byte) { Index: PgParameter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgParameter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgParameter.cs 9 Feb 2004 14:20:45 -0000 1.3 --- PgParameter.cs 10 Apr 2004 20:16:07 -0000 1.4 *************** *** 30,45 **** #endregion ! #region PARAMETERS public PgType DataType { ! get { return dataType; } ! set { dataType = value; } } public object Value { ! get { return data; } ! set { data = value; } } --- 30,45 ---- #endregion ! #region Properties public PgType DataType { ! get { return this.dataType; } ! set { this.dataType = value; } } public object Value { ! get { return this.data; } ! set { this.data = value; } } Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** PgDbClient.cs 8 Mar 2004 17:16:18 -0000 1.46 --- PgDbClient.cs 10 Apr 2004 20:16:07 -0000 1.47 *************** *** 30,35 **** --- 30,39 ---- namespace PostgreSql.Data.NPgClient { + #region Delegates + internal delegate void SslConnectionCallback(); + #endregion + internal class PgDbClient { *************** *** 85,129 **** public int Handle { ! get { return handle; } ! set { handle = value; } } public int SecretKey { ! get { return secretKey; } ! set { secretKey = value; } } public Hashtable ParameterStatus { ! get { return parameterStatus; } ! set { parameterStatus = value; } } ! public BinaryReader Receive { ! get { return receive; } } ! public BinaryWriter Send { ! get { return send; } } ! public PgConnectionParams Settings { ! get { return settings; } ! set { settings = value; } } ! public SslClientStream SslClientStream { ! get { return sslStream; } } ! public SslConnectionCallback SslConnectionDelegate { ! get { return this.SslConnection; } ! set { this.SslConnection = value; } } --- 89,137 ---- public int Handle { ! get { return this.handle; } ! set { this.handle = value; } } public int SecretKey { ! get { return this.secretKey; } ! set { this.secretKey = value; } } public Hashtable ParameterStatus { ! get { return this.parameterStatus; } ! set { this.parameterStatus = value; } } ! public PgConnectionParams Settings { ! get { return this.settings; } ! set { this.settings = value; } } ! public SslConnectionCallback SslConnectionDelegate { ! get { return this.SslConnection; } ! set { this.SslConnection = value; } } ! #endregion ! ! #region Internal Properties ! ! internal SslClientStream SslClientStream { ! get { return this.sslStream; } } ! internal BinaryReader Receive { ! get { return this.receive; } } ! internal BinaryWriter Send { ! get { return this.send; } } *************** *** 289,293 **** // Perform a sync ! Sync(); throw ex; --- 297,301 ---- // Perform a sync ! this.Sync(); throw ex; *************** *** 304,313 **** case PgBackendCodes.NOTIFICATION_RESPONSE: ! { ! processNotificationResponse(responsePacket); ! } ! break; ! ! default: break; } --- 312,316 ---- case PgBackendCodes.NOTIFICATION_RESPONSE: ! this.processNotificationResponse(responsePacket); break; } *************** *** 329,336 **** --- 332,341 ---- 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; *************** *** 349,367 **** { case PgBackendCodes.AUTHENTICATION: ! processAuthPacket(packet); break; case PgBackendCodes.PARAMETER_STATUS: ! processParameterStatus(packet); break; case PgBackendCodes.READY_FOR_QUERY: ! transactionStatus = packet.ReadChar(); break; case PgBackendCodes.BACKEND_KEY_DATA: // BackendKeyData ! Handle = packet.ReadInt(); ! SecretKey = packet.ReadInt(); break; } --- 354,372 ---- { case PgBackendCodes.AUTHENTICATION: ! this.processAuthPacket(packet); break; case PgBackendCodes.PARAMETER_STATUS: ! this.processParameterStatus(packet); break; case PgBackendCodes.READY_FOR_QUERY: ! this.transactionStatus = packet.ReadChar(); break; case PgBackendCodes.BACKEND_KEY_DATA: // BackendKeyData ! this.Handle = packet.ReadInt(); ! this.SecretKey = packet.ReadInt(); break; } *************** *** 421,426 **** // Second calculate md5 of password + user string userHash = MD5Authentication.GetMD5Hash( ! settings.Encoding.GetBytes(settings.UserName), ! settings.UserPassword); // Third calculate real MD5 hash --- 426,431 ---- // Second calculate md5 of password + user string userHash = MD5Authentication.GetMD5Hash( ! settings.Encoding.GetBytes(settings.UserName), ! settings.UserPassword); // Third calculate real MD5 hash *************** *** 505,510 **** string additional = packet.ReadNullString(); ! // Raise an event as an InfoMessage ! Notification(this, new PgClientNotificationEventArgs(processID, condition, additional)); } --- 510,517 ---- string additional = packet.ReadNullString(); ! if (this.Notification != null) ! { ! this.Notification(this, new PgClientNotificationEventArgs(processID, condition, additional)); ! } } *************** *** 542,546 **** } ! transactionStatus = stmt.TransactionStatus; } --- 549,553 ---- } ! this.transactionStatus = stmt.TransactionStatus; } *************** *** 555,559 **** } ! transactionStatus = stmt.TransactionStatus; } --- 562,566 ---- } ! this.transactionStatus = stmt.TransactionStatus; } *************** *** 568,572 **** } ! transactionStatus = stmt.TransactionStatus; } --- 575,579 ---- } ! this.transactionStatus = stmt.TransactionStatus; } *************** *** 608,613 **** while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = ReceiveResponsePacket(); ! processResponsePacket(response); } } --- 615,620 ---- while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = this.ReceiveResponsePacket(); ! this.processResponsePacket(response); } } *************** *** 617,622 **** while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = ReceiveResponsePacket(); ! processResponsePacket(response); } --- 624,629 ---- while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = this.ReceiveResponsePacket(); ! this.processResponsePacket(response); } *************** *** 807,813 **** public void SendInfoMessage(PgClientException exception) { ! if (InfoMessage != null) { ! InfoMessage(this, new PgClientMessageEventArgs(exception)); } } --- 814,820 ---- public void SendInfoMessage(PgClientException exception) { ! if (this.InfoMessage != null) { ! this.InfoMessage(this, new PgClientMessageEventArgs(exception)); } } *************** *** 847,855 **** // Set Receive Buffer size. ! socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, settings.PacketSize); // Set Send Buffer size. ! socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, settings.PacketSize); --- 854,862 ---- // Set Receive Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, settings.PacketSize); // Set Send Buffer size. ! this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, settings.PacketSize); *************** *** 866,880 **** { // Close streams ! if (sslStream != null) { ! sslStream.Close(); } ! if (networkStream != null) { ! networkStream.Close(); } ! if (socket != null) { ! socket.Close(); } } --- 873,887 ---- { // Close streams ! if (this.sslStream != null) { ! this.sslStream.Close(); } ! if (this.networkStream != null) { ! this.networkStream.Close(); } ! if (this.socket != null) { ! this.socket.Close(); } } Index: PgRowDescriptor.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgRowDescriptor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgRowDescriptor.cs 9 Feb 2004 14:20:45 -0000 1.3 --- PgRowDescriptor.cs 10 Apr 2004 20:16:07 -0000 1.4 *************** *** 33,38 **** public PgFieldDescriptor[] Fields { ! get { return fields; } ! set { fields = value; } } --- 33,38 ---- public PgFieldDescriptor[] Fields { ! get { return this.fields; } ! set { this.fields = value; } } *************** *** 47,51 **** public PgRowDescriptor(int count) { ! fields = new PgFieldDescriptor[count]; } --- 47,51 ---- public PgRowDescriptor(int count) { ! this.fields = new PgFieldDescriptor[count]; } Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PgOutputPacket.cs 9 Feb 2004 14:20:45 -0000 1.23 --- PgOutputPacket.cs 10 Apr 2004 20:16:07 -0000 1.24 *************** *** 40,49 **** public long Position { ! get { return ((MemoryStream)BaseStream).Position; } } public long Length { ! get { return ((MemoryStream)BaseStream).Length; } } --- 40,49 ---- public long Position { ! get { return ((MemoryStream)this.BaseStream).Position; } } public long Length { ! get { return ((MemoryStream)this.BaseStream).Length; } } *************** *** 55,59 **** { this.encoding = Encoding.Default; ! Write(new byte[0]); } --- 55,59 ---- { this.encoding = Encoding.Default; ! this.Write(new byte[0]); } *************** *** 74,78 **** data += PgCodes.NULL_TERMINATOR; } ! this.Write(encoding.GetBytes(data)); } --- 74,79 ---- data += PgCodes.NULL_TERMINATOR; } ! ! this.Write(this.encoding.GetBytes(data)); } *************** *** 222,225 **** --- 223,227 ---- { this.WriteInt(polygon.Points.Length); + for (int i = 0; i < polygon.Points.Length; i++) { *************** *** 232,235 **** --- 234,238 ---- this.Write(path.IsClosedPath); this.WriteInt(path.Points.Length); + for (int i = 0; i < path.Points.Length; i++) { *************** *** 444,459 **** public int GetByteCount() { ! return (int)((MemoryStream)BaseStream).Length; } public byte[] ToArray() { ! return ((MemoryStream)BaseStream).ToArray(); } public void Reset() { ! ((MemoryStream)BaseStream).SetLength(0); ! ((MemoryStream)BaseStream).Position = 0; } --- 447,462 ---- public int GetByteCount() { ! return (int)((MemoryStream)this.BaseStream).Length; } public byte[] ToArray() { ! return ((MemoryStream)this.BaseStream).ToArray(); } public void Reset() { ! ((MemoryStream)this.BaseStream).SetLength(0); ! ((MemoryStream)this.BaseStream).Position = 0; } Index: PgClientErrorCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientErrorCollection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgClientErrorCollection.cs 6 Mar 2004 14:51:43 -0000 1.5 --- PgClientErrorCollection.cs 10 Apr 2004 20:16:07 -0000 1.6 *************** *** 45,49 **** public bool Contains(string errorMessage) { ! return(-1 != IndexOf(errorMessage)); } --- 45,49 ---- public bool Contains(string errorMessage) { ! return (-1 != this.IndexOf(errorMessage)); } *************** *** 51,57 **** { int index = 0; foreach(PgClientError item in this) { ! if (cultureAwareCompare(item.Message, errorMessage)) { return index; --- 51,58 ---- { int index = 0; + foreach(PgClientError item in this) { ! if (this.cultureAwareCompare(item.Message, errorMessage)) { return index; *************** *** 59,62 **** --- 60,64 ---- index++; } + return -1; } *************** *** 64,68 **** public void RemoveAt(string errorMessage) { ! RemoveAt(IndexOf(errorMessage)); } --- 66,70 ---- public void RemoveAt(string errorMessage) { ! this.RemoveAt(IndexOf(errorMessage)); } Index: PgClientError.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientError.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgClientError.cs 9 Feb 2004 14:20:45 -0000 1.3 --- PgClientError.cs 10 Apr 2004 20:16:07 -0000 1.4 *************** *** 42,101 **** public string Severity { ! get { return severity; } ! set { severity = value; } } public string Message { ! get { return message; } ! set { message = value; } } public string Code { ! get { return code; } ! set { code = value; } } public string Detail { ! get { return detail; } ! set { detail = value; } } public string Hint { ! get { return hint; } ! set { hint = value; } } public string Where { ! get { return where; } ! set { where = value; } } public string Position { ! get { return position; } ! set { position = value; } } public string File { ! get { return file; } ! set { file = value; } } public int Line { ! get { return line; } ! set { line = value; } } public string Routine { ! get { return routine; } ! set { routine = value; } } --- 42,101 ---- public string Severity { ! get { return this.severity; } ! set { this.severity = value; } } public string Message { ! get { return this.message; } ! set { this.message = value; } } public string Code { ! get { return this.code; } ! set { this.code = value; } } public string Detail { ! get { return this.detail; } ! set { this.detail = value; } } public string Hint { ! get { return this.hint; } ! set { this.hint = value; } } public string Where { ! get { return this.where; } ! set { this.where = value; } } public string Position { ! get { return this.position; } ! set { this.position = value; } } public string File { ! get { return this.file; } ! set { this.file = value; } } public int Line { ! get { return this.line; } ! set { this.line = value; } } public string Routine { ! get { return this.routine; } ! set { this.routine = value; } } *************** *** 110,114 **** public PgClientError(string message) { ! this.message = message; } --- 110,114 ---- public PgClientError(string message) { ! this.message = message; } *************** *** 121,128 **** #endregion - - #region Methods - - #endregion } } --- 121,124 ---- Index: PgFieldDescriptor.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgFieldDescriptor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgFieldDescriptor.cs 9 Feb 2004 14:20:45 -0000 1.3 --- PgFieldDescriptor.cs 10 Apr 2004 20:16:07 -0000 1.4 *************** *** 39,80 **** public string FieldName { ! get { return fieldName; } ! set { fieldName = value; } } public int OidTable { ! get { return oidTable; } ! set { oidTable = value; } } public short OidNumber { ! get { return oidNumber; } ! set { oidNumber = value; } } public PgType DataType { ! get { return dataType; } ! set { dataType = value; } } public short DataTypeSize { ! get { return dataTypeSize; } ! set { dataTypeSize = value; } } public int TypeModifier { ! get { return typeModifier; } ! set { typeModifier = value; } } public short FormatCode { ! get { return formatCode; } ! set { formatCode = value; } } --- 39,80 ---- public string FieldName { ! get { return this.fieldName; } ! set { this.fieldName = value; } } public int OidTable { ! get { return this.oidTable; } ! set { this.oidTable = value; } } public short OidNumber { ! get { return this.oidNumber; } ! set { this.oidNumber = value; } } public PgType DataType { ! get { return this.dataType; } ! set { this.dataType = value; } } public short DataTypeSize { ! get { return this.dataTypeSize; } ! set { this.dataTypeSize = value; } } public int TypeModifier { ! get { return this.typeModifier; } ! set { this.typeModifier = value; } } public short FormatCode { ! get { return this.formatCode; } ! set { this.formatCode = value; } } Index: PgCharSetCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCharSetCollection.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgCharSetCollection.cs 6 Mar 2004 14:51:43 -0000 1.5 --- PgCharSetCollection.cs 10 Apr 2004 20:16:07 -0000 1.6 *************** *** 46,50 **** public bool Contains(string charset) { ! return(-1 != IndexOf(charset)); } --- 46,50 ---- public bool Contains(string charset) { ! return (-1 != this.IndexOf(charset)); } *************** *** 52,58 **** { int index = 0; ! foreach(PgCharSet item in this) { ! if (cultureAwareCompare(item.CharSet, charset)) { return index; --- 52,59 ---- { int index = 0; ! ! foreach (PgCharSet item in this) { ! if (this.cultureAwareCompare(item.CharSet, charset)) { return index; *************** *** 60,63 **** --- 61,65 ---- index++; } + return -1; } *************** *** 65,69 **** public void RemoveAt(string charset) { ! RemoveAt(IndexOf(charset)); } --- 67,71 ---- public void RemoveAt(string charset) { ! this.RemoveAt(IndexOf(charset)); } Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgStatement.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PgStatement.cs 15 Feb 2004 00:17:53 -0000 1.23 --- PgStatement.cs 10 Apr 2004 20:16:07 -0000 1.24 *************** *** 59,62 **** --- 59,63 ---- private int recordsAffected; private char transactionStatus; + private PgStatementStatus status; *************** *** 67,136 **** public PgDbClient DbHandle { ! get { return db; } ! set { db = value; } } public string StmtText { ! get { return stmtText; } ! set { stmtText = value; } } public bool HasRows { ! get { return hasRows; } } public string Tag { ! get { return tag; } } public string ParseName { ! get { return parseName; } ! set { parseName = value; } } public string PortalName { ! get { return portalName; } ! set { portalName = value; } } public PgRowDescriptor RowDescriptor { ! get { return rowDescriptor; } } public object[] Rows { ! get { return rows; } } public PgParameter[] Parameters { ! get { return parameters; } } public PgParameter OutParameter { ! get { return outParameter; } ! set { outParameter = value; } } public int RecordsAffected { ! get { return recordsAffected; } } public PgStatementStatus Status { ! get { return status; } } public char TransactionStatus { ! get { return transactionStatus; } } --- 68,137 ---- public PgDbClient DbHandle { ! get { return this.db; } ! set { this.db = value; } } public string StmtText { ! get { return this.stmtText; } ! set { this.stmtText = value; } } public bool HasRows { ! get { return this.hasRows; } } public string Tag { ! get { return this.tag; } } public string ParseName { ! get { return this.parseName; } ! set { this.parseName = value; } } public string PortalName { ! get { return this.portalName; } ! set { this.portalName = value; } } public PgRowDescriptor RowDescriptor { ! get { return this.rowDescriptor; } } public object[] Rows { ! get { return this.rows; } } public PgParameter[] Parameters { ! get { return this.parameters; } } public PgParameter OutParameter { ! get { return this.outParameter; } ! set { this.outParameter = value; } } public int RecordsAffected { ! get { return this.recordsAffected; } } public PgStatementStatus Status { ! get { return this.status; } } public char TransactionStatus { ! get { return this.transactionStatus; } } *************** *** 183,206 **** public void Parse() { ! lock (db) { try { // Clear actual row list ! rows = null; ! rowIndex = 0; // Initialize RowDescriptor and Parameters ! rowDescriptor = new PgRowDescriptor(0); ! parameters = new PgParameter[0]; ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); ! packet.WriteString(ParseName); ! packet.WriteString(stmtText); packet.WriteShort(0); // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.PARSE); // Update status --- 184,207 ---- public void Parse() { ! lock (this.db) { try { // Clear actual row list ! this.rows = null; ! this.rowIndex = 0; // Initialize RowDescriptor and Parameters ! this.rowDescriptor = new PgRowDescriptor(0); ! this.parameters = new PgParameter[0]; ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); ! packet.WriteString(this.ParseName); ! packet.WriteString(this.stmtText); packet.WriteShort(0); // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.PARSE); // Update status *************** *** 219,239 **** public void Describe() { ! describe('S'); } public void DescribePortal() { ! describe('P'); } private void describe(char stmtType) { ! lock (db) { try { ! string name = ((stmtType == 'S') ? ParseName : PortalName); ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); packet.Write((byte)stmtType); --- 220,240 ---- public void Describe() { ! this.describe('S'); } public void DescribePortal() { ! this.describe('P'); } private void describe(char stmtType) { ! lock (this.db) { try { ! string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.Write((byte)stmtType); *************** *** 241,248 **** // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.DESCRIBE); // Flush pending messages ! db.Flush(); // Receive Describe response --- 242,249 ---- // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.DESCRIBE); // Flush pending messages ! this.db.Flush(); // Receive Describe response *************** *** 251,256 **** response.Message != PgBackendCodes.NODATA)) { ! response = db.ReceiveResponsePacket(); ! processSqlPacket(response); } --- 252,257 ---- response.Message != PgBackendCodes.NODATA)) { ! response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } *************** *** 270,283 **** public void Bind() { ! lock (db) { try { ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); // Destination portal name ! packet.WriteString(PortalName); // Prepared statement name ! packet.WriteString(ParseName); // Send parameters format code. --- 271,284 ---- public void Bind() { ! lock (this.db) { try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); // Destination portal name ! packet.WriteString(this.PortalName); // Prepared statement name ! packet.WriteString(this.ParseName); // Send parameters format code. *************** *** 285,289 **** for (int i = 0; i < parameters.Length; i++) { ! packet.WriteShort(parameters[i].DataType.FormatCode); } --- 286,290 ---- for (int i = 0; i < parameters.Length; i++) { ! packet.WriteShort(this.parameters[i].DataType.FormatCode); } *************** *** 292,307 **** for (int i = 0; i < parameters.Length; i++) { ! packet.WriteParameter(parameters[i]); } // Send column information ! packet.WriteShort((short)rowDescriptor.Fields.Length); ! for (int i = 0; i < rowDescriptor.Fields.Length; i++) { ! packet.WriteShort(rowDescriptor.Fields[i].DataType.FormatCode); } // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.BIND); // Update status --- 293,308 ---- for (int i = 0; i < parameters.Length; i++) { ! packet.WriteParameter(this.parameters[i]); } // Send column information ! packet.WriteShort((short)this.rowDescriptor.Fields.Length); ! for (int i = 0; i < this.rowDescriptor.Fields.Length; i++) { ! packet.WriteShort(this.rowDescriptor.Fields[i].DataType.FormatCode); } // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.BIND); // Update status *************** *** 320,337 **** public void Execute() { ! lock (db) { try { ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); ! packet.WriteString(PortalName); ! packet.WriteInt(fetchSize); // Rows to retrieve ( 0 = nolimit ) // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.EXECUTE); // Flush pending messages ! db.Flush(); // Receive response --- 321,338 ---- public void Execute() { ! lock (this.db) { try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); ! packet.WriteString(this.PortalName); ! packet.WriteInt(this.fetchSize); // Rows to retrieve ( 0 = nolimit ) // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.EXECUTE); // Flush pending messages ! this.db.Flush(); // Receive response *************** *** 341,346 **** response.Message != PgBackendCodes.COMMAND_COMPLETE) { ! response = db.ReceiveResponsePacket(); ! processSqlPacket(response); } --- 342,347 ---- response.Message != PgBackendCodes.COMMAND_COMPLETE) { ! response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } *************** *** 361,365 **** if (!this.hasRows || this.allRowsFetched) { ! db.Sync(); } --- 362,366 ---- if (!this.hasRows || this.allRowsFetched) { ! this.db.Sync(); } *************** *** 379,387 **** public void ExecuteFunction(int id) { ! lock (db) { try { ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); // Function id --- 380,388 ---- public void ExecuteFunction(int id) { ! lock (this.db) { try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); // Function id *************** *** 389,403 **** // Send parameters format code. ! packet.WriteShort((short)parameters.Length); ! for (int i = 0; i < parameters.Length; i++) { ! packet.WriteShort(parameters[i].DataType.FormatCode); } // Send parameter values ! packet.WriteShort((short)parameters.Length); ! for (int i = 0; i < parameters.Length; i++) { ! packet.WriteParameter(parameters[i]); } --- 390,404 ---- // Send parameters format code. ! packet.WriteShort((short)this.parameters.Length); ! for (int i = 0; i < this.parameters.Length; i++) { ! packet.WriteShort(this.parameters[i].DataType.FormatCode); } // Send parameter values ! packet.WriteShort((short)this.parameters.Length); ! for (int i = 0; i < this.parameters.Length; i++) { ! packet.WriteParameter(this.parameters[i]); } *************** *** 406,410 **** // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.FUNCTION_CALL); // Receive response --- 407,411 ---- // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.FUNCTION_CALL); // Receive response *************** *** 412,417 **** while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = db.ReceiveResponsePacket(); ! processSqlPacket(response); } --- 413,418 ---- while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } *************** *** 433,446 **** ArrayList innerRows = new ArrayList(); ! lock (db) { try { ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); ! packet.WriteString(stmtText); // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.QUERY); // Update Status --- 434,447 ---- ArrayList innerRows = new ArrayList(); ! lock (this.db) { try { ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); ! packet.WriteString(this.stmtText); // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.QUERY); // Update Status *************** *** 454,459 **** while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = db.ReceiveResponsePacket(); ! processSqlPacket(response); if (this.hasRows && --- 455,460 ---- while (response.Message != PgBackendCodes.READY_FOR_QUERY) { ! response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); if (this.hasRows && *************** *** 529,549 **** public void Close() { ! close('S'); } public void ClosePortal() { ! close('P'); } private void close(char stmtType) { ! lock (db) { try { ! string name = ((stmtType == 'S') ? ParseName : PortalName); ! PgOutputPacket packet = new PgOutputPacket(db.Settings.Encoding); packet.Write((byte)stmtType); --- 530,550 ---- public void Close() { ! this.close('S'); } public void ClosePortal() { ! this.close('P'); } private void close(char stmtType) { ! lock (this.db) { try { ! string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); ! PgOutputPacket packet = new PgOutputPacket(this.db.Settings.Encoding); packet.Write((byte)stmtType); *************** *** 551,558 **** // Send packet to the server ! db.SendPacket(packet, PgFrontEndCodes.CLOSE); // Sync server and client ! db.Flush(); // Read until CLOSE COMPLETE message is received --- 552,559 ---- // Send packet to the server ! this.db.SendPacket(packet, PgFrontEndCodes.CLOSE); // Sync server and client ! this.db.Flush(); // Read until CLOSE COMPLETE message is received *************** *** 560,578 **** while (response.Message != PgBackendCodes.CLOSE_COMPLETE) { ! response = db.ReceiveResponsePacket(); ! processSqlPacket(response); } // Clear rows ! rows = null; ! rowIndex = 0; // Update Status ! status = PgStatementStatus.Initial; } catch (Exception ex) { // Update Status ! status = PgStatementStatus.Error; // Throw exception throw ex; --- 561,580 ---- while (response.Message != PgBackendCodes.CLOSE_COMPLETE) { ! response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } // Clear rows ! this.rows = null; ! this.rowIndex = 0; // Update Status ! this.status = PgStatementStatus.Initial; } catch (Exception ex) { // Update Status ! this.status = PgStatementStatus.Error; ! // Throw exception throw ex; *************** *** 630,647 **** { case PgBackendCodes.READY_FOR_QUERY: ! transactionStatus = packet.ReadChar(); break; case PgBackendCodes.FUNCTION_CALL_RESPONSE: ! processFunctionResult(packet); break; case PgBackendCodes.ROW_DESCRIPTION: ! processRowDescription(packet); break; case PgBackendCodes.DATAROW: this.hasRows = true; ! processDataRow(packet); break; --- 632,649 ---- { case PgBackendCodes.READY_FOR_QUERY: ! this.transactionStatus = packet.ReadChar(); break; case PgBackendCodes.FUNCTION_CALL_RESPONSE: ! this.processFunctionResult(packet); break; case PgBackendCodes.ROW_DESCRIPTION: ! this.processRowDescription(packet); break; case PgBackendCodes.DATAROW: this.hasRows = true; ! this.processDataRow(packet); break; *************** *** 654,662 **** case PgBackendCodes.COMMAND_COMPLETE: ! processTag(packet); break; case PgBackendCodes.PARAMETER_DESCRIPTION: ! processParameterDescription(packet); break; --- 656,664 ---- case PgBackendCodes.COMMAND_COMPLETE: ! this.processTag(packet); break; case PgBackendCodes.PARAMETER_DESCRIPTION: ! this.processParameterDescription(packet); break; *************** *** 680,688 **** case "FETCH": case "SELECT": ! recordsAffected = -1; break; case "INSERT": ! recordsAffected = Int32.Parse(elements[2]); break; --- 682,690 ---- case "FETCH": case "SELECT": ! this.recordsAffected = -1; break; case "INSERT": ! this.recordsAffected = Int32.Parse(elements[2]); break; *************** *** 690,694 **** case "DELETE": case "MOVE": ! recordsAffected = Int32.Parse(elements[1]); break; } --- 692,696 ---- case "DELETE": case "MOVE": ! this.recordsAffected = Int32.Parse(elements[1]); break; } *************** *** 704,720 **** private void processRowDescription(PgResponsePacket packet) { ! rowDescriptor = new PgRowDescriptor(packet.ReadShort()); for (int i = 0; i < rowDescriptor.Fields.Length; i++) { ! rowDescriptor.Fields[i] = new PgFieldDescriptor(); ! rowDescriptor.Fields[i].FieldName = packet.ReadNullString(); ! rowDescriptor.Fields[i].OidTable = packet.ReadInt(); ! rowDescriptor.Fields[i].OidNumber = packet.ReadShort(); ! rowDescriptor.Fields[i].DataType = PgDbClient.Types[packet.ReadInt()]; ! rowDescriptor.Fields[i].DataTypeSize = packet.ReadShort(); ! rowDescriptor.Fields[i].TypeModifier = packet.ReadInt(); ! rowDescriptor.Fields[i].FormatCode = packet.ReadShort(); } } --- 706,722 ---- private void processRowDescription(PgResponsePacket packet) { ! this.rowDescriptor = new PgRowDescriptor(packet.ReadShort()); for (int i = 0; i < rowDescriptor.Fields.Length; i++) { ! this.rowDescriptor.Fields[i] = new PgFieldDescriptor(); ! this.rowDescriptor.Fields[i].FieldName = packet.ReadNullString(); ! this.rowDescriptor.Fields[i].OidTable = packet.ReadInt(); ! this.rowDescriptor.Fields[i].OidNumber = packet.ReadShort(); ! this.rowDescriptor.Fields[i].DataType = PgDbClient.Types[packet.ReadInt()]; ! this.rowDescriptor.Fields[i].DataTypeSize = packet.ReadShort(); ! this.rowDescriptor.Fields[i].TypeModifier = packet.ReadInt(); ! this.rowDescriptor.Fields[i].FormatCode = packet.ReadShort(); } } *************** *** 722,730 **** private void processParameterDescription(PgResponsePacket packet) { ! parameters = new PgParameter[packet.ReadShort()]; for (int i = 0; i < parameters.Length; i++) { ! parameters[i] = new PgParameter(packet.ReadInt()); } } --- 724,732 ---- private void processParameterDescription(PgResponsePacket packet) { ! this.parameters = new PgParameter[packet.ReadShort()]; for (int i = 0; i < parameters.Length; i++) { ! this.parameters[i] = new PgParameter(packet.ReadInt()); } } *************** *** 755,759 **** { values[i] = packet.ReadValueFromString( ! rowDescriptor.Fields[i].DataType, length); } --- 757,761 ---- { values[i] = packet.ReadValueFromString( ! this.rowDescriptor.Fields[i].DataType, length); } *************** *** 761,765 **** { values[i] = packet.ReadValue( ! rowDescriptor.Fields[i].DataType, length); } --- 763,767 ---- { values[i] = packet.ReadValue( ! this.rowDescriptor.Fields[i].DataType, length); } Index: PgCharSet.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCharSet.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgCharSet.cs 9 Feb 2004 14:20:45 -0000 1.3 --- PgCharSet.cs 10 Apr 2004 20:16:07 -0000 1.4 *************** *** 35,44 **** public string CharSet { ! get { return charSet; } } public Encoding Encoding { ! get { return encoding; } } --- 35,44 ---- public string CharSet { ! get { return this.charSet; } } public Encoding Encoding { ! get { return this.encoding; } } Index: PgConnectionParams.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgConnectionParams.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PgConnectionParams.cs 12 Feb 2004 19:52:05 -0000 1.5 --- PgConnectionParams.cs 10 Apr 2004 20:16:07 -0000 1.6 *************** *** 36,40 **** private Encoding encoding; private bool ssl; - private bool simpleQueryMode; #endregion --- 36,39 ---- *************** *** 44,109 **** public string ServerName { ! get { return serverName; } ! set { serverName = value; } } public string Database { ! get { return database; } ! set { database = value; } } public string UserName { ! get { return userName; } ! set { userName = value; } } public string UserPassword { ! get { return userPassword; } ! set { userPassword = value; } } public int PacketSize { ! get { return packetSize; } ! set { packetSize = value; } } public int ServerPort { ! get { return serverPort; } ! set { serverPort = value; } } public Encoding Encoding { ! get { return encoding; } ! set { encoding = value; } } public int Timeout { ! get { return timeout; } ! set { timeout = value; } } public bool Pooling { ! get { return pooling; } ! set { pooling = value; } } public bool SSL { ! get { return ssl; } ! set { ssl = value; } ! } ! ! public bool SimpleQueryMode ! { ! get { return simpleQueryMode; } ! set { simpleQueryMode = value; } } --- 43,102 ---- public string ServerName { ! get { return this.serverName; } ! set { this.serverName = value; } } public string Database { ! get { return this.database; } ! set { this.database = value; } } public string UserName { ! get { return this.userName; } ! set { this.userName = value; } } public string UserPassword { ! get { return this.userPassword; } ! set { this.userPassword = value; } } public int PacketSize { ! get { return this.packetSize; } ! set { this.packetSize = value; } } public int ServerPort { ! get { return this.serverPort; } ! set { this.serverPort = value; } } public Encoding Encoding { ! get { return this.encoding; } ! set { this.encoding = value; } } public int Timeout { ! get { return this.timeout; } ! set { this.timeout = value; } } public bool Pooling { ! get { return this.pooling; } ! set { this.pooling = value; } } public bool SSL { ! get { return this.ssl; } ! set { this.ssl = value; } } *************** *** 114,126 **** public PgConnectionParams() { ! serverName = "localhost"; ! userName = "postgres"; ! userPassword = "postgres"; ! serverPort = 5432; ! packetSize = 8192; ! pooling = true; ! timeout = 15; ! encoding = Encoding.Default; ! simpleQueryMode = false; } --- 107,118 ---- public PgConnectionParams() { ! this.serverName = "localhost"; ! this.userName = "postgres"; ! this.userPassword = "postgres"; ! this.serverPort = 5432; ! this.packetSize = 8192; ! this.pooling = true; ! this.timeout = 15; ! this.encoding = Encoding.Default; } Index: PgClientMessageEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientMessageEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgClientMessageEventArgs.cs 9 Feb 2004 14:20:45 -0000 1.2 --- PgClientMessageEventArgs.cs 10 Apr 2004 20:16:07 -0000 1.3 *************** *** 23,41 **** namespace PostgreSql.Data.NPgClient { internal delegate void PgClientMessageEventHandler(object sender, PgClientMessageEventArgs e); internal sealed class PgClientMessageEventArgs : EventArgs { private PgClientException exception; public PgClientException Exception { ! get { return exception; } } public PgClientMessageEventArgs(PgClientException exception) { this.exception = exception; } } } --- 23,57 ---- namespace PostgreSql.Data.NPgClient { + #region Delegates + internal delegate void PgClientMessageEventHandler(object sender, PgClientMessageEventArgs e); + #endregion + internal sealed class PgClientMessageEventArgs : EventArgs { + #region Fields + private PgClientException exception; + #endregion + + #region Properties + public PgClientException Exception { ! get { return this.exception; } } + #endregion + + #region Constructors + public PgClientMessageEventArgs(PgClientException exception) { this.exception = exception; } + + #endregion } } Index: PgClientNotificationEventArgs.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientNotificationEventArgs.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgClientNotificationEventArgs.cs 9 Feb 2004 14:20:45 -0000 1.2 --- PgClientNotificationEventArgs.cs 10 Apr 2004 20:16:07 -0000 1.3 *************** *** 23,50 **** namespace PostgreSql.Data.NPgClient { internal delegate void PgClientNotificationEventHandler(object sender, PgClientNotificationEventArgs e); internal sealed class PgClientNotificationEventArgs : EventArgs { private int processID; private string condition; private string aditional; public int ProcessID { ! get { return processID; } } public string Condition { ! get { return condition; } } public string Aditional { ! get { return aditional; } } ! public PgClientNotificationEventArgs(int processID, string condition, string addtional) { this.processID = processID; --- 23,67 ---- namespace PostgreSql.Data.NPgClient { + #region Delegates + internal delegate void PgClientNotificationEventHandler(object sender, PgClientNotificationEventArgs e); + #endregion + internal sealed class PgClientNotificationEventArgs : EventArgs { + #region Fields + private int processID; private string condition; private string aditional; + #endregion + + #region Properties + public int ProcessID { ! get { return this.processID; } } public string Condition { ! get { return this.condition; } } public string Aditional { ! get { return this.aditional; } } ! #endregion ! ! #region Constructors ! ! public PgClientNotificationEventArgs( ! int processID, ! string condition, ! string addtional) { this.processID = processID; *************** *** 52,55 **** --- 69,74 ---- this.aditional = aditional; } + + #endregion } } Index: PgClientException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgClientException.cs 9 Feb 2004 14:20:45 -0000 1.3 --- PgClientException.cs 10 Apr 2004 20:16:07 -0000 1.4 *************** *** 35,44 **** public new string Message { ! get { return message; } } public PgClientErrorCollection Errors { ! get { return errors; } } --- 35,44 ---- public new string Message { ! get { return this.message; } } public PgClientErrorCollection Errors { ! get { return this.errors; } } *************** *** 46,57 **** #region Constructors - - public PgClientException() : base() - { - errors = new PgClientErrorCollection(); - } ! public PgClientException(string message) : this() { this.message = message; } --- 46,53 ---- #region Constructors ! public PgClientException(string message) : base(message) { + this.errors = new PgClientErrorCollection(); this.message = message; } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 20:29:05
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12123 Modified Files: PgCommand.cs PgCommandBuilder.cs PgConnection.cs PgDbConnection.cs PgException.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Started cleanup and unification of this keyword usage tasks. Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** PgCommand.cs 1 Apr 2004 16:41:29 -0000 1.33 --- PgCommand.cs 10 Apr 2004 20:15:32 -0000 1.34 *************** *** 144,149 **** public bool DesignTimeVisible { ! get { return designTimeVisible; } ! set { designTimeVisible = value; } } --- 144,149 ---- public bool DesignTimeVisible { ! get { return this.designTimeVisible; } ! set { this.designTimeVisible = value; } } *************** *** 292,296 **** // release any unmanaged resources ! disposed = true; } finally --- 292,296 ---- // release any unmanaged resources ! this.disposed = true; } finally *************** *** 334,338 **** IDbDataParameter IDbCommand.CreateParameter() { ! return CreateParameter(); } --- 334,338 ---- IDbDataParameter IDbCommand.CreateParameter() { ! return this.CreateParameter(); } *************** *** 348,360 **** this.splitBatchCommands(false); ! if (this.connection.DbConnection.Settings.SimpleQueryMode) ! { ! this.InternalQuery(); ! } ! else ! { ! this.InternalPrepare(); ! this.InternalExecute(); ! } this.InternalSetOutputParameters(); --- 348,353 ---- this.splitBatchCommands(false); ! this.InternalPrepare(); ! this.InternalExecute(); this.InternalSetOutputParameters(); *************** *** 408,420 **** this.splitBatchCommands(false); ! if (this.connection.DbConnection.Settings.SimpleQueryMode) ! { ! this.InternalQuery(); ! } ! else ! { ! this.InternalPrepare(); ! this.InternalExecute(); ! } if (this.statement != null && this.statement.HasRows) --- 401,406 ---- this.splitBatchCommands(false); ! this.InternalPrepare(); ! this.InternalExecute(); if (this.statement != null && this.statement.HasRows) *************** *** 532,575 **** } - internal void InternalQuery() - { - if (this.commands == null) - { - this.splitBatchCommands(false); - } - - // Add this command to the active command list - if (this.connection.ActiveCommands != null) - { - if (!this.connection.ActiveCommands.Contains(this)) - { - this.connection.ActiveCommands.Add(this); - } - } - - try - { - string commandText = String.Empty; - - commandText = null; - - if (this.commandType == CommandType.StoredProcedure) - { - this.commands[actualCommand] = this.parseSPCommandText(); - } - - this.statement = this.connection.DbConnection.DB.CreateStatement( - String.Empty, - String.Empty, - this.parseParameterNames()); - - this.statement.Query(); - } - catch (PgClientException ex) - { - throw new PgException(ex.Message, ex); - } - } - internal void InternalClose() { --- 518,521 ---- *************** *** 602,606 **** this.actualCommand++; ! if (actualCommand >= commands.Length) { this.actualCommand--; --- 548,552 ---- this.actualCommand++; ! if (this.actualCommand >= this.commands.Length) { this.actualCommand--; *************** *** 618,622 **** } } ! } return returnValue; --- 564,568 ---- } } ! } return returnValue; *************** *** 626,632 **** { if (this.CommandType == CommandType.StoredProcedure && ! parameters.Count > 0) { ! IEnumerator paramEnumerator = Parameters.GetEnumerator(); int i = 0; --- 572,578 ---- { if (this.CommandType == CommandType.StoredProcedure && ! this.parameters.Count > 0) { ! IEnumerator paramEnumerator = this.parameters.GetEnumerator(); int i = 0; *************** *** 687,691 **** private string parseSPCommandText() { ! string result = CommandText; if (!commandText.Trim().ToLower().StartsWith("select ")) --- 633,637 ---- private string parseSPCommandText() { ! string result = CommandText; if (!commandText.Trim().ToLower().StartsWith("select ")) *************** *** 696,707 **** paramsText.Append(CommandText); paramsText.Append("("); ! for (int i = 0; i < parameters.Count; i++) { ! if (parameters[i].Direction == ParameterDirection.Input || ! parameters[i].Direction == ParameterDirection.InputOutput) { // Append parameter name to parameter list ! paramsText.Append(parameters[i].ParameterName); ! if (i != parameters.Count - 1) { paramsText = paramsText.Append(","); --- 642,655 ---- paramsText.Append(CommandText); paramsText.Append("("); ! ! for (int i = 0; i < this.parameters.Count; i++) { ! if (this.parameters[i].Direction == ParameterDirection.Input || ! this.parameters[i].Direction == ParameterDirection.InputOutput) { // Append parameter name to parameter list ! paramsText.Append(this.parameters[i].ParameterName); ! ! if (i != this.parameters.Count - 1) { paramsText = paramsText.Append(","); *************** *** 709,712 **** --- 657,661 ---- } } + paramsText.Append(")"); paramsText.Replace(",)", ")"); *************** *** 720,726 **** private string getStmtName() { ! return GetHashCode().ToString() + ! this.connection.GetHashCode().ToString() + ! DateTime.Now.Ticks; } --- 669,673 ---- private string getStmtName() { ! return GetHashCode().ToString() + this.connection.GetHashCode().ToString() + DateTime.Now.Ticks; } *************** *** 763,774 **** this.namedParameters.Add(g.Value); ! if (this.connection.DbConnection.Settings.SimpleQueryMode) ! { ! replace = this.parameters[matchIndex++].ConvertToPgString(); ! } ! else ! { ! replace = "$" + ((this.matchIndex++) + 1).ToString(); ! } this.matchReplaces.Add(g.Value, replace); --- 710,714 ---- this.namedParameters.Add(g.Value); ! replace = "$" + ((this.matchIndex++) + 1).ToString(); this.matchReplaces.Add(g.Value, replace); *************** *** 789,815 **** private void setParameterValues() { ! if (parameters.Count != 0) { for (int i = 0; i < this.statement.Parameters.Length; i++) { string parameterName = parameters[i].ParameterName; ! if (namedParameters.Count != 0) { try { ! parameterName = namedParameters[i].Trim(); } catch { ! parameterName = parameters[i].ParameterName; } } ! int index = parameters.IndexOf(parameterName); ! if (parameters[index].Direction == ParameterDirection.Input || ! parameters[index].Direction == ParameterDirection.InputOutput) { ! if (parameters[index].Value == System.DBNull.Value) { this.statement.Parameters[i].Value = null; --- 729,756 ---- private void setParameterValues() { ! if (this.parameters.Count != 0) { for (int i = 0; i < this.statement.Parameters.Length; i++) { string parameterName = parameters[i].ParameterName; ! ! if (this.namedParameters.Count != 0) { try { ! parameterName = this.namedParameters[i].Trim(); } catch { ! parameterName = this.parameters[i].ParameterName; } } ! int index = this.parameters.IndexOf(parameterName); ! if (this.parameters[index].Direction == ParameterDirection.Input || ! this.parameters[index].Direction == ParameterDirection.InputOutput) { ! if (this.parameters[index].Value == System.DBNull.Value) { this.statement.Parameters[i].Value = null; *************** *** 817,821 **** else { ! this.statement.Parameters[i].Value = parameters[index].Value; } } --- 758,762 ---- else { ! this.statement.Parameters[i].Value = this.parameters[index].Value; } } Index: PgException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgException.cs 9 Feb 2004 14:19:22 -0000 1.3 --- PgException.cs 10 Apr 2004 20:15:33 -0000 1.4 *************** *** 39,43 **** public PgErrorCollection Errors { ! get { return errors; } } --- 39,43 ---- public PgErrorCollection Errors { ! get { return this.errors; } } *************** *** 48,70 **** internal PgException() : base() { ! errors = new PgErrorCollection(); } internal PgException(string message) : base(message) { ! errors = new PgErrorCollection(); } internal PgException(SerializationInfo info, StreamingContext context) : base(info, context) { ! errors = new PgErrorCollection(); } ! internal PgException(string message, PgClientException ex) : base(message, ex) { ! errors = new PgErrorCollection(); ! Source = ex.Source; ! getPgExceptionErrors(ex); } --- 48,69 ---- internal PgException() : base() { ! this.errors = new PgErrorCollection(); } internal PgException(string message) : base(message) { ! this.errors = new PgErrorCollection(); } internal PgException(SerializationInfo info, StreamingContext context) : base(info, context) { ! this.errors = new PgErrorCollection(); } ! internal PgException(string message, PgClientException ex) : base(message) { ! this.errors = new PgErrorCollection(); ! this.getPgExceptionErrors(ex); } Index: PgConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PgConnection.cs 6 Apr 2004 14:18:14 -0000 1.16 --- PgConnection.cs 10 Apr 2004 20:15:33 -0000 1.17 *************** *** 70,77 **** RefreshProperties(RefreshProperties.All), DefaultValue("")] - // Editor(typeof(DesingTime.ConnectionStringUIEditor), typeof(System.Drawing.Design.UITypeEditor))] public string ConnectionString { ! get { return connectionString; } set { --- 70,76 ---- RefreshProperties(RefreshProperties.All), DefaultValue("")] public string ConnectionString { ! get { return this.connectionString; } set { *************** *** 79,83 **** { PgDbConnection tmpConn = new PgDbConnection(value); ! connectionString = value; tmpConn = null; } --- 78,82 ---- { PgDbConnection tmpConn = new PgDbConnection(value); ! this.connectionString = value; tmpConn = null; } *************** *** 90,96 **** get { ! if (dbConnection != null) { ! return dbConnection.Settings.Timeout; } else --- 89,95 ---- get { ! if (this.dbConnection != null) { ! return this.dbConnection.Settings.Timeout; } else *************** *** 106,112 **** get { ! if (dbConnection != null) { ! return dbConnection.Settings.Database; } else --- 105,111 ---- get { ! if (this.dbConnection != null) { ! return this.dbConnection.Settings.Database; } else *************** *** 122,128 **** get { ! if (dbConnection != null) { ! return dbConnection.Settings.ServerName; } else --- 121,127 ---- get { ! if (this.dbConnection != null) { ! return this.dbConnection.Settings.ServerName; } else *************** *** 139,145 **** { int packetSize = 8192; ! if (dbConnection != null) { ! packetSize = dbConnection.Settings.PacketSize; } --- 138,144 ---- { int packetSize = 8192; ! if (this.dbConnection != null) { ! packetSize = this.dbConnection.Settings.PacketSize; } *************** *** 154,160 **** get { ! if (dbConnection != null) { ! return (string)dbConnection.DB.ParameterStatus["server_version"]; } else --- 153,159 ---- get { ! if (this.dbConnection != null) { ! return (string)this.dbConnection.DB.ParameterStatus["server_version"]; } else *************** *** 169,196 **** public ConnectionState State { ! get { return state; } } internal ArrayList ActiveCommands { ! get { return activeCommands; } } internal PgDataReader DataReader { ! get { return dataReader; } ! set { dataReader = value; } } internal PgDbConnection DbConnection { ! get { return dbConnection; } ! set { dbConnection = value; } } internal PgTransaction ActiveTransaction { ! get { return activeTransaction; } ! set { activeTransaction = value; } } --- 168,199 ---- public ConnectionState State { ! get { return this.state; } } + #endregion + + #region Internal properties + internal ArrayList ActiveCommands { ! get { return this.activeCommands; } } internal PgDataReader DataReader { ! get { return this.dataReader; } ! set { this.dataReader = value; } } internal PgDbConnection DbConnection { ! get { return this.dbConnection; } ! set { this.dbConnection = value; } } internal PgTransaction ActiveTransaction { ! get { return this.activeTransaction; } ! set { this.activeTransaction = value; } } *************** *** 201,206 **** public PgConnection() : base() { ! state = ConnectionState.Closed; ! connectionString = String.Empty; GC.SuppressFinalize(this); --- 204,209 ---- public PgConnection() : base() { ! this.state = ConnectionState.Closed; ! this.connectionString = String.Empty; GC.SuppressFinalize(this); *************** *** 225,232 **** { // release any managed resources ! Close(); ! dbConnection = null; ! connectionString = null; } --- 228,235 ---- { // release any managed resources ! this.Close(); ! this.dbConnection = null; ! this.connectionString = null; } *************** *** 238,242 **** } ! disposed = true; } } --- 241,245 ---- } ! this.disposed = true; } } *************** *** 248,252 **** object ICloneable.Clone() { ! return new PgConnection(ConnectionString); } --- 251,255 ---- object ICloneable.Clone() { ! return new PgConnection(this.connectionString); } *************** *** 257,281 **** IDbTransaction IDbConnection.BeginTransaction() { ! return BeginTransaction(); } IDbTransaction IDbConnection.BeginTransaction(IsolationLevel level) { ! return BeginTransaction(level); } public PgTransaction BeginTransaction() { ! if (state == ConnectionState.Closed) { throw new InvalidOperationException("BeginTransaction requires an open and available Connection."); } ! if (activeTransaction != null && !activeTransaction.IsUpdated) { throw new InvalidOperationException("A transaction is currently active. Parallel transactions are not supported."); } ! if (DataReader != null) { throw new InvalidOperationException("BeginTransaction requires an open and available Connection. The connection's current state is Open, Fetching."); --- 260,285 ---- IDbTransaction IDbConnection.BeginTransaction() { ! return this.BeginTransaction(); } IDbTransaction IDbConnection.BeginTransaction(IsolationLevel level) { ! return this.BeginTransaction(level); } public PgTransaction BeginTransaction() { ! if (this.state == ConnectionState.Closed) { throw new InvalidOperationException("BeginTransaction requires an open and available Connection."); } ! if (this.activeTransaction != null && ! !this.activeTransaction.IsUpdated) { throw new InvalidOperationException("A transaction is currently active. Parallel transactions are not supported."); } ! if (this.DataReader != null) { throw new InvalidOperationException("BeginTransaction requires an open and available Connection. The connection's current state is Open, Fetching."); *************** *** 284,289 **** try { ! activeTransaction = new PgTransaction(this); ! activeTransaction.InternalBeginTransaction(); } catch (PgClientException ex) --- 288,293 ---- try { ! this.activeTransaction = new PgTransaction(this); ! this.activeTransaction.InternalBeginTransaction(); } catch (PgClientException ex) *************** *** 297,306 **** public PgTransaction BeginTransaction(IsolationLevel level) { ! if (state == ConnectionState.Closed) { throw new InvalidOperationException("BeginTransaction requires an open and available Connection."); } ! if (activeTransaction != null && !activeTransaction.IsUpdated) { throw new InvalidOperationException("A transaction is currently active. Parallel transactions are not supported."); --- 301,311 ---- public PgTransaction BeginTransaction(IsolationLevel level) { ! if (this.state == ConnectionState.Closed) { throw new InvalidOperationException("BeginTransaction requires an open and available Connection."); } ! if (this.activeTransaction != null && ! !this.activeTransaction.IsUpdated) { throw new InvalidOperationException("A transaction is currently active. Parallel transactions are not supported."); *************** *** 314,319 **** try { ! activeTransaction = new PgTransaction(this, level); ! activeTransaction.InternalBeginTransaction(); } catch (PgClientException ex) --- 319,324 ---- try { ! this.activeTransaction = new PgTransaction(this, level); ! this.activeTransaction.InternalBeginTransaction(); } catch (PgClientException ex) *************** *** 327,331 **** public void ChangeDatabase(string db) { ! if (state == ConnectionState.Closed) { throw new InvalidOperationException("ChangeDatabase requires an open and available Connection."); --- 332,336 ---- public void ChangeDatabase(string db) { ! if (this.state == ConnectionState.Closed) { throw new InvalidOperationException("ChangeDatabase requires an open and available Connection."); *************** *** 364,368 **** public void Open() { ! if (state != ConnectionState.Closed) { throw new InvalidOperationException("Connection already Open."); --- 369,373 ---- public void Open() { ! if (this.state != ConnectionState.Closed) { throw new InvalidOperationException("Connection already Open."); *************** *** 371,377 **** try { ! state = ConnectionState.Connecting; ! dbConnection = new PgDbConnection(connectionString); // Add handler for Ssl connections --- 376,382 ---- try { ! this.state = ConnectionState.Connecting; ! this.dbConnection = new PgDbConnection(this.connectionString); // Add handler for Ssl connections *************** *** 379,403 **** // Open connection ! if (dbConnection.Settings.Pooling) { ! dbConnection = PgConnectionPool.GetConnection( ! connectionString, ! dbConnection); } else { ! dbConnection.Pooled = false; ! dbConnection.Connect(); } // Set connection state to Open ! state = ConnectionState.Open; ! if (StateChange != null) { ! StateChange(this, new StateChangeEventArgs(ConnectionState.Closed, state)); } // Initialize active commands list ! activeCommands = new ArrayList(); // Add Info message event handler --- 384,408 ---- // Open connection ! if (this.dbConnection.Settings.Pooling) { ! this.dbConnection = PgConnectionPool.GetConnection( ! this.connectionString, ! this.dbConnection); } else { ! this.dbConnection.Pooled = false; ! this.dbConnection.Connect(); } // Set connection state to Open ! this.state = ConnectionState.Open; ! if (this.StateChange != null) { ! this.StateChange(this, new StateChangeEventArgs(ConnectionState.Closed, state)); } // Initialize active commands list ! this.activeCommands = new ArrayList(); // Add Info message event handler *************** *** 422,426 **** try { ! lock (dbConnection) { // Close DataReader --- 427,431 ---- try { ! lock (this.dbConnection) { // Close DataReader *************** *** 460,464 **** // Close connection permanently or send it // back to the pool ! if (dbConnection.Pooled) { PgConnectionPool.FreeConnection(this.dbConnection); --- 465,469 ---- // Close connection permanently or send it // back to the pool ! if (this.dbConnection.Pooled) { PgConnectionPool.FreeConnection(this.dbConnection); *************** *** 471,478 **** // Update state ! state = ConnectionState.Closed; // Raise StateChange event ! if (StateChange != null) { this.StateChange( --- 476,483 ---- // Update state ! this.state = ConnectionState.Closed; // Raise StateChange event ! if (this.StateChange != null) { this.StateChange( *************** *** 490,494 **** IDbCommand IDbConnection.CreateCommand() { ! return CreateCommand(); } --- 495,499 ---- IDbCommand IDbConnection.CreateCommand() { ! return this.CreateCommand(); } *************** *** 496,500 **** { PgCommand command = new PgCommand(); - command.Connection = this; --- 501,504 ---- *************** *** 504,514 **** private void DisposeActiveCommands() { ! if (activeCommands != null) { ! if (activeCommands.Count > 0) { ! PgCommand[] commands = new PgCommand[activeCommands.Count]; ! activeCommands.CopyTo(0, commands, 0, commands.Length); foreach (PgCommand command in commands) { --- 508,518 ---- private void DisposeActiveCommands() { ! if (this.activeCommands != null) { ! if (this.activeCommands.Count > 0) { ! PgCommand[] commands = new PgCommand[this.activeCommands.Count]; ! this.activeCommands.CopyTo(0, commands, 0, commands.Length); foreach (PgCommand command in commands) { *************** *** 526,530 **** public DataTable GetDbSchemaTable(PgDbSchemaType schema, object[] restrictions) { ! if (DataReader != null) { throw new InvalidOperationException("GetDbSchemaTable requires an open and available Connection. The connection's current state is Open, Fetching."); --- 530,534 ---- public DataTable GetDbSchemaTable(PgDbSchemaType schema, object[] restrictions) { ! if (this.DataReader != null) { throw new InvalidOperationException("GetDbSchemaTable requires an open and available Connection. The connection's current state is Open, Fetching."); Index: PgDbConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbConnection.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgDbConnection.cs 8 Mar 2004 15:12:26 -0000 1.8 --- PgDbConnection.cs 10 Apr 2004 20:15:33 -0000 1.9 *************** *** 179,186 **** this.settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); break; - - case "simple query mode": - this.settings.SimpleQueryMode = Boolean.Parse(element.Groups[2].Value.Trim()); - break; } } --- 179,182 ---- Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PgCommandBuilder.cs 1 Apr 2004 16:41:29 -0000 1.20 --- PgCommandBuilder.cs 10 Apr 2004 20:15:33 -0000 1.21 *************** *** 136,140 **** this.sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; this.sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! this.whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; // this.whereClausule2 = "({0} = ${1})"; // this.setClausule = "{0} = ${1}"; --- 136,140 ---- this.sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; this.sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! this.whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; // this.whereClausule2 = "({0} = ${1})"; // this.setClausule = "{0} = ${1}"; |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 11:30:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15971 Modified Files: changelog.txt Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/SslClientStream.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/TlsException.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Reworked Alert and Exception (TlsException) handling. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/changelog.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** changelog.txt 9 Apr 2004 08:47:39 -0000 1.26 --- changelog.txt 10 Apr 2004 11:16:55 -0000 1.27 *************** *** 2,5 **** --- 2,28 ---- --------------- ----------- ----------------------------------------- + + 2004-04-10 Carlos Guzman Alvarez <car...@te...> + + * Mono.Security.Protocol.Tls/SslClientStream.cs: + * Mono.Security.Protocol.Tls/SslServerStream.cs: + * Mono.Security.Protocol.Tls/Alert.cs: + * Mono.Security.Protocol.Tls/RecordProtocol.cs: + * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: + * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: + * Mono.Security.Protocol.Tls/Context.cs: + * Mono.Security.Protocol.Tls/TlsException.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: + * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: + * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: + + - Reworked Alert and Exception (TlsException) handling. + + 2004-04-09 Carlos Guzman Alvarez <car...@te...> *************** *** 12,20 **** - Added two new methods: CreateSignature and VerifySignature. ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsCertificateVerify.cs: - Added Ssl3 implementation. ! * Mono.Security.Protocol.Tls.Handshake.Server/TlsCertificateVerify.cs: - Added initial implementation. --- 35,43 ---- - Added two new methods: CreateSignature and VerifySignature. ! * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: - Added Ssl3 implementation. ! * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: - Added initial implementation. |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 11:29:54
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15831 Modified Files: Alert.cs ClientRecordProtocol.cs Context.cs RecordProtocol.cs ServerRecordProtocol.cs SslClientStream.cs SslServerStream.cs TlsException.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/SslClientStream.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/TlsException.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Reworked Alert and Exception (TlsException) handling. Index: TlsException.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TlsException.cs 3 Mar 2004 16:22:36 -0000 1.2 --- TlsException.cs 10 Apr 2004 11:16:24 -0000 1.3 *************** *** 30,35 **** { [Serializable] ! public sealed class TlsException : Exception { #region Constructors --- 30,50 ---- { [Serializable] ! internal sealed class TlsException : Exception { + #region Private fields + + private Alert alert; + + #endregion + + #region Properties + + public Alert Alert + { + get { return this.alert; } + } + + #endregion + #region Constructors *************** *** 46,49 **** --- 61,92 ---- } + internal TlsException( + AlertLevel level, + AlertDescription description) + : this (level, description, Alert.GetAlertMessage(description)) + { + } + + internal TlsException( + AlertLevel level, + AlertDescription description, + string message) : base (message) + { + this.alert = new Alert(level, description); + } + + internal TlsException( + AlertDescription description) + : this (description, Alert.GetAlertMessage(description)) + { + } + + internal TlsException( + AlertDescription description, + string message) : base (message) + { + this.alert = new Alert(description); + } + #endregion } Index: Alert.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Alert.cs 3 Mar 2004 16:22:36 -0000 1.1 --- Alert.cs 10 Apr 2004 11:16:24 -0000 1.2 *************** *** 67,75 **** #endregion ! internal class Alert : TlsStream { #region Fields - private Context context; private AlertLevel level; private AlertDescription description; --- 67,74 ---- #endregion ! internal class Alert { #region Fields private AlertLevel level; private AlertDescription description; *************** *** 77,110 **** #endregion ! #region Constructors ! public Alert( ! Context context, ! AlertDescription description) : base() { ! this.context = context; ! this.description = description; ! ! this.inferAlertLevel(); ! ! this.fill(); } ! public Alert( ! Context context, ! AlertLevel level, ! AlertDescription description) : base() { ! this.context = context; ! this.level = level; ! this.description = description; ! ! this.fill(); } - #endregion - - #region Properties - public string Message { --- 76,91 ---- #endregion ! #region Properties ! public AlertLevel Level { ! get { return this.level; } } ! public AlertDescription Description { ! get { return this.description; } } public string Message { *************** *** 144,164 **** #endregion ! #region Methods ! ! public void Update() { ! if ( this.description == AlertDescription.CloseNotify ) ! { ! this.context.ConnectionEnd = true; ! } ! if (this.IsFatal) ! { ! this.context.ConnectionEnd = true; ! if (this.context is ServerContext) ! { ! ((ServerContext)this.context).SslStream.Close(); ! } ! } } --- 125,142 ---- #endregion ! #region Constructors ! ! public Alert(AlertDescription description) { ! this.inferAlertLevel(); ! this.description = description; ! } ! public Alert( ! AlertLevel level, ! AlertDescription description) ! { ! this.level = level; ! this.description = description; } *************** *** 167,176 **** #region Private Methods - private void fill() - { - this.Write((byte)level); - this.Write((byte)description); - } - private void inferAlertLevel() { --- 145,148 ---- Index: SslServerStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SslServerStream.cs 10 Mar 2004 15:47:57 -0000 1.10 --- SslServerStream.cs 10 Apr 2004 11:16:24 -0000 1.11 *************** *** 437,442 **** buffer, offset, count, callback, state); } ! catch (TlsException) { throw new IOException("The authentication or decryption has failed."); } --- 437,445 ---- buffer, offset, count, callback, state); } ! catch (TlsException ex) { + this.protocol.SendAlert(ex.Alert); + this.Close(); + throw new IOException("The authentication or decryption has failed."); } *************** *** 495,500 **** try { ! // Send the buffer as a TLS record ! byte[] record = this.protocol.EncodeRecord( ContentType.ApplicationData, buffer, offset, count); --- 498,502 ---- try { ! // Send the buffer as a TLS record byte[] record = this.protocol.EncodeRecord( ContentType.ApplicationData, buffer, offset, count); *************** *** 503,508 **** record, 0, record.Length, callback, state); } ! catch (TlsException) { throw new IOException("The authentication or decryption has failed."); } --- 505,513 ---- record, 0, record.Length, callback, state); } ! catch (TlsException ex) { + this.protocol.SendAlert(ex.Alert); + this.Close(); + throw new IOException("The authentication or decryption has failed."); } *************** *** 694,699 **** this.context.ClearKeyInfo(); } ! catch { throw new IOException("The authentication or decryption has failed."); } --- 699,714 ---- this.context.ClearKeyInfo(); } ! catch (TlsException ex) ! { ! this.protocol.SendAlert(ex.Alert); ! this.Close(); ! ! throw new IOException("The authentication or decryption has failed."); ! } ! catch (Exception) { + this.protocol.SendAlert(AlertDescription.InternalError); + this.Close(); + throw new IOException("The authentication or decryption has failed."); } Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RecordProtocol.cs 17 Mar 2004 16:34:11 -0000 1.14 --- RecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.15 *************** *** 82,86 **** if (this.context.ConnectionEnd) { ! throw this.context.CreateException("The session is finished and it's no longer valid."); } --- 82,88 ---- if (this.context.ConnectionEnd) { ! throw new TlsException( ! AlertDescription.InternalError, ! "The session is finished and it's no longer valid."); } *************** *** 113,117 **** this.context.ProtocolNegotiated) { ! throw this.context.CreateException("Invalid protocol version on message received from server"); } --- 115,121 ---- this.context.ProtocolNegotiated) { ! throw new TlsException( ! AlertDescription.ProtocolVersion, ! "Invalid protocol version on message received from server"); } *************** *** 163,167 **** default: ! throw this.context.CreateException("Unknown record received from server."); } --- 167,173 ---- default: ! throw new TlsException( ! AlertDescription.UnexpectedMessage, ! "Unknown record received from server."); } *************** *** 186,190 **** { case AlertLevel.Fatal: ! throw this.context.CreateException(alertLevel, alertDesc); case AlertLevel.Warning: --- 192,196 ---- { case AlertLevel.Fatal: ! throw new TlsException(alertLevel, alertDesc); case AlertLevel.Warning: *************** *** 206,210 **** public void SendAlert(AlertDescription description) { ! this.SendAlert(new Alert(this.Context, description)); } --- 212,216 ---- public void SendAlert(AlertDescription description) { ! this.SendAlert(new Alert(description)); } *************** *** 213,217 **** AlertDescription description) { ! this.SendAlert(new Alert(this.Context, level, description)); } --- 219,223 ---- AlertDescription description) { ! this.SendAlert(new Alert(level, description)); } *************** *** 219,229 **** { // Write record ! this.SendRecord(ContentType.Alert, alert.ToArray()); ! ! // Update session ! alert.Update(); ! // Reset message contents ! alert.Reset(); } --- 225,236 ---- { // Write record ! this.SendRecord( ! ContentType.Alert, ! new byte[]{(byte)alert.Level, (byte)alert.Description}); ! if (alert.IsCloseNotify) ! { ! this.context.ConnectionEnd = true; ! } } *************** *** 254,258 **** if (this.context.ConnectionEnd) { ! throw this.context.CreateException("The session is finished and it's no longer valid."); } --- 261,267 ---- if (this.context.ConnectionEnd) { ! throw new TlsException( ! AlertDescription.InternalError, ! "The session is finished and it's no longer valid."); } *************** *** 279,283 **** if (this.context.ConnectionEnd) { ! throw this.context.CreateException("The session is finished and it's no longer valid."); } --- 288,294 ---- if (this.context.ConnectionEnd) { ! throw new TlsException( ! AlertDescription.InternalError, ! "The session is finished and it's no longer valid."); } Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Context.cs 10 Mar 2004 15:47:57 -0000 1.6 --- Context.cs 10 Apr 2004 11:16:24 -0000 1.7 *************** *** 421,424 **** --- 421,425 ---- #endregion + /* #region Exception Methods *************** *** 444,447 **** --- 445,449 ---- #endregion + */ } } Index: SslClientStream.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SslClientStream.cs 9 Mar 2004 16:29:21 -0000 1.19 --- SslClientStream.cs 10 Apr 2004 11:16:24 -0000 1.20 *************** *** 730,735 **** this.context.ClearKeyInfo(); } ! catch { throw new IOException("The authentication or decryption has failed."); } --- 730,745 ---- this.context.ClearKeyInfo(); } ! catch (TlsException ex) ! { ! this.protocol.SendAlert(ex.Alert); ! this.Close(); ! ! throw new IOException("The authentication or decryption has failed."); ! } ! catch (Exception) { + this.protocol.SendAlert(AlertDescription.InternalError); + this.Close(); + throw new IOException("The authentication or decryption has failed."); } Index: ServerRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ServerRecordProtocol.cs 9 Mar 2004 16:29:21 -0000 1.4 --- ServerRecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.5 *************** *** 123,127 **** default: ! throw this.context.CreateException("Unknown server handshake message received ({0})", type.ToString()); } } --- 123,129 ---- default: ! throw new TlsException( ! AlertDescription.UnexpectedMessage, ! String.Format("Unknown server handshake message received ({0})", type.ToString())); } } Index: ClientRecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ClientRecordProtocol.cs 9 Mar 2004 16:29:21 -0000 1.6 --- ClientRecordProtocol.cs 10 Apr 2004 11:16:24 -0000 1.7 *************** *** 163,167 **** default: ! throw this.context.CreateException("Unknown server handshake message received ({0})", type.ToString()); } } --- 163,169 ---- default: ! throw new TlsException( ! AlertDescription.UnexpectedMessage, ! String.Format("Unknown server handshake message received ({0})", type.ToString())); } } |
From: Carlos Guzm?n ?l. <car...@us...> - 2004-04-10 11:29:13
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15738 Modified Files: TlsClientCertificate.cs TlsClientCertificateVerify.cs TlsServerCertificate.cs TlsServerHello.cs TlsServerKeyExchange.cs Log Message: 2004-04-10 Carlos Guzman Alvarez <car...@te...> * Mono.Security.Protocol.Tls/SslClientStream.cs: * Mono.Security.Protocol.Tls/SslServerStream.cs: * Mono.Security.Protocol.Tls/Alert.cs: * Mono.Security.Protocol.Tls/RecordProtocol.cs: * Mono.Security.Protocol.Tls/ClientRecordProtocol.cs: * Mono.Security.Protocol.Tls/ServerRecordProtocol.cs: * Mono.Security.Protocol.Tls/Context.cs: * Mono.Security.Protocol.Tls/TlsException.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs: * Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs: * Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs: - Reworked Alert and Exception (TlsException) handling. Index: TlsClientCertificateVerify.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsClientCertificateVerify.cs 9 Apr 2004 08:43:08 -0000 1.5 --- TlsClientCertificateVerify.cs 10 Apr 2004 11:15:43 -0000 1.6 *************** *** 65,69 **** if (privKey == null) { ! throw this.Context.CreateException("Client certificate Private Key unavailable."); } else --- 65,71 ---- if (privKey == null) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate Private Key unavailable."); } else *************** *** 95,99 **** if (privKey == null) { ! throw this.Context.CreateException("Client certificate Private Key unavailable."); } else --- 97,103 ---- if (privKey == null) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate Private Key unavailable."); } else Index: TlsClientCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsClientCertificate.cs 3 Mar 2004 16:14:40 -0000 1.5 --- TlsClientCertificate.cs 10 Apr 2004 11:15:43 -0000 1.6 *************** *** 66,70 **** context.ClientSettings.Certificates.Count == 0) { ! throw this.Context.CreateException("Client certificate requested by the server and no client certificate specified."); } --- 66,72 ---- context.ClientSettings.Certificates.Count == 0) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate requested by the server and no client certificate specified."); } *************** *** 80,84 **** if (clientCert == null) { ! throw this.Context.CreateException("Client certificate requested by the server and no client certificate specified."); } --- 82,88 ---- if (clientCert == null) { ! throw new TlsException( ! AlertDescription.UserCancelled, ! "Client certificate requested by the server and no client certificate specified."); } Index: TlsServerHello.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TlsServerHello.cs 4 Mar 2004 15:40:29 -0000 1.5 --- TlsServerHello.cs 10 Apr 2004 11:15:43 -0000 1.6 *************** *** 129,133 **** else { ! throw this.Context.CreateException("Incorrect protocol version received from server"); } } --- 129,135 ---- else { ! throw new TlsException( ! AlertDescription.ProtocolVersion, ! "Incorrect protocol version received from server"); } } Index: TlsServerCertificate.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TlsServerCertificate.cs 19 Mar 2004 22:44:11 -0000 1.8 --- TlsServerCertificate.cs 10 Apr 2004 11:15:43 -0000 1.9 *************** *** 177,181 **** private void validateCertificates(X509CertificateCollection certificates) { ! ClientContext context = (ClientContext)this.Context; // the leaf is the web server certificate --- 177,182 ---- private void validateCertificates(X509CertificateCollection certificates) { ! ClientContext context = (ClientContext)this.Context; ! AlertDescription description = AlertDescription.BadCertificate; // the leaf is the web server certificate *************** *** 226,251 **** --- 227,262 ---- errors.Add ((int)-2146869223); break; + case X509ChainStatusFlags.NotSignatureValid: // WinError.h TRUST_E_BAD_DIGEST 0x80096010 errors.Add ((int)-2146869232); break; + case X509ChainStatusFlags.NotTimeNested: // WinError.h CERT_E_VALIDITYPERIODNESTING 0x800B0102 errors.Add ((int)-2146762494); break; + case X509ChainStatusFlags.NotTimeValid: // WinError.h CERT_E_EXPIRED 0x800B0101 + description = AlertDescription.CertificateExpired; errors.Add ((int)-2146762495); break; + case X509ChainStatusFlags.PartialChain: // WinError.h CERT_E_CHAINING 0x800B010A + description = AlertDescription.UnknownCA; errors.Add ((int)-2146762486); break; + case X509ChainStatusFlags.UntrustedRoot: // WinError.h CERT_E_UNTRUSTEDROOT 0x800B0109 + description = AlertDescription.UnknownCA; errors.Add ((int)-2146762487); break; + default: // unknown error + description = AlertDescription.CertificateUnknown; errors.Add ((int)verify.Status); break; *************** *** 259,263 **** certificateErrors)) { ! throw context.CreateException("Invalid certificate received form server."); } } --- 270,276 ---- certificateErrors)) { ! throw new TlsException( ! description, ! "Invalid certificate received form server."); } } *************** *** 308,322 **** string domainName = String.Empty; ! Regex search = new Regex(@"([\w\s\d]*)\s*=\s*([^,]*)"); MatchCollection elements = search.Matches(subjectName); ! foreach (Match element in elements) { ! switch (element.Groups[1].Value.Trim().ToUpper()) { ! case "CN": ! domainName = element.Groups[2].Value; ! break; } } --- 321,333 ---- string domainName = String.Empty; ! Regex search = new Regex(@"CN\s*=\s*([^,]*)"); MatchCollection elements = search.Matches(subjectName); ! if (elements.Count == 1) { ! if (elements[0].Success) { ! domainName = elements[0].Groups[1].Value.ToString(); } } Index: TlsServerKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TlsServerKeyExchange.cs 19 Mar 2004 22:44:11 -0000 1.4 --- TlsServerKeyExchange.cs 10 Apr 2004 11:15:43 -0000 1.5 *************** *** 111,115 **** if (!isValidSignature) { ! throw this.Context.CreateException("Data was not signed with the server certificate."); } } --- 111,117 ---- if (!isValidSignature) { ! throw new TlsException( ! AlertDescription.DecodeError, ! "Data was not signed with the server certificate."); } } |