pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 14)
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 G. Á. <car...@us...> - 2004-11-17 13:52:14
|
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-serv18075 Modified Files: TlsServerCertificate.cs Log Message: Updated 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.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TlsServerCertificate.cs 9 May 2004 12:07:16 -0000 1.12 --- TlsServerCertificate.cs 17 Nov 2004 13:52:04 -0000 1.13 *************** *** 104,108 **** } ! this.validateCertificates(certificates); } --- 104,108 ---- } ! // this.validateCertificates(certificates); } |
From: Carlos G. Á. <car...@us...> - 2004-11-17 13:50:35
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17721 Modified Files: CipherSuiteFactory.cs RecordProtocol.cs Log Message: 2004-11-17 Carlos Guzman Alvarez <car...@te...> * Add a fix for the ClientHelloV2 message (Thanks to Sebastien Pouliot) Index: CipherSuiteFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CipherSuiteFactory.cs 18 Mar 2004 14:06:31 -0000 1.2 --- CipherSuiteFactory.cs 17 Nov 2004 13:50:21 -0000 1.3 *************** *** 132,137 **** // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); --- 132,138 ---- // Supported ciphers ! scs.Add((0x00 << 0x08) | 0x35, "SSL_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); ! scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); ! scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** RecordProtocol.cs 24 Sep 2004 21:33:34 -0000 1.20 --- RecordProtocol.cs 17 Nov 2004 13:50:23 -0000 1.21 *************** *** 140,165 **** default: ! return null; ! } return result; } - private byte[] ReadRecordBuffer(int contentType) - { - switch (contentType) - { - case 0x80: - return this.ReadClientHelloV2(); - - default: - if (!Enum.IsDefined(typeof(ContentType), (ContentType)contentType)) - { - throw new TlsException(AlertDescription.DecodeError); - } - return this.ReadStandardRecordBuffer(); - } - } - private short ReadShort() { --- 140,151 ---- default: ! throw new TlsException( ! AlertDescription.UnexpectedMessage, ! "Unknown record received from server."); ! } return result; } private short ReadShort() { *************** *** 195,198 **** --- 181,200 ---- #region Record Buffer read + private byte[] ReadRecordBuffer(int contentType) + { + switch (contentType) + { + case 0x80: + return this.ReadClientHelloV2(); + + default: + if (!Enum.IsDefined(typeof(ContentType), (ContentType)contentType)) + { + throw new TlsException(AlertDescription.DecodeError); + } + return this.ReadStandardRecordBuffer(); + } + } + private byte[] ReadClientHelloV2() { *************** *** 200,210 **** // Read the message contents ! byte[] tmp = new byte[msgLength]; ! this.innerStream.Read(tmp, 0, tmp.Length); ! // Add them to a TlsStream ! TlsStream stream = new TlsStream(tmp); ! ! int msgType = stream.ReadByte(); if (msgType != 1) { --- 202,212 ---- // Read the message contents ! byte[] message = new byte[msgLength]; ! this.innerStream.Read(message, 0, message.Length); ! // Add them to a TlsStream ! TlsStream stream = new TlsStream(message); ! ! int msgType = stream.ReadByte(); if (msgType != 1) { *************** *** 245,258 **** // Updated the Client Random ! this.context.ClientRandom = new byte[32]; ! Buffer.BlockCopy(challenge, 0, this.context.ClientRandom, 0, length); ! // Update the Handshake Hashes ! this.Context.HandshakeMessages.Write(tmp); ! // Updated the LastHandshake message this.context.LastHandshakeMsg = HandshakeType.ClientHello; ! return new byte[0]; } --- 247,262 ---- // Updated the Client Random ! this.context.ClientRandom = new byte[32]; ! Buffer.BlockCopy(challenge, challenge.Length - length, this.context.ClientRandom, 32 - length, length); ! // Update the Handshake Hashes ! this.Context.HandshakeMessages.Write(new byte[] { 0x80 }); ! this.Context.HandshakeMessages.Write(message); ! // Updated the LastHandshake message this.context.LastHandshakeMsg = HandshakeType.ClientHello; + this.context.ProtocolNegotiated = true; ! return new byte[0]; } |
From: Carlos G. Á. <car...@us...> - 2004-10-22 18:54:22
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20274 Modified Files: PgStatement.cs Log Message: Fixed bug #1052269 Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgStatement.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** PgStatement.cs 29 Sep 2004 12:10:53 -0000 1.27 --- PgStatement.cs 22 Oct 2004 18:54:05 -0000 1.28 *************** *** 166,171 **** this.rows = null; this.rowIndex = 0; ! this.parseName = String.Empty; ! this.portalName = String.Empty; this.recordsAffected = -1; this.status = PgStatementStatus.Initial; --- 166,171 ---- this.rows = null; this.rowIndex = 0; ! this.parseName = parseName; ! this.portalName = portalName; this.recordsAffected = -1; this.status = PgStatementStatus.Initial; |
From: Carlos G. Á. <car...@us...> - 2004-10-13 19:57:17
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9953 Modified Files: PgOutputPacket.cs Log Message: Fix for bug #1046272 Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PgOutputPacket.cs 22 Jul 2004 10:58:58 -0000 1.29 --- PgOutputPacket.cs 13 Oct 2004 19:57:05 -0000 1.30 *************** *** 80,85 **** public void WriteString(string data) { ! this.WriteInt(data.Length); ! this.Write(this.encoding.GetBytes(data)); } --- 80,87 ---- public void WriteString(string data) { ! byte[] buffer = this.encoding.GetBytes(data); ! ! this.WriteInt(buffer.Length); ! this.Write(buffer); } *************** *** 335,343 **** case PgDataType.Byte: packet.WriteInt(size); packet.Write((byte)value); break; ! case PgDataType.Int2: packet.WriteInt(size); packet.WriteShort(Convert.ToInt16(value)); --- 337,354 ---- case PgDataType.Byte: + case PgDataType.Boolean: packet.WriteInt(size); packet.Write((byte)value); break; ! case PgDataType.Char: ! case PgDataType.VarChar: ! { ! string paramValue = value.ToString() + PgCodes.NULL_TERMINATOR; ! packet.WriteString(paramValue); ! } ! break; ! ! case PgDataType.Int2: packet.WriteInt(size); packet.WriteShort(Convert.ToInt16(value)); *************** *** 388,418 **** case PgDataType.Time: - // packet.WriteInt(size); packet.WriteTime(Convert.ToDateTime(value)); break; case PgDataType.TimeWithTZ: - // packet.WriteInt(size); packet.WriteTimeWithTZ(Convert.ToDateTime(value)); break; case PgDataType.Timestamp: - // packet.WriteInt(size); packet.WriteTimestamp(Convert.ToDateTime(value)); break; case PgDataType.TimestampWithTZ: - // packet.WriteInt(size); packet.WriteTimestampWithTZ(Convert.ToDateTime(value)); break; - case PgDataType.Char: - case PgDataType.VarChar: - { - string paramValue = value.ToString() + PgCodes.NULL_TERMINATOR; - packet.WriteString(paramValue); - } - break; - case PgDataType.Point: packet.WriteInt(size); --- 399,417 ---- |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:15:20
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17095 Modified Files: PgDatabaseSchemaTest.cs Log Message: Mayor update of the PgSqlClient sources Index: PgDatabaseSchemaTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgDatabaseSchemaTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgDatabaseSchemaTest.cs 9 Feb 2004 14:21:31 -0000 1.3 --- PgDatabaseSchemaTest.cs 29 Sep 2004 12:15:07 -0000 1.4 *************** *** 30,35 **** public void Aggregates() { ! DataTable aggregates = Connection.GetDbSchemaTable( ! PgDbSchemaType.Aggregates, null); } --- 30,34 ---- public void Aggregates() { ! DataTable aggregates = Connection.GetSchema("Aggregates", null); } *************** *** 37,42 **** public void Casts() { ! DataTable casts = Connection.GetDbSchemaTable( ! PgDbSchemaType.Casts, null); } --- 36,40 ---- public void Casts() { ! DataTable casts = Connection.GetSchema("Casts", null); } *************** *** 44,49 **** public void CheckConstraints() { ! DataTable checkConstraints = Connection.GetDbSchemaTable( ! PgDbSchemaType.Check_Constraints, null); } --- 42,46 ---- public void CheckConstraints() { ! DataTable checkConstraints = Connection.GetSchema("CheckConstraints", null); } *************** *** 51,56 **** public void CheckConstraintsByTable() { ! DataTable checkConstraintsByTable = Connection.GetDbSchemaTable( ! PgDbSchemaType.Check_Constraints_By_Table, null); } --- 48,52 ---- public void CheckConstraintsByTable() { ! DataTable checkConstraintsByTable = Connection.GetSchema("CheckConstraintsByTable", null); } *************** *** 58,63 **** public void Columns() { ! DataTable columns = Connection.GetDbSchemaTable( ! PgDbSchemaType.Columns, null); } --- 54,58 ---- public void Columns() { ! DataTable columns = Connection.GetSchema("Columns", null); } *************** *** 65,70 **** public void Databases() { ! DataTable databases = Connection.GetDbSchemaTable( ! PgDbSchemaType.Database, null); } --- 60,64 ---- public void Databases() { ! DataTable databases = Connection.GetSchema("Database", null); } *************** *** 72,77 **** public void Domains() { ! DataTable domains = Connection.GetDbSchemaTable( ! PgDbSchemaType.Domains, null); } --- 66,70 ---- public void Domains() { ! DataTable domains = Connection.GetSchema("Domains", null); } *************** *** 79,84 **** public void ForeignKeys() { ! DataTable foreignKeys = Connection.GetDbSchemaTable( ! PgDbSchemaType.Foreign_Keys, null); } --- 72,76 ---- public void ForeignKeys() { ! DataTable foreignKeys = Connection.GetSchema("ForeignKeys", null); } *************** *** 86,91 **** public void FunctionPrivileges() { ! DataTable functionPrivileges = Connection.GetDbSchemaTable( ! PgDbSchemaType.Function_Privileges, null); } --- 78,82 ---- public void FunctionPrivileges() { ! DataTable functionPrivileges = Connection.GetSchema("FunctionPrivileges", null); } *************** *** 93,98 **** public void Functions() { ! DataTable functions = Connection.GetDbSchemaTable( ! PgDbSchemaType.Functions, null); } --- 84,88 ---- public void Functions() { ! DataTable functions = Connection.GetSchema("Functions", null); } *************** *** 100,105 **** public void Groups() { ! DataTable groups = Connection.GetDbSchemaTable( ! PgDbSchemaType.Groups, null); } --- 90,94 ---- public void Groups() { ! DataTable groups = Connection.GetSchema("Groups", null); } *************** *** 107,112 **** public void Indexes() { ! DataTable indexes = Connection.GetDbSchemaTable( ! PgDbSchemaType.Indexes, null); } --- 96,100 ---- public void Indexes() { ! DataTable indexes = Connection.GetSchema("Indexes", null); } *************** *** 114,119 **** public void PrimaryKeys() { ! DataTable primaryKeys = Connection.GetDbSchemaTable( ! PgDbSchemaType.Primary_Keys, null); } --- 102,106 ---- public void PrimaryKeys() { ! DataTable primaryKeys = Connection.GetSchema("PrimaryKeys", null); } *************** *** 121,126 **** public void ProviderTypes() { ! DataTable providerTypes = Connection.GetDbSchemaTable( ! PgDbSchemaType.Provider_Types, null); } --- 108,112 ---- public void ProviderTypes() { ! DataTable providerTypes = Connection.GetSchema("ProviderTypes", null); } *************** *** 128,133 **** public void Schemata() { ! DataTable schemata = Connection.GetDbSchemaTable( ! PgDbSchemaType.Schemata, null); } --- 114,118 ---- public void Schemata() { ! DataTable schemata = Connection.GetSchema("Schemata", null); } *************** *** 135,140 **** public void SqlLanguages() { ! DataTable sqlLanguages = Connection.GetDbSchemaTable( ! PgDbSchemaType.Sql_Languages, null); } --- 120,124 ---- public void SqlLanguages() { ! DataTable sqlLanguages = Connection.GetSchema("SqlLanguages", null); } *************** *** 143,148 **** public void Statistics() { ! DataTable statistics = Connection.GetDbSchemaTable( ! PgDbSchemaType.Statistics, null); } --- 127,131 ---- public void Statistics() { ! DataTable statistics = Connection.GetSchema("Statistics", null); } *************** *** 150,155 **** public void TableConstraint() { ! DataTable tableConstraint = Connection.GetDbSchemaTable( ! PgDbSchemaType.Table_Constraint, null); } --- 133,137 ---- public void TableConstraint() { ! DataTable tableConstraint = Connection.GetSchema("TableConstraint", null); } *************** *** 157,162 **** public void TablePrivileges() { ! DataTable tablePrivileges = Connection.GetDbSchemaTable( ! PgDbSchemaType.Table_Privileges, null); } --- 139,143 ---- public void TablePrivileges() { ! DataTable tablePrivileges = Connection.GetSchema("TablePrivileges", null); } *************** *** 165,170 **** public void TableStatistics() { ! DataTable table_Statistics = Connection.GetDbSchemaTable( ! PgDbSchemaType.Table_Statistics, null); } --- 146,150 ---- public void TableStatistics() { ! DataTable tableStatistics = Connection.GetSchema("TableStatistics", null); } *************** *** 172,177 **** public void Tables() { ! DataTable tables = Connection.GetDbSchemaTable( ! PgDbSchemaType.Tables, null); } --- 152,156 ---- public void Tables() { ! DataTable tables = Connection.GetSchema("Tables", null); } *************** *** 180,185 **** public void TablesInfo() { ! DataTable tablesInfo = Connection.GetDbSchemaTable( ! PgDbSchemaType.Tables_Info, null); } --- 159,163 ---- public void TablesInfo() { ! DataTable tablesInfo = Connection.GetSchema("TablesInfo", null); } *************** *** 188,193 **** public void TriggerParameters() { ! DataTable triggerParameters = Connection.GetDbSchemaTable( ! PgDbSchemaType.Trigger_Parameters, null); } --- 166,170 ---- public void TriggerParameters() { ! DataTable triggerParameters = Connection.GetSchema("TriggerParameters", null); } *************** *** 196,201 **** public void TriggerPrivileges() { ! DataTable triggerPrivileges = Connection.GetDbSchemaTable( ! PgDbSchemaType.Trigger_Privileges, null); } --- 173,177 ---- public void TriggerPrivileges() { ! DataTable triggerPrivileges = Connection.GetSchema("TriggerPrivileges", null); } *************** *** 203,208 **** public void Triggers() { ! DataTable triggers = Connection.GetDbSchemaTable( ! PgDbSchemaType.Triggers, null); } --- 179,183 ---- public void Triggers() { ! DataTable triggers = Connection.GetSchema("Triggers", null); } *************** *** 211,216 **** public void UsagePrivileges() { ! DataTable usagePrivileges = Connection.GetDbSchemaTable( ! PgDbSchemaType.Usage_Privileges, null); } --- 186,190 ---- public void UsagePrivileges() { ! DataTable usagePrivileges = Connection.GetSchema("UsagePrivileges", null); } *************** *** 219,224 **** public void ViewColumnUsage() { ! DataTable viewColumnUsage = Connection.GetDbSchemaTable( ! PgDbSchemaType.View_Column_Usage, null); } --- 193,197 ---- public void ViewColumnUsage() { ! DataTable viewColumnUsage = Connection.GetSchema("ViewColumnUsage", null); } *************** *** 226,231 **** public void ViewPrivileges() { ! DataTable viewPrivileges = Connection.GetDbSchemaTable( ! PgDbSchemaType.View_Privileges, null); } --- 199,203 ---- public void ViewPrivileges() { ! DataTable viewPrivileges = Connection.GetSchema("ViewPrivileges", null); } *************** *** 233,238 **** public void Views() { ! DataTable views = Connection.GetDbSchemaTable( ! PgDbSchemaType.Views, null); } } --- 205,209 ---- public void Views() { ! DataTable views = Connection.GetSchema("Views", null); } } |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:15:06
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16997 Modified Files: PgBaseTest.cs Log Message: Mayor update of the PgSqlClient sources Index: PgBaseTest.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient.UnitTests/source/PgBaseTest.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PgBaseTest.cs 19 May 2004 10:39:17 -0000 1.11 --- PgBaseTest.cs 29 Sep 2004 12:14:52 -0000 1.12 *************** *** 98,101 **** --- 98,103 ---- connection.Open(); + #warning "Create dtabase here" + /* connection.CreateDatabase( ConfigurationSettings.AppSettings["Database"], *************** *** 104,107 **** --- 106,110 ---- null, "UNICODE"); + */ connection.Close(); |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:13:57
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16805 Modified Files: changelog.txt Log Message: Mayor update of the PgSqlClient sources Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** changelog.txt 22 Jul 2004 11:00:07 -0000 1.123 --- changelog.txt 29 Sep 2004 12:13:45 -0000 1.124 *************** *** 2,5 **** --- 2,8 ---- ------------------------------------------------------- + 2004-09-29 Carlos Guzman Alvarez <car...@te...> + + - Mayour update of the sources |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:11:05
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16289 Modified Files: PgCodes.cs PgConnectionParams.cs PgDbClient.cs PgStatement.cs Log Message: Mayor update of the PgSqlClient sources Index: PgConnectionParams.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgConnectionParams.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgConnectionParams.cs 10 Apr 2004 20:16:07 -0000 1.6 --- PgConnectionParams.cs 29 Sep 2004 12:10:53 -0000 1.7 *************** *** 33,36 **** --- 33,39 ---- private int packetSize; private int timeout; + private int connectionLifetime; + private int minPoolSize; + private int maxPoolSize; private bool pooling; private Encoding encoding; *************** *** 89,92 **** --- 92,113 ---- } + public int ConnectionLifeTime + { + get { return this.connectionLifetime; } + set { this.connectionLifetime = value; } + } + + public int MinPoolSize + { + get { return this.minPoolSize; } + set { this.minPoolSize = value; } + } + + public int MaxPoolSize + { + get { return this.maxPoolSize; } + set { this.maxPoolSize = value; } + } + public bool Pooling { *************** *** 114,117 **** --- 135,141 ---- this.pooling = true; this.timeout = 15; + this.connectionLifetime = 0; + this.minPoolSize = 0; + this.maxPoolSize = 100; this.encoding = Encoding.Default; } Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** PgDbClient.cs 22 Jul 2004 10:58:58 -0000 1.52 --- PgDbClient.cs 29 Sep 2004 12:10:53 -0000 1.53 *************** *** 154,166 **** #region Constructors ! public PgDbClient() { - this.parameterStatus = new Hashtable(); - this.buffer = new PgResponsePacket(); } ! public PgDbClient(PgConnectionParams settings) : this() { ! this.settings = settings; } --- 154,168 ---- #region Constructors ! public PgDbClient() : this(null) { } ! public PgDbClient(PgConnectionParams settings) { ! this.parameterStatus = new Hashtable(); ! this.buffer = new PgResponsePacket(); ! this.settings = settings; ! ! GC.SuppressFinalize(this); } *************** *** 326,331 **** packet.WriteNullString("user"); packet.WriteNullString(this.settings.UserName); ! if (settings.Database != null && ! this.settings.Database.Length > 0) { packet.WriteNullString("database"); --- 328,332 ---- packet.WriteNullString("user"); packet.WriteNullString(this.settings.UserName); ! if (settings.Database != null && this.settings.Database.Length > 0) { packet.WriteNullString("database"); *************** *** 345,349 **** { response = this.ReceiveResponsePacket(); ! this.processResponsePacket(response); } } --- 346,350 ---- { response = this.ReceiveResponsePacket(); ! this.ProcessResponsePacket(response); } } *************** *** 387,405 **** internal void SendPacket(PgOutputPacket packet, char type) { ! try ! { ! this.send.Write(packet.GetPacketBytes(type)); ! } ! catch (IOException ex) ! { ! throw ex; ! } } internal void SendSimplePacket(PgOutputPacket packet) { try { ! this.send.Write(packet.GetSimplePacketBytes()); } catch (IOException ex) --- 388,410 ---- internal void SendPacket(PgOutputPacket packet, char type) { ! this.Write(packet.GetPacketBytes(type)); } internal void SendSimplePacket(PgOutputPacket packet) { + this.Write(packet.GetSimplePacketBytes()); + } + + private void Write(byte[] buffer) + { + this.Write(buffer, 0, buffer.Length); + } + + private void Write(byte[] buffer, int index, int count) + { try { ! this.send.Write(buffer, index, count); ! this.send.Flush(); } catch (IOException ex) *************** *** 419,423 **** lock (this) { ! responsePacket = this.receiveStandardPacket(); switch (responsePacket.Message) --- 424,428 ---- lock (this) { ! responsePacket = this.ReceiveStandardPacket(); switch (responsePacket.Message) *************** *** 425,429 **** case PgBackendCodes.ERROR_RESPONSE: // Read the error message and trow the exception ! PgClientException ex = processErrorPacket(responsePacket); // Perform a sync --- 430,434 ---- case PgBackendCodes.ERROR_RESPONSE: // Read the error message and trow the exception ! PgClientException ex = this.ProcessErrorPacket(responsePacket); // Perform a sync *************** *** 435,443 **** case PgBackendCodes.NOTICE_RESPONSE: // Read the notice message and raise an InfoMessage event ! this.InfoMessage(processErrorPacket(responsePacket)); break; case PgBackendCodes.NOTIFICATION_RESPONSE: ! this.processNotificationResponse(responsePacket); break; } --- 440,448 ---- case PgBackendCodes.NOTICE_RESPONSE: // Read the notice message and raise an InfoMessage event ! this.InfoMessage(this.ProcessErrorPacket(responsePacket)); break; case PgBackendCodes.NOTIFICATION_RESPONSE: ! this.ProcessNotificationResponse(responsePacket); break; } *************** *** 447,451 **** } ! private PgResponsePacket receiveStandardPacket() { PgResponsePacket responsePacket = null; --- 452,456 ---- } ! private PgResponsePacket ReceiveStandardPacket() { PgResponsePacket responsePacket = null; *************** *** 476,489 **** } ! private void processResponsePacket(PgResponsePacket packet) { switch (packet.Message) { case PgBackendCodes.AUTHENTICATION: ! this.processAuthPacket(packet); break; case PgBackendCodes.PARAMETER_STATUS: ! this.processParameterStatus(packet); break; --- 481,494 ---- } ! private void ProcessResponsePacket(PgResponsePacket packet) { switch (packet.Message) { case PgBackendCodes.AUTHENTICATION: ! this.ProcessAuthPacket(packet); break; case PgBackendCodes.PARAMETER_STATUS: ! this.ProcessParameterStatus(packet); break; *************** *** 500,507 **** } ! private void processParameterStatus(PgResponsePacket packet) { ! string parameterName = packet.ReadNullString(); ! string parameterValue = packet.ReadNullString(); parameterStatus.Add(parameterName, parameterValue); --- 505,512 ---- } ! private void ProcessParameterStatus(PgResponsePacket packet) { ! string parameterName = packet.ReadNullString(); ! string parameterValue = packet.ReadNullString(); parameterStatus.Add(parameterName, parameterValue); *************** *** 515,519 **** } ! private void processAuthPacket(PgResponsePacket packet) { // Authentication response --- 520,524 ---- } ! private void ProcessAuthPacket(PgResponsePacket packet) { // Authentication response *************** *** 572,576 **** } ! private PgClientException processErrorPacket(PgResponsePacket packet) { char type = ' '; --- 577,581 ---- } ! private PgClientException ProcessErrorPacket(PgResponsePacket packet) { char type = ' '; *************** *** 631,635 **** } ! private void processNotificationResponse(PgResponsePacket packet) { int processID = packet.ReadInt(); --- 636,640 ---- } ! private void ProcessNotificationResponse(PgResponsePacket packet) { int processID = packet.ReadInt(); *************** *** 743,747 **** { response = this.ReceiveResponsePacket(); ! this.processResponsePacket(response); } } --- 748,752 ---- { response = this.ReceiveResponsePacket(); ! this.ProcessResponsePacket(response); } } *************** *** 752,756 **** { response = this.ReceiveResponsePacket(); ! this.processResponsePacket(response); } --- 757,761 ---- { response = this.ReceiveResponsePacket(); ! this.ProcessResponsePacket(response); } *************** *** 860,866 **** IPEndPoint EPhost = new IPEndPoint(hostadd, settings.ServerPort); ! this.socket = new Socket(AddressFamily.InterNetwork, ! SocketType.Stream, ! ProtocolType.IP); // Set Receive Buffer size. --- 865,869 ---- IPEndPoint EPhost = new IPEndPoint(hostadd, settings.ServerPort); ! this.socket = new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.IP); // Set Receive Buffer size. *************** *** 887,892 **** // Create objects for read & write ! this.receive = new BinaryReader(this.networkStream); ! this.send = new BinaryWriter(this.networkStream); } --- 890,901 ---- // Create objects for read & write ! this.receive = new BinaryReader(new BufferedStream(this.networkStream)); ! this.send = new BinaryWriter(new BufferedStream(this.networkStream)); ! ! // The socket and stream shouldn't be automatically collected by the GC ! GC.SuppressFinalize(this.socket); ! GC.SuppressFinalize(this.networkStream); ! GC.SuppressFinalize(this.receive); ! GC.SuppressFinalize(this.send); } Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgStatement.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PgStatement.cs 22 Jul 2004 10:58:58 -0000 1.26 --- PgStatement.cs 29 Sep 2004 12:10:53 -0000 1.27 *************** *** 140,179 **** #region Constructors ! public PgStatement() { - this.outParameter = new PgParameter(); - this.rows = null; - this.rowIndex = 0; - this.parseName = String.Empty; - this.portalName = String.Empty; - this.recordsAffected = -1; - this.status = PgStatementStatus.Initial; - this.fetchSize = 200; } ! public PgStatement(PgDbClient db) : this() { - this.db = db; } ! public PgStatement(PgDbClient db, string parseName, string portalName) : this(parseName, portalName) { - this.db = db; } ! public PgStatement(PgDbClient db, string parseName, string portalName, string stmtText) : this(db, parseName, portalName) { - this.stmtText = stmtText; } ! public PgStatement(PgDbClient db, string stmtText) : this(db) { - this.stmtText = stmtText; } ! public PgStatement(string parseName, string portalName) : this() { ! this.parseName = parseName; ! this.portalName = portalName; } --- 140,177 ---- #region Constructors ! public PgStatement() : this(null) { } ! public PgStatement(PgDbClient db) : this(db, null, null) { } ! public PgStatement(PgDbClient db, string parseName, string portalName) : this(db, parseName, portalName, null) { } ! public PgStatement(PgDbClient db, string stmtText) : this(db, null, null, stmtText) { } ! public PgStatement(string parseName, string portalName) : this(null, parseName, portalName, null) { } ! public PgStatement(PgDbClient db, string parseName, string portalName, string stmtText) { ! this.db = db; ! this.outParameter = new PgParameter(); ! this.rows = null; ! this.rowIndex = 0; ! this.parseName = String.Empty; ! this.portalName = String.Empty; ! this.recordsAffected = -1; ! this.status = PgStatementStatus.Initial; ! this.fetchSize = 200; ! this.stmtText = stmtText; ! ! GC.SuppressFinalize(this); } *************** *** 220,232 **** public void Describe() { ! this.describe('S'); } public void DescribePortal() { ! this.describe('P'); } ! private void describe(char stmtType) { lock (this.db) --- 218,230 ---- public void Describe() { ! this.Describe('S'); } public void DescribePortal() { ! this.Describe('P'); } ! private void Describe(char stmtType) { lock (this.db) *************** *** 279,282 **** --- 277,281 ---- // Destination portal name packet.WriteNullString(this.PortalName); + // Prepared statement name packet.WriteNullString(this.ParseName); *************** *** 530,542 **** public void Close() { ! this.close('S'); } public void ClosePortal() { ! this.close('P'); } ! private void close(char stmtType) { lock (this.db) --- 529,541 ---- public void Close() { ! this.Close('S'); } public void ClosePortal() { ! this.Close('P'); } ! private void Close(char stmtType) { lock (this.db) Index: PgCodes.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCodes.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PgCodes.cs 20 Jul 2004 18:41:43 -0000 1.4 --- PgCodes.cs 29 Sep 2004 12:10:53 -0000 1.5 *************** *** 119,123 **** // ! public static readonly DateTime BASE_DATE = new DateTime(2000, 1, 1); // MD5 prefix --- 119,123 ---- // ! public static readonly DateTime BASE_DATE = new DateTime(2000, 1, 1); // MD5 prefix *************** *** 129,133 **** // Date & Time codes ! public const string DATE_STYLE = "ISO"; // Numeric data type --- 129,133 ---- // Date & Time codes ! public const string DATE_STYLE = "ISO"; // Numeric data type |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16138 Modified Files: PgAggregatesSchema.cs PgCastsSchema.cs PgCheckConstraints.cs PgCheckConstraintsByTable.cs PgColumnsSchema.cs PgDatabaseSchema.cs PgDbSchema.cs PgDbSchemaFactory.cs PgDomainsSchema.cs PgForeignKeysSchema.cs PgFunctionPrivilegesSchema.cs PgFunctionsSchema.cs PgGroupsSchema.cs PgIndexesSchema.cs PgPrimaryKeysSchema.cs PgProviderTypesSchema.cs PgSchemataSchema.cs PgSqlLanguagesSchema.cs PgTableConstraintsSchema.cs PgTablePrivilegesSchema.cs PgTablesSchema.cs PgTableStatisticsSchema.cs PgTriggersSchema.cs PgUsersSchema.cs PgViewPrivilegesSchema.cs PgViewsSchema.cs Log Message: Mayor update of the PgSqlClient sources Index: PgCastsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCastsSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgCastsSchema.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgCastsSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 74,80 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 74,80 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgDbSchemaFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDbSchemaFactory.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgDbSchemaFactory.cs 6 Apr 2004 14:17:33 -0000 1.3 --- PgDbSchemaFactory.cs 29 Sep 2004 12:10:10 -0000 1.4 *************** *** 23,136 **** internal class PgDbSchemaFactory { ! public static PgDbSchema GetSchema(PgDbSchemaType schema) { PgDbSchema returnSchema = null; ! switch(schema) { ! case PgDbSchemaType.Aggregates: returnSchema = new PgAggregatesSchema(); break; ! case PgDbSchemaType.Casts: returnSchema = new PgCastsSchema(); break; ! case PgDbSchemaType.Check_Constraints: returnSchema = new PgCheckConstraintsSchema(); break; ! case PgDbSchemaType.Check_Constraints_By_Table: returnSchema = new PgCheckConstraintsByTableSchema(); break; ! case PgDbSchemaType.Columns: returnSchema = new PgColumnsSchema(); break; ! case PgDbSchemaType.Database: returnSchema = new PgDatabaseSchema(); break; ! case PgDbSchemaType.Domains: returnSchema = new PgDomainsSchema(); break; ! case PgDbSchemaType.Foreign_Keys: returnSchema = new PgForeignKeysSchema(); break; ! case PgDbSchemaType.Groups: returnSchema = new PgGroupsSchema(); break; ! case PgDbSchemaType.Indexes: returnSchema = new PgIndexesSchema(); break; ! case PgDbSchemaType.Primary_Keys: returnSchema = new PgPrimaryKeysSchema(); break; ! case PgDbSchemaType.Function_Privileges: returnSchema = new PgFunctionPrivilegesSchema(); break; ! case PgDbSchemaType.Functions: returnSchema = new PgFunctionsSchema(); break; ! case PgDbSchemaType.Provider_Types: returnSchema = new PgProviderTypesSchema(); break; ! case PgDbSchemaType.Schemata: returnSchema = new PgSchemataSchema(); break; ! case PgDbSchemaType.Sql_Languages: returnSchema = new PgSqlLanguagesSchema(); break; ! case PgDbSchemaType.Statistics: break; ! case PgDbSchemaType.Tables: returnSchema = new PgTablesSchema(); break; ! case PgDbSchemaType.Table_Constraint: returnSchema = new PgTableConstraintsSchema(); break; ! case PgDbSchemaType.Tables_Info: break; ! case PgDbSchemaType.Table_Privileges: returnSchema = new PgTablePrivilegesSchema(); break; ! case PgDbSchemaType.Table_Statistics: break; ! case PgDbSchemaType.Triggers: returnSchema = new PgTriggersSchema(); break; ! case PgDbSchemaType.Trigger_Parameters: ! break; ! ! case PgDbSchemaType.Trigger_Privileges: ! break; ! ! case PgDbSchemaType.Users: returnSchema = new PgUsersSchema(); break; ! case PgDbSchemaType.Views: returnSchema = new PgViewsSchema(); break; ! case PgDbSchemaType.View_Privileges: returnSchema = new PgViewPrivilegesSchema(); break; --- 23,130 ---- internal class PgDbSchemaFactory { ! public static PgDbSchema GetSchema(string collectionName) { PgDbSchema returnSchema = null; ! switch (collectionName.ToLower()) { ! case "aggregates": returnSchema = new PgAggregatesSchema(); break; ! case "casts": returnSchema = new PgCastsSchema(); break; ! case "checkconstraints": returnSchema = new PgCheckConstraintsSchema(); break; ! case "checkconstraintsbytable": returnSchema = new PgCheckConstraintsByTableSchema(); break; ! case "columns": returnSchema = new PgColumnsSchema(); break; ! case "database": returnSchema = new PgDatabaseSchema(); break; ! case "domains": returnSchema = new PgDomainsSchema(); break; ! case "foreignkeys": returnSchema = new PgForeignKeysSchema(); break; ! case "groups": returnSchema = new PgGroupsSchema(); break; ! case "indexes": returnSchema = new PgIndexesSchema(); break; ! case "primarykeys": returnSchema = new PgPrimaryKeysSchema(); break; ! case "functionprivileges": returnSchema = new PgFunctionPrivilegesSchema(); break; ! case "functions": returnSchema = new PgFunctionsSchema(); break; ! case "providertypes": returnSchema = new PgProviderTypesSchema(); break; ! case "schemata": returnSchema = new PgSchemataSchema(); break; ! case "sqllanguages": returnSchema = new PgSqlLanguagesSchema(); break; ! case "statistics": break; ! case "tables": returnSchema = new PgTablesSchema(); break; ! case "tableconstraint": returnSchema = new PgTableConstraintsSchema(); break; ! case "tablesinfo": break; ! case "tableprivileges": returnSchema = new PgTablePrivilegesSchema(); break; ! case "tablestatistics": break; ! case "triggers": returnSchema = new PgTriggersSchema(); break; ! case "users": returnSchema = new PgUsersSchema(); break; ! case "views": returnSchema = new PgViewsSchema(); break; ! case "viewprivileges": returnSchema = new PgViewPrivilegesSchema(); break; Index: PgTriggersSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTriggersSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgTriggersSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 --- PgTriggersSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 79,85 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 79,85 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgPrimaryKeysSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgPrimaryKeysSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgPrimaryKeysSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgPrimaryKeysSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 77,83 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 77,83 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgDbSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDbSchema.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgDbSchema.cs 6 Apr 2004 14:17:33 -0000 1.1 --- PgDbSchema.cs 29 Sep 2004 12:10:10 -0000 1.2 *************** *** 107,111 **** public abstract void AddOrderByColumns(); public abstract void AddWhereFilters(); ! public abstract object[] ParseRestrictions(object[] restrictions); #endregion --- 107,111 ---- public abstract void AddOrderByColumns(); public abstract void AddWhereFilters(); ! public abstract string[] ParseRestrictions(string[] restrictions); #endregion *************** *** 172,178 **** #region Methods ! public virtual DataTable GetDbSchemaTable(PgConnection connection, object[] restrictions) { ! restrictions = ParseRestrictions(restrictions); DataSet dataSet = null; --- 172,178 ---- #region Methods ! public virtual DataTable GetSchema(PgConnection connection, string[] restrictions) { ! restrictions = this.ParseRestrictions(restrictions); DataSet dataSet = null; *************** *** 184,191 **** command.Connection = connection; command.CommandText = GetCommandText(restrictions); ! if (connection.ActiveTransaction != null && ! !connection.ActiveTransaction.IsUpdated) { ! command.Transaction = connection.ActiveTransaction; } --- 184,190 ---- command.Connection = connection; command.CommandText = GetCommandText(restrictions); ! if (connection.InternalConnection.HasActiveTransaction) { ! command.Transaction = connection.InternalConnection.ActiveTransaction; } Index: PgProviderTypesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgProviderTypesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgProviderTypesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgProviderTypesSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 77,83 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 77,83 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgDatabaseSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDatabaseSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgDatabaseSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgDatabaseSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 68,74 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 68,74 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgIndexesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgIndexesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgIndexesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgIndexesSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 86,92 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 86,92 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgSchemataSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgSchemataSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgSchemataSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgSchemataSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 71,77 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 71,77 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgTablePrivilegesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTablePrivilegesSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgTablePrivilegesSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 --- PgTablePrivilegesSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 72,79 **** #region Overriden Methods ! public override DataTable GetDbSchemaTable(PgConnection connection, object[] restrictions) { ! DataTable tablesSchema = base.GetDbSchemaTable(connection, restrictions); ! DataTable privileges = getPrivilegesDataTable(); privileges.BeginLoadData(); --- 72,79 ---- #region Overriden Methods ! public override DataTable GetSchema(PgConnection connection, string[] restrictions) { ! DataTable tablesSchema = this.GetSchema(connection, restrictions); ! DataTable privileges = this.getPrivilegesDataTable(); privileges.BeginLoadData(); *************** *** 126,134 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; ! ! return parsed; } --- 126,132 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! return restrictions; } Index: PgFunctionPrivilegesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgFunctionPrivilegesSchema.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgFunctionPrivilegesSchema.cs 22 Jul 2004 10:58:15 -0000 1.8 --- PgFunctionPrivilegesSchema.cs 29 Sep 2004 12:10:10 -0000 1.9 *************** *** 70,76 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 70,76 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; *************** *** 81,88 **** #region Overriden Methods ! public override DataTable GetDbSchemaTable(PgConnection connection, object[] restrictions) { ! DataTable tablesSchema = base.GetDbSchemaTable(connection, restrictions); ! DataTable privileges = getPrivilegesDataTable(); privileges.BeginLoadData(); --- 81,88 ---- #region Overriden Methods ! public override DataTable GetSchema(PgConnection connection, string[] restrictions) { ! DataTable tablesSchema = this.GetSchema(connection, restrictions); ! DataTable privileges = this.GetPrivilegesDataTable(); privileges.BeginLoadData(); *************** *** 114,118 **** } ! private DataTable getPrivilegesDataTable() { DataTable privileges = new DataTable("Function_Privileges"); --- 114,118 ---- } ! private DataTable GetPrivilegesDataTable() { DataTable privileges = new DataTable("Function_Privileges"); Index: PgSqlLanguagesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgSqlLanguagesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgSqlLanguagesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgSqlLanguagesSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 73,79 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 73,79 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgTableConstraintsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTableConstraintsSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgTableConstraintsSchema.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgTableConstraintsSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 79,85 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; if (parsed != null) --- 79,85 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; if (parsed != null) Index: PgUsersSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgUsersSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgUsersSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgUsersSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 71,77 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 71,77 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgForeignKeysSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgForeignKeysSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgForeignKeysSchema.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgForeignKeysSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 85,91 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 85,91 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgTablesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTablesSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgTablesSchema.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgTablesSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 81,87 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; if (parsed != null) --- 81,87 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; if (parsed != null) Index: PgCheckConstraintsByTable.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCheckConstraintsByTable.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgCheckConstraintsByTable.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgCheckConstraintsByTable.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 79,85 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; if (parsed != null) --- 79,85 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; if (parsed != null) Index: PgFunctionsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgFunctionsSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgFunctionsSchema.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgFunctionsSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 82,88 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 82,88 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgViewsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgViewsSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgViewsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgViewsSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 74,80 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 74,80 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgTableStatisticsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgTableStatisticsSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgTableStatisticsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgTableStatisticsSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 77,83 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 77,83 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgCheckConstraints.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgCheckConstraints.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgCheckConstraints.cs 22 Jul 2004 10:58:15 -0000 1.7 --- PgCheckConstraints.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 73,79 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; if (parsed != null) --- 73,79 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; if (parsed != null) Index: PgColumnsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgColumnsSchema.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PgColumnsSchema.cs 22 Jul 2004 10:58:15 -0000 1.9 --- PgColumnsSchema.cs 29 Sep 2004 12:10:10 -0000 1.10 *************** *** 91,97 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 91,97 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgGroupsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgGroupsSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgGroupsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgGroupsSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 67,73 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 67,73 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgAggregatesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgAggregatesSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgAggregatesSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgAggregatesSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 71,77 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 71,77 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgViewPrivilegesSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgViewPrivilegesSchema.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgViewPrivilegesSchema.cs 6 Apr 2004 14:17:33 -0000 1.7 --- PgViewPrivilegesSchema.cs 29 Sep 2004 12:10:10 -0000 1.8 *************** *** 72,79 **** #region Overriden Methods ! public override DataTable GetDbSchemaTable(PgConnection connection, object[] restrictions) { ! DataTable tablesSchema = base.GetDbSchemaTable(connection, restrictions); ! DataTable privileges = getPrivilegesDataTable(); privileges.BeginLoadData(); --- 72,79 ---- #region Overriden Methods ! public override DataTable GetSchema(PgConnection connection, string[] restrictions) { ! DataTable tablesSchema = this.GetSchema(connection, restrictions); ! DataTable privileges = this.GetPrivilegesDataTable(); privileges.BeginLoadData(); *************** *** 105,110 **** } ! ! private DataTable getPrivilegesDataTable() { DataTable privileges = new DataTable("Table_Privileges"); --- 105,109 ---- } ! private DataTable GetPrivilegesDataTable() { DataTable privileges = new DataTable("Table_Privileges"); *************** *** 127,133 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 126,132 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; Index: PgDomainsSchema.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgDomainsSchema.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgDomainsSchema.cs 6 Apr 2004 14:17:33 -0000 1.6 --- PgDomainsSchema.cs 29 Sep 2004 12:10:10 -0000 1.7 *************** *** 79,85 **** #region Parse Methods ! public override object[] ParseRestrictions(object[] restrictions) { ! object[] parsed = restrictions; return parsed; --- 79,85 ---- #region Parse Methods ! public override string[] ParseRestrictions(string[] restrictions) { ! string[] parsed = restrictions; return parsed; |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:09:30
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15552 Added Files: PgConnectionInternal.cs Log Message: Mayor update of the PgSqlClient sources --- NEW FILE: PgConnectionInternal.cs --- /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ * Copyright (c) 2003-2004 Carlos Guzman Alvarez * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Collections; using System.Data; using System.Text; using System.Text.RegularExpressions; using Mono.Security.Protocol.Tls; using PostgreSql.Data.NPgClient; using PostgreSql.Data.PgSqlClient.DbSchema; namespace PostgreSql.Data.PgSqlClient { internal sealed class PgConnectionInternal : MarshalByRefObject { #region Fields private string connectionString; private PgConnection owningConnection; private PgDbClient database; private PgConnectionParams options; private PgTransaction activeTransaction; private ArrayList preparedCommands; private int lifetime; private long created; private bool pooled; #endregion #region Properties public PgDbClient Database { get { return this.database; } } public PgTransaction ActiveTransaction { get { return this.activeTransaction; } set { this.activeTransaction = value; } } public string ConnectionString { get { return this.connectionString; } } public int Lifetime { get { return this.lifetime; } set { this.lifetime = value; } } public long Created { get { return this.created; } set { this.created = value; } } public bool Pooled { get { return this.pooled; } set { this.pooled = value; } } public PgConnectionParams Options { get { return this.options; } } public ArrayList PreparedCommands { get { if (this.preparedCommands == null) { this.preparedCommands = new ArrayList(); } return this.preparedCommands; } } public bool HasActiveTransaction { get { return (this.activeTransaction != null && !this.activeTransaction.IsUpdated); } } public PgConnection OwningConnection { set { this.owningConnection = value; } } #endregion #region Constructors public PgConnectionInternal(string connectionString) { this.options = new PgConnectionParams(); this.connectionString = connectionString; this.lifetime = 0; this.created = 0; this.pooled = true; this.database = new PgDbClient(); this.owningConnection = owningConnection; if (connectionString != null) { this.ParseConnectionString(connectionString); } } #endregion #region Methods public void Connect() { try { this.database.SslConnection = new SslConnectionCallback(OnSslConnection); this.database.Settings = this.Options; this.database.Connect(); } catch (PgClientException ex) { throw new PgException(ex.Message, ex); } } public void Disconnect() { try { this.database.Disconnect(); } catch (PgClientException ex) { throw new PgException(ex.Message, ex); } } public PgTransaction BeginTransaction(IsolationLevel level) { if (this.activeTransaction != null && !this.activeTransaction.IsUpdated) { throw new InvalidOperationException("A transaction is currently active. Parallel transactions are not supported."); } try { this.activeTransaction = new PgTransaction(this.owningConnection, level); this.activeTransaction.InternalBeginTransaction(); } catch (PgClientException ex) { throw new PgException(ex.Message, ex); } return this.activeTransaction; } public DataTable GetSchema(string collectionName, string[] restrictions) { PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(collectionName); if (dbSchema == null) { throw new NotSupportedException("Specified schema type is not supported."); } if (restrictions != null) { if (restrictions.Length > dbSchema.RestrictionColumns.Count) { throw new InvalidOperationException("The number of specified restrictions is not valid."); } } return dbSchema.GetSchema(this.owningConnection, restrictions); } public void DisposeActiveTransaction() { // Rollback active transation if (this.HasActiveTransaction) { this.activeTransaction.Dispose(); this.activeTransaction = null; } } public void DisposePreparedCommands() { if (this.PreparedCommands.Count > 0) { PgCommand[] commands = new PgCommand[this.PreparedCommands.Count]; this.PreparedCommands.CopyTo(0, commands, 0, commands.Length); foreach (PgCommand command in commands) { command.Dispose(); } this.preparedCommands.Clear(); this.preparedCommands = null; } } public void AddPreparedCommand(PgCommand command) { if (!this.PreparedCommands.Contains(command)) { this.PreparedCommands.Add(command); } } public void RemovePreparedCommand(PgCommand command) { if (this.PreparedCommands.Contains(command)) { this.PreparedCommands.Remove(command); } } #endregion #region Internal Methods internal bool Verify() { bool isValid = true; try { // Try to send a Sync message to the PostgreSQL Server this.database.Sync(); } catch (Exception) { isValid = false; } return isValid; } #endregion #region Private Methods private void ParseConnectionString(string connectionStirng) { Regex search = new Regex(@"([\w\s\d]*)\s*=\s*([^;]*)"); MatchCollection elements = search.Matches(connectionString); foreach (Match element in elements) { if (element.Groups[2].Value.Trim().Length > 0) { switch (element.Groups[1].Value.Trim().ToLower()) { case "datasource": case "server": case "host": this.options.ServerName = element.Groups[2].Value.Trim(); break; case "database": this.options.Database = element.Groups[2].Value.Trim(); break; case "user name": case "user": this.options.UserName = element.Groups[2].Value.Trim(); break; case "user password": case "password": this.options.UserPassword = element.Groups[2].Value.Trim(); break; case "port": this.options.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); break; case "connection lifetime": this.lifetime = Int32.Parse(element.Groups[2].Value.Trim()); break; case "timeout": case "connection timeout": this.options.Timeout = Int32.Parse(element.Groups[2].Value.Trim()); break; case "packet size": this.options.PacketSize = Int32.Parse(element.Groups[2].Value.Trim()); break; case "pooling": this.options.Pooling = Boolean.Parse(element.Groups[2].Value.Trim()); break; case "ssl": this.options.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); break; } } } if (options.UserName == String.Empty || options.ServerName == String.Empty || options.ServerPort == 0) { throw new ArgumentException("An invalid connection string argument has been supplied or a required connection string argument has not been supplied."); } else { if (options.PacketSize < 512 || options.PacketSize > 32767) { StringBuilder msg = new StringBuilder(); msg.AppendFormat("'Packet Size' value of {0} is not valid.\r\nThe value should be an integer >= 512 and <= 32767.", options.PacketSize); throw new ArgumentException(msg.ToString()); } } } #endregion #region SSL Callbacks private void OnSslConnection() { // Server certificate validation this.database.SslClientStream.ServerCertValidationDelegate = new CertificateValidationCallback(owningConnection.OnServerCertificateValidation); // Client certificate selection this.database.SslClientStream.ClientCertSelectionDelegate = new CertificateSelectionCallback(owningConnection.OnClientCertificateSelection); } #endregion } } |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:08:44
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15348 Modified Files: PgTransaction.cs Log Message: Mayor update of the PgSqlClient sources Index: PgTransaction.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTransaction.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PgTransaction.cs 22 Jul 2004 10:57:30 -0000 1.8 --- PgTransaction.cs 29 Sep 2004 12:08:34 -0000 1.9 *************** *** 70,75 **** if (this.connection != null && value) { ! this.connection.ActiveTransaction = null; ! this.connection = null; } this.isUpdated = value; --- 70,75 ---- if (this.connection != null && value) { ! this.connection.InternalConnection.ActiveTransaction = null; ! this.connection = null; } this.isUpdated = value; *************** *** 81,87 **** #region Constructors ! private PgTransaction() { - this.isolationLevel = IsolationLevel.ReadCommitted; } --- 81,86 ---- #region Constructors ! private PgTransaction() : this(null) { } *************** *** 112,116 **** { this.Dispose(true); ! System.GC.SuppressFinalize(this); } --- 111,115 ---- { this.Dispose(true); ! GC.SuppressFinalize(this); } *************** *** 133,138 **** if (this.connection != null) { ! this.connection.ActiveTransaction = null; ! this.connection = null; } this.disposed = true; --- 132,137 ---- if (this.connection != null) { ! this.connection.InternalConnection.ActiveTransaction = null; ! this.connection = null; } this.disposed = true; *************** *** 153,164 **** 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."); - } try { ! this.connection.DbConnection.DB.CommitTransaction(); this.IsUpdated = true; --- 152,159 ---- throw new InvalidOperationException("This Transaction has completed; it is no longer usable."); } try { ! this.connection.InternalConnection.Database.CommitTransaction(); this.IsUpdated = true; *************** *** 176,187 **** 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."); - } try { ! this.connection.DbConnection.DB.RollbackTransction(); this.IsUpdated = true; --- 171,178 ---- throw new InvalidOperationException("This Transaction has completed; it is no longer usable."); } try { ! this.connection.InternalConnection.Database.RollbackTransction(); this.IsUpdated = true; *************** *** 201,205 **** try { ! this.connection.DbConnection.DB.BeginTransaction(isolationLevel); this.IsUpdated = false; --- 192,196 ---- try { ! this.connection.InternalConnection.Database.BeginTransaction(isolationLevel); this.IsUpdated = false; |
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15260 Modified Files: PgCommand.cs PgCommandBuilder.cs PgConnection.cs PgConnectionPool.cs PgDataAdapter.cs PgDataReader.cs Log Message: Mayor update of the PgSqlClient sources Index: PgConnectionPool.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnectionPool.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgConnectionPool.cs 22 Jul 2004 10:57:53 -0000 1.7 --- PgConnectionPool.cs 29 Sep 2004 12:08:12 -0000 1.8 *************** *** 42,53 **** } ! public static PgDbConnection GetConnection(string connectionString, PgDbConnection connection) { Init(); ! return ((PgDbConnection)pool.CheckOut(connectionString, connection)); } ! public static void FreeConnection(PgDbConnection c) { pool.CheckIn(c); --- 42,53 ---- } ! public static PgConnectionInternal GetConnection(string connectionString, PgConnection owningConnection) { Init(); ! return ((PgConnectionInternal)pool.CheckOut(connectionString, owningConnection)); } ! public static void FreeConnection(PgConnectionInternal c) { pool.CheckIn(c); *************** *** 84,96 **** #region Methods ! public PgDbConnection CheckOut(string connectionString) ! { ! return this.CheckOut(connectionString, null); ! } ! ! public PgDbConnection CheckOut(string connectionString, PgDbConnection instance) { ! PgDbConnection newConnection = null; ! long now = System.DateTime.Now.Ticks; lock (typeof(PgConnectionPool)) --- 84,90 ---- #region Methods ! public PgConnectionInternal CheckOut(string connectionString, PgConnection owningConnection) { ! PgConnectionInternal newConnection = null; lock (typeof(PgConnectionPool)) *************** *** 98,105 **** 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)) --- 92,101 ---- if (this.unlocked.Count > 0) { ! long now = System.DateTime.Now.Ticks; ! ! PgConnectionInternal[] list = new PgConnectionInternal[this.unlocked.Count]; this.unlocked.CopyTo(0, list, 0, list.Length); ! foreach (PgConnectionInternal connection in list) { if (this.Validate(connection, connectionString)) *************** *** 116,120 **** this.unlocked.Remove(connection); this.locked.Add(connection); ! return connection; } --- 112,118 ---- this.unlocked.Remove(connection); this.locked.Add(connection); ! ! connection.OwningConnection = owningConnection; ! return connection; } *************** *** 136,150 **** } ! if (instance == null) ! { ! newConnection = this.Create(connectionString); ! } ! else ! { ! newConnection = instance; ! newConnection.Connect(); ! } ! newConnection.Pooled = true; ! newConnection.Created = System.DateTime.Now.Ticks; this.locked.Add(newConnection); --- 134,144 ---- } ! newConnection = this.Create(connectionString); ! ! newConnection.OwningConnection = owningConnection; ! newConnection.Pooled = true; ! newConnection.Created = System.DateTime.Now.Ticks; ! ! newConnection.Connect(); this.locked.Add(newConnection); *************** *** 154,162 **** } ! public void CheckIn(PgDbConnection connection) { lock (typeof(PgConnectionPool)) ! { connection.Created = System.DateTime.Now.Ticks; this.locked.Remove(connection); --- 148,157 ---- } ! public void CheckIn(PgConnectionInternal connection) { lock (typeof(PgConnectionPool)) ! { connection.Created = System.DateTime.Now.Ticks; + connection.OwningConnection = null; this.locked.Remove(connection); *************** *** 181,190 **** } ! private PgDbConnection Create(string connectionString) { try { ! PgDbConnection connection = new PgDbConnection(connectionString); ! connection.Connect(); return connection; --- 176,184 ---- } ! private PgConnectionInternal Create(string connectionString) { try { ! PgConnectionInternal connection = new PgConnectionInternal(connectionString); return connection; *************** *** 196,200 **** } ! private bool Validate(PgDbConnection connection, string connectionString) { try --- 190,194 ---- } ! private bool Validate(PgConnectionInternal connection, string connectionString) { try *************** *** 209,213 **** } ! private void Expire(PgDbConnection connection) { try --- 203,207 ---- } ! private void Expire(PgConnectionInternal connection) { try *************** *** 232,239 **** 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 (connection.Lifetime != 0) --- 226,233 ---- if (this.unlocked.Count > 0) { ! PgConnectionInternal[] list = new PgConnectionInternal[this.unlocked.Count]; this.unlocked.CopyTo(0, list, 0, list.Length); ! foreach (PgConnectionInternal connection in list) { if (connection.Lifetime != 0) Index: PgDataAdapter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataAdapter.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgDataAdapter.cs 10 Apr 2004 21:35:36 -0000 1.7 --- PgDataAdapter.cs 29 Sep 2004 12:08:12 -0000 1.8 *************** *** 33,38 **** #endregion ! [ToolboxItem(true), ! ToolboxBitmap(typeof(PgDataAdapter), "Resources.ToolBox.PgDataAdapter.bmp"), DefaultEvent("RowUpdated")] public sealed class PgDataAdapter : DbDataAdapter, IDbDataAdapter --- 33,37 ---- #endregion ! [ToolboxItem(true), ToolboxBitmap(typeof(PgDataAdapter), "Resources.ToolBox.PgDataAdapter.bmp"), DefaultEvent("RowUpdated")] public sealed class PgDataAdapter : DbDataAdapter, IDbDataAdapter Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PgCommandBuilder.cs 22 Jul 2004 10:57:53 -0000 1.22 --- PgCommandBuilder.cs 29 Sep 2004 12:08:06 -0000 1.23 *************** *** 207,212 **** command.Parameters.Clear(); ! DataTable spSchema = command.Connection.GetDbSchemaTable(PgDbSchemaType.Functions, ! new object[] {null, command.CommandText.ToLower()}); if (spSchema.Rows.Count != 0) --- 207,211 ---- command.Parameters.Clear(); ! DataTable spSchema = command.Connection.GetSchema("Functions", new string[] { null, command.CommandText.ToLower() }); if (spSchema.Rows.Count != 0) *************** *** 315,321 **** #region Build Command Methods ! private PgCommand BuildInsertCommand( ! DataRow row, ! DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); --- 314,318 ---- #region Build Command Methods ! private PgCommand BuildInsertCommand(DataRow row, DataTableMapping tableMapping) { StringBuilder sql = new StringBuilder(); Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PgCommand.cs 28 Aug 2004 20:50:10 -0000 1.41 --- PgCommand.cs 29 Sep 2004 12:08:05 -0000 1.42 *************** *** 30,35 **** namespace PostgreSql.Data.PgSqlClient { ! [ToolboxItem(true), ! ToolboxBitmap(typeof(PgCommand), "Resources.ToolBox.PgCommand.bmp")] public sealed class PgCommand : Component, IDbCommand, ICloneable { --- 30,34 ---- namespace PostgreSql.Data.PgSqlClient { ! [ToolboxItem(true), ToolboxBitmap(typeof(PgCommand), "Resources.ToolBox.PgCommand.bmp")] public sealed class PgCommand : Component, IDbCommand, ICloneable { *************** *** 42,47 **** private CommandBehavior commandBehavior; private bool disposed; - private int actualCommand; - private string[] commands; private string commandText; private CommandType commandType; --- 41,44 ---- *************** *** 52,55 **** --- 49,53 ---- private Hashtable matchReplaces; private PgStatement statement; + private PgDataReader activeDataReader; #endregion *************** *** 57,63 **** #region Properties ! [Category("Data"), ! DefaultValue(""), ! RefreshProperties(RefreshProperties.All)] public string CommandText { --- 55,59 ---- #region Properties ! [Category("Data"), DefaultValue(""), RefreshProperties(RefreshProperties.All)] public string CommandText { *************** *** 71,83 **** } ! this.commandText = value; ! this.actualCommand = 0; ! this.commands = null; } } ! [Category("Data"), ! DefaultValue(CommandType.Text), ! RefreshProperties(RefreshProperties.All)] public CommandType CommandType { --- 67,75 ---- } ! this.commandText = value; } } ! [Category("Data"), DefaultValue(CommandType.Text), RefreshProperties(RefreshProperties.All)] public CommandType CommandType { *************** *** 86,91 **** } ! [ReadOnly(true), ! DefaultValue(30)] public int CommandTimeout { --- 78,82 ---- } ! [ReadOnly(true), DefaultValue(30)] public int CommandTimeout { *************** *** 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) { --- 107,115 ---- set { ! if (this.connection != null && this.ActiveDataReader != null) { throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); } if (this.connection != value) { *************** *** 142,148 **** } ! [Browsable(false), ! DesignOnly(true), ! DefaultValue(true)] public bool DesignTimeVisible { --- 126,130 ---- } ! [Browsable(false), DesignOnly(true), DefaultValue(true)] public bool DesignTimeVisible { *************** *** 156,161 **** } ! [Category("Data"), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public PgParameterCollection Parameters { --- 138,142 ---- } ! [Category("Data"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public PgParameterCollection Parameters { *************** *** 169,175 **** } ! [Browsable(false), ! DataSysDescription("Tansaction context used by the command."), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public PgTransaction Transaction { --- 150,154 ---- } ! [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public PgTransaction Transaction { *************** *** 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."); --- 156,160 ---- set { ! if (this.connection != null && this.ActiveDataReader != null) { throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); *************** *** 197,200 **** --- 176,185 ---- #region Internal Properties + internal PgDataReader ActiveDataReader + { + get { return this.activeDataReader; } + set { this.activeDataReader = value; } + } + internal CommandBehavior CommandBehavior { *************** *** 233,237 **** this.commandType = CommandType.Text; this.commandTimeout = 30; - this.actualCommand = -1; this.updatedRowSource = UpdateRowSource.Both; this.commandBehavior = CommandBehavior.Default; --- 218,221 ---- *************** *** 240,245 **** this.namedParameters = new StringCollection(); this.matchReplaces = new Hashtable(); - - GC.SuppressFinalize(this); } --- 224,227 ---- *************** *** 255,260 **** { this.CommandText = cmdText; ! this.connection = connection; ! this.transaction = transaction; } --- 237,242 ---- { this.CommandText = cmdText; ! this.Connection = connection; ! this.Transaction = transaction; } *************** *** 274,287 **** if (this.connection != null && ! this.connection.ActiveCommands != null) { ! this.connection.ActiveCommands.Remove(this); } this.InternalClose(); ! this.commandText = String.Empty; ! this.actualCommand = -1; ! this.commands = null; this.matchReplaces.Clear(); --- 256,267 ---- if (this.connection != null && ! this.connection.InternalConnection != null) { ! this.connection.InternalConnection.RemovePreparedCommand(this); } this.InternalClose(); ! this.commandText = null; this.matchReplaces.Clear(); *************** *** 293,297 **** // release any unmanaged resources - this.disposed = true; } --- 273,276 ---- *************** *** 348,353 **** this.CheckCommand(); - this.SplitBatchCommands(false); - this.InternalPrepare(); this.InternalExecute(); --- 327,330 ---- *************** *** 379,384 **** this.commandBehavior = behavior; - this.SplitBatchCommands(true); - this.InternalPrepare(); --- 356,359 ---- *************** *** 392,396 **** } ! return new PgDataReader(this, this.connection); } --- 367,373 ---- } ! this.activeDataReader = new PgDataReader(this, this.connection); ! ! return this.activeDataReader; } *************** *** 401,406 **** object returnValue = null; - this.SplitBatchCommands(false); - this.InternalPrepare(); this.InternalExecute(); --- 378,381 ---- *************** *** 418,424 **** this.CheckCommand(); - this.SplitBatchCommands(false); this.InternalPrepare(); - this.connection.ActiveCommands.Add(this); } --- 393,397 ---- *************** *** 433,437 **** if (this.statement == null) { ! this.statement = this.connection.DbConnection.DB.CreateStatement(commandText); plan = this.statement.GetPlan(verbose); this.statement = null; --- 406,410 ---- if (this.statement == null) { ! this.statement = this.connection.InternalConnection.Database.CreateStatement(commandText); plan = this.statement.GetPlan(verbose); this.statement = null; *************** *** 456,466 **** internal void InternalPrepare() { ! if (this.commands == null) ! { ! this.SplitBatchCommands(false); ! } try { if (this.statement == null || this.statement.Status == PgStatementStatus.Initial || --- 429,440 ---- internal void InternalPrepare() { ! PgConnectionInternal conn = this.connection.InternalConnection; ! ! conn.AddPreparedCommand(this); try { + string sql = this.commandText; + if (this.statement == null || this.statement.Status == PgStatementStatus.Initial || *************** *** 469,473 **** if (this.commandType == CommandType.StoredProcedure) { ! this.commands[actualCommand] = this.BuildStoredProcedureSql(); } --- 443,447 ---- if (this.commandType == CommandType.StoredProcedure) { ! sql = this.BuildStoredProcedureSql(sql); } *************** *** 475,482 **** string portalName = "PR" + this.GetStmtName(); ! this.statement = this.connection.DbConnection.DB.CreateStatement( ! prepareName, ! portalName, ! this.ParseParameterNames()); // Parse statement --- 449,454 ---- string portalName = "PR" + this.GetStmtName(); ! this.statement = conn.Database.CreateStatement( ! prepareName, portalName, this.ParseParameterNames(sql)); // Parse statement *************** *** 536,572 **** } } ! ! internal bool NextResult() ! { ! bool returnValue = false; ! ! this.statement.Close(); ! this.statement.ClosePortal(); ! this.statement = null; ! ! if ((this.commandBehavior & CommandBehavior.SingleResult) != CommandBehavior.SingleResult) ! { ! this.actualCommand++; ! ! if (this.actualCommand >= this.commands.Length) ! { ! this.actualCommand--; ! } ! else ! { ! string commandText = this.commands[actualCommand]; ! if (commandText != null && commandText.Trim().Length > 0) ! { ! this.InternalPrepare(); ! this.InternalExecute(); ! ! returnValue = true; ! } ! } ! } ! ! return returnValue; ! } ! internal void InternalSetOutputParameters() { --- 508,512 ---- } } ! internal void InternalSetOutputParameters() { *************** *** 609,630 **** this.transaction = null; } if (this.connection == null || this.connection.State != ConnectionState.Open) { throw new InvalidOperationException("Connection must valid and open"); } ! if (this.connection.DataReader != null) { ! throw new InvalidOperationException("There is already an open DataReader associated with this Connection which must be closed first."); } ! if (this.connection.ActiveTransaction != null && ! !this.connection.ActiveTransaction.IsUpdated && this.Transaction == null) { throw new InvalidOperationException("Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized."); } if (this.transaction != null && !this.connection.Equals(Transaction.Connection)) { throw new InvalidOperationException("Command Connection is not equal to Transaction Connection"); } if (this.commandText == null || this.commandText.Length == 0) { --- 549,574 ---- this.transaction = null; } + if (this.connection == null || this.connection.State != ConnectionState.Open) { throw new InvalidOperationException("Connection must valid and open"); + } ! if (this.ActiveDataReader != null) { ! throw new InvalidOperationException("There is already an open DataReader associated with this Command which must be closed first."); } ! ! if (this.connection.InternalConnection.HasActiveTransaction && this.Transaction == null) { throw new InvalidOperationException("Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized."); } + if (this.transaction != null && !this.connection.Equals(Transaction.Connection)) { throw new InvalidOperationException("Command Connection is not equal to Transaction Connection"); } + if (this.commandText == null || this.commandText.Length == 0) { *************** *** 633,640 **** } ! private string BuildStoredProcedureSql() { - string commandText = this.commands[actualCommand]; - if (!commandText.Trim().ToLower().StartsWith("select ")) { --- 577,582 ---- } ! private string BuildStoredProcedureSql(string commandText) { if (!commandText.Trim().ToLower().StartsWith("select ")) { *************** *** 674,684 **** } ! private string ParseParameterNames() { ! string sql = this.commands[actualCommand]; ! this.namedParameters.Clear(); ! if (sql.IndexOf("@") != -1) { this.matchReplaces.Clear(); --- 616,626 ---- } ! private string ParseParameterNames(string commandText) { ! string sql = commandText; ! this.namedParameters.Clear(); ! if (commandText.IndexOf("@") != -1) { this.matchReplaces.Clear(); *************** *** 758,789 **** } - private void SplitBatchCommands(bool batchAllowed) - { - if (this.commands == null) - { - if (batchAllowed) - { - MatchCollection matches = Regex.Matches( - this.commandText, - "([^';]+('[^']*'))*[^';]*(?=;*)"); - - this.commands = new string[matches.Count/2]; - int count = 0; - for (int i = 0; i < matches.Count; i++) - { - if (matches[i].Value.Trim() != String.Empty) - { - this.commands[count] = matches[i].Value.Trim(); - count++; - } - } - } - else - { - this.commands = new string[]{this.commandText}; - } - } - } - #endregion } --- 700,703 ---- Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PgDataReader.cs 22 Jul 2004 10:57:53 -0000 1.23 --- PgDataReader.cs 29 Sep 2004 12:08:12 -0000 1.24 *************** *** 61,68 **** internal PgDataReader(PgCommand command, PgConnection connection) : this() { ! this.command = command; ! this.behavior = this.command.CommandBehavior; ! this.connection = connection; ! this.connection.DataReader = this; this.fieldCount = this.command.Statement.RowDescriptor.Fields.Length; } --- 61,67 ---- internal PgDataReader(PgCommand command, PgConnection connection) : this() { ! this.command = command; ! this.behavior = this.command.CommandBehavior; ! this.connection = connection; this.fieldCount = this.command.Statement.RowDescriptor.Fields.Length; } *************** *** 155,164 **** this.command.InternalSetOutputParameters(); } ! } if (this.connection != null) { - this.connection.DataReader = null; - if ((this.behavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection) { --- 154,163 ---- this.command.InternalSetOutputParameters(); } ! ! this.command.ActiveDataReader = null; ! } if (this.connection != null) { if ((this.behavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection) { *************** *** 173,196 **** public bool NextResult() { ! if (this.IsClosed) ! { ! throw new InvalidOperationException("The datareader must be opened."); ! } ! ! this.UpdateRecordsAffected(); ! ! bool returnValue = this.command.NextResult(); ! ! if (returnValue) ! { ! this.fieldCount = this.command.Statement.RowDescriptor.Fields.Length; ! this.position = STARTPOS; ! } ! else ! { ! this.row = null; ! } ! ! return returnValue; } --- 172,176 ---- public bool NextResult() { ! return false; } *************** *** 331,335 **** private PgCommand GetColumnInfoCmd() { ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(PgDbSchemaType.Columns); dbSchema.AddWhereFilter("pg_attribute.attnum = @OidNumber"); --- 311,315 ---- private PgCommand GetColumnInfoCmd() { ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema("Columns"); dbSchema.AddWhereFilter("pg_attribute.attnum = @OidNumber"); *************** *** 346,350 **** private PgCommand GetPrimaryKeyInfoCmd() { ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(PgDbSchemaType.Primary_Keys); dbSchema.AddWhereFilter("pg_class.oid = @OidTable"); --- 326,330 ---- private PgCommand GetPrimaryKeyInfoCmd() { ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema("PrimaryKeys"); dbSchema.AddWhereFilter("pg_class.oid = @OidTable"); Index: PgConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PgConnection.cs 22 Jul 2004 10:57:53 -0000 1.19 --- PgConnection.cs 29 Sep 2004 12:08:12 -0000 1.20 *************** *** 29,38 **** using PostgreSql.Data.NPgClient; - using PostgreSql.Data.PgSqlClient.DbSchema; namespace PostgreSql.Data.PgSqlClient { ! [ToolboxItem(true), ! ToolboxBitmap(typeof(PgConnection), "Resources.ToolBox.PgConnection.bmp"), DefaultEvent("InfoMessage")] public sealed class PgConnection : Component, IDbConnection, ICloneable --- 29,36 ---- using PostgreSql.Data.NPgClient; namespace PostgreSql.Data.PgSqlClient { ! [ToolboxItem(true), ToolboxBitmap(typeof(PgConnection), "Resources.ToolBox.PgConnection.bmp"), DefaultEvent("InfoMessage")] public sealed class PgConnection : Component, IDbConnection, ICloneable *************** *** 43,49 **** public event PgInfoMessageEventHandler InfoMessage; public event PgNotificationEventHandler Notification; public event CertificateValidationCallback ServerCertValidation; public event CertificateSelectionCallback ClientCertSelection; - public event PrivateKeySelectionCallback PrivateKeySelection; #endregion --- 41,51 ---- public event PgInfoMessageEventHandler InfoMessage; public event PgNotificationEventHandler Notification; + + #endregion + + #region SSL Events + public event CertificateValidationCallback ServerCertValidation; public event CertificateSelectionCallback ClientCertSelection; #endregion *************** *** 51,61 **** #region Fields ! private PgDbConnection dbConnection; ! private ConnectionState state; ! private bool disposed; ! private string connectionString; ! private PgDataReader dataReader; ! private PgTransaction activeTransaction; ! private ArrayList activeCommands; #endregion --- 53,60 ---- #region Fields ! private PgConnectionInternal connectionInternal; ! private ConnectionState state; ! private bool disposed; ! private string connectionString; #endregion *************** *** 63,70 **** #region Properties ! [Category("Data"), ! RecommendedAsConfigurableAttribute(true), ! RefreshProperties(RefreshProperties.All), ! DefaultValue("")] public string ConnectionString { --- 62,67 ---- #region Properties ! [Category("Data"), RecommendedAsConfigurableAttribute(true), ! RefreshProperties(RefreshProperties.All), DefaultValue("")] public string ConnectionString { *************** *** 74,80 **** if (state == ConnectionState.Closed) { ! PgDbConnection tmpConn = new PgDbConnection(value); this.connectionString = value; - tmpConn = null; } } --- 71,76 ---- if (state == ConnectionState.Closed) { ! PgConnectionInternal tmpConn = new PgConnectionInternal(value); this.connectionString = value; } } *************** *** 86,92 **** get { ! if (this.dbConnection != null) { ! return this.dbConnection.Settings.Timeout; } else --- 82,88 ---- get { ! if (this.connectionInternal != null) { ! return this.connectionInternal.Options.Timeout; } else *************** *** 102,108 **** get { ! if (this.dbConnection != null) { ! return this.dbConnection.Settings.Database; } else --- 98,104 ---- get { ! if (this.connectionInternal != null) { ! return this.connectionInternal.Options.Database; } else *************** *** 118,124 **** get { ! if (this.dbConnection != null) { ! return this.dbConnection.Settings.ServerName; } else --- 114,120 ---- get { ! if (this.connectionInternal != null) { ! return this.connectionInternal.Options.ServerName; } else *************** *** 135,141 **** { int packetSize = 8192; ! if (this.dbConnection != null) { ! packetSize = this.dbConnection.Settings.PacketSize; } --- 131,137 ---- { int packetSize = 8192; ! if (this.connectionInternal != null) { ! packetSize = this.connectionInternal.Options.PacketSize; } *************** *** 144,156 **** } ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string ServerVersion { get { ! if (this.dbConnection != null) { ! return (string)this.dbConnection.DB.ParameterStatus["server_version"]; } else --- 140,151 ---- } ! [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string ServerVersion { get { ! if (this.connectionInternal != null) { ! return (string)this.connectionInternal.Database.ParameterStatus["server_version"]; } else *************** *** 161,166 **** } ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ConnectionState State { --- 156,160 ---- } ! [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ConnectionState State { *************** *** 172,196 **** #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; } } --- 166,173 ---- #region Internal properties ! internal PgConnectionInternal InternalConnection { ! get { return this.connectionInternal; } ! set { this.connectionInternal = value; } } *************** *** 208,213 **** this.connectionString = String.Empty; - GC.SuppressFinalize(this); - if (connString != null) { --- 185,188 ---- *************** *** 231,235 **** this.Close(); ! this.dbConnection = null; this.connectionString = null; } --- 206,210 ---- this.Close(); ! this.connectionInternal = null; this.connectionString = null; } *************** *** 271,301 **** 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."); ! } ! ! try ! { ! this.activeTransaction = new PgTransaction(this); ! this.activeTransaction.InternalBeginTransaction(); ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } ! ! return this.activeTransaction; } --- 246,250 ---- public PgTransaction BeginTransaction() { ! return this.BeginTransaction(IsolationLevel.ReadCommitted); } *************** *** 307,332 **** } ! if (this.activeTransaction != null && ! !this.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."); ! } ! ! try ! { ! this.activeTransaction = new PgTransaction(this, level); ! this.activeTransaction.InternalBeginTransaction(); ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } ! ! return this.activeTransaction; } --- 256,260 ---- } ! return this.connectionInternal.BeginTransaction(level); } *************** *** 343,352 **** } ! if (this.DataReader != null) ! { ! throw new InvalidOperationException("ChangeDatabase requires an open and available Connection. The connection's current state is Open, Fetching."); ! } ! ! string oldDb = this.dbConnection.Settings.Database; try --- 271,275 ---- } ! string oldDb = this.connectionInternal.Options.Database; try *************** *** 356,360 **** /* Set up the new Database */ ! this.dbConnection.Settings.Database = db; /* Open new connection to new database */ --- 279,283 ---- /* Set up the new Database */ ! this.connectionInternal.Options.Database = db; /* Open new connection to new database */ *************** *** 363,367 **** catch (PgException ex) { ! this.dbConnection.Settings.Database = oldDb; throw ex; } --- 286,290 ---- catch (PgException ex) { ! this.connectionInternal.Options.Database = oldDb; throw ex; } *************** *** 379,398 **** this.state = ConnectionState.Connecting; ! this.dbConnection = new PgDbConnection(this.connectionString); ! ! // Add handler for Ssl connections ! dbConnection.DB.SslConnection = new SslConnectionCallback(this.OnSslConnection); // Open connection ! if (this.dbConnection.Settings.Pooling) { ! this.dbConnection = PgConnectionPool.GetConnection( ! this.connectionString, ! this.dbConnection); } else { ! this.dbConnection.Pooled = false; ! this.dbConnection.Connect(); } --- 302,319 ---- this.state = ConnectionState.Connecting; ! PgConnectionInternal tmp = new PgConnectionInternal(connectionString); // Open connection ! if (tmp.Options.Pooling) { ! this.connectionInternal = PgConnectionPool.GetConnection(this.connectionString, this); } else { ! this.connectionInternal = new PgConnectionInternal(this.connectionString); ! ! this.connectionInternal.OwningConnection = this; ! this.connectionInternal.Pooled = false; ! this.connectionInternal.Connect(); } *************** *** 404,415 **** } - // Initialize active commands list - this.activeCommands = new ArrayList(); - // Add Info message event handler ! this.dbConnection.DB.InfoMessage = new InfoMessageCallback(this.OnInfoMessage); // Add notification event handler ! this.dbConnection.DB.Notification = new NotificationCallback(this.OnNotification); } catch (PgClientException ex) --- 325,333 ---- } // Add Info message event handler ! this.connectionInternal.Database.InfoMessage = new InfoMessageCallback(this.OnInfoMessage); // Add notification event handler ! this.connectionInternal.Database.Notification = new NotificationCallback(this.OnNotification); } catch (PgClientException ex) *************** *** 425,467 **** { try ! { ! lock (this.dbConnection) { // Remove info message callback ! this.dbConnection.DB.InfoMessage = null; // Remove notification callback ! this.dbConnection.DB.Notification = null; ! // Close DataReader ! if (this.dataReader != null && !this.dataReader.IsClosed) ! { ! this.dataReader.Close(); ! } // Dispose Active commands ! this.DisposeActiveCommands(); // Rollback active transation ! if (this.activeTransaction != null) ! { ! this.activeTransaction.Dispose(); ! this.activeTransaction = null; ! } ! ! // Remove SSL handlers ! this.ServerCertValidation = null; ! this.ClientCertSelection = null; ! this.PrivateKeySelection = null; // Close connection permanently or send it // back to the pool ! if (this.dbConnection.Pooled) { ! PgConnectionPool.FreeConnection(this.dbConnection); } else { ! this.dbConnection.Disconnect(); } } --- 343,378 ---- { try ! { ! lock (this.connectionInternal) { + PgDbClient database = this.connectionInternal.Database; + // Remove info message callback ! this.connectionInternal.Database.InfoMessage = null; // Remove notification callback ! this.connectionInternal.Database.Notification = null; ! // Remove SSL handlers ! database.SslClientStream.ServerCertValidationDelegate = null; ! database.SslClientStream.ClientCertSelectionDelegate = null; ! this.ServerCertValidation = null; ! this.ClientCertSelection = null; // Dispose Active commands ! this.connectionInternal.DisposePreparedCommands(); // Rollback active transation ! this.connectionInternal.DisposeActiveTransaction(); // Close connection permanently or send it // back to the pool ! if (this.connectionInternal.Pooled) { ! PgConnectionPool.FreeConnection(this.connectionInternal); } else { ! this.connectionInternal.Disconnect(); } } *************** *** 498,600 **** } ! 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) ! { ! command.Dispose(); ! } ! ! commands = null; ! } ! ! activeCommands.Clear(); ! activeCommands = null; ! } } ! 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."); ! } ! ! PgDbSchema dbSchema = PgDbSchemaFactory.GetSchema(schema); ! ! if (dbSchema == null) ! { ! throw new NotSupportedException("Specified schema type is not supported."); ! } ! if (restrictions != null) ! { ! if (restrictions.Length > dbSchema.RestrictionColumns.Count) ! { ! throw new InvalidOperationException("The number of specified restrictions is not valid."); ! } ! } ! ! return dbSchema.GetDbSchemaTable(this, restrictions); } ! public void CreateDatabase(string database, string owner, string location, string template, string encoding) { ! if (DataReader != null) ! { ! throw new InvalidOperationException("CreateDatabase requires an open and available Connection. The connection's current state is Open, Fetching."); ! } ! ! if (database == null) { ! throw new InvalidOperationException("You need to specify the database name to create."); } ! try ! { ! lock (this) ! { ! if (owner == null) ! { ! owner = "DEFAULT"; ! } ! if (location == null) ! { ! location = "DEFAULT"; ! } ! if (template == null) ! { ! template = "template0"; ! } ! if (encoding == null) ! { ! encoding = "SQL_ASCII"; ! } ! ! // Build the command text ! StringBuilder commandText = new StringBuilder(); ! commandText.AppendFormat( ! "CREATE DATABASE {0} WITH OWNER={1} LOCATION={2} TEMPLATE={3} ENCODING='{4}'", ! database, ! owner, ! location, ! template, ! encoding); ! ! // Create database ! PgCommand command = new PgCommand(commandText.ToString(), this); ! command.ExecuteNonQuery(); ! command.Dispose(); ! } ! } ! catch (PgClientException ex) ! { ! throw new PgException(ex.Message, ex); ! } } --- 409,430 ---- } ! public DataTable GetSchema() { ! return this.GetSchema("MetaDataCollections"); } ! public DataTable GetSchema(string collectionName) { ! return this.GetSchema(collectionName, null); } ! public DataTable GetSchema(string collectionName, string[] restrictions) { ! if (this.state == ConnectionState.Closed) { ! throw new InvalidOperationException(""); } ! return this.connectionInternal.GetSchema(collectionName, restrictions); } *************** *** 619,637 **** } ! private void OnSslConnection() ! { ! PgDbClient db = this.dbConnection.DB; ! ! // Server certificate validation ! db.SslClientStream.ServerCertValidationDelegate = new CertificateValidationCallback(OnServerCertificateValidation); ! ! // Client certificate selection ! db.SslClientStream.ClientCertSelectionDelegate = new CertificateSelectionCallback(OnClientCertificateSelection); ! // Private key selection ! db.SslClientStream.PrivateKeyCertSelectionDelegate = new PrivateKeySelectionCallback(OnPrivateKeySelection); ! } ! private bool OnServerCertificateValidation( X509Certificate certificate, int[] certificateErrors) --- 449,457 ---- } ! #endregion ! #region SSL Event handlers ! internal bool OnServerCertificateValidation( X509Certificate certificate, int[] certificateErrors) *************** *** 645,649 **** } ! private X509Certificate OnClientCertificateSelection( X509CertificateCollection clientCertificates, X509Certificate serverCertificate, --- 465,469 ---- } ! internal X509Certificate OnClientCertificateSelection( X509CertificateCollection clientCertificates, X509Certificate serverCertificate, *************** *** 663,678 **** } - private AsymmetricAlgorithm OnPrivateKeySelection( - X509Certificate clientCertificate, - string targetHost) - { - if (this.PrivateKeySelection != null) - { - return this.PrivateKeySelection(clientCertificate, targetHost); - } - - return null; - } - #endregion } --- 483,486 ---- |
From: Carlos G. Á. <car...@us...> - 2004-09-29 12:07:50
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15158 Removed Files: PgDbConnection.cs PgDbSchemaType.cs Log Message: Mayor update of the PgSqlClient sources --- PgDbSchemaType.cs DELETED --- --- PgDbConnection.cs DELETED --- |
From: Carlos G. Á. <car...@us...> - 2004-09-24 21:33:46
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3962 Modified Files: ContentType.cs Context.cs RecordProtocol.cs Log Message: Updated ClientHelloV2 support Index: ContentType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ContentType.cs 23 Sep 2004 20:31:24 -0000 1.2 --- ContentType.cs 24 Sep 2004 21:33:34 -0000 1.3 *************** *** 30,34 **** internal enum ContentType : byte { - ClientHelloV2 = 1, ChangeCipherSpec = 20, Alert = 21, --- 30,33 ---- Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** RecordProtocol.cs 23 Sep 2004 21:10:44 -0000 1.19 --- RecordProtocol.cs 24 Sep 2004 21:33:34 -0000 1.20 *************** *** 89,96 **** } ! ContentType contentType = (ContentType)type; ! byte[] buffer = this.ReadRecordBuffer(contentType); ! TlsStream message = new TlsStream(buffer); // Decrypt message contents if needed --- 89,98 ---- } ! // Set last handshake message received to None ! this.context.LastHandshakeMsg = HandshakeType.None; ! ContentType contentType = (ContentType)type; ! byte[] buffer = this.ReadRecordBuffer(type); ! byte[] result = null; // Decrypt message contents if needed *************** *** 102,127 **** if (this.context.IsActual && contentType != ContentType.ChangeCipherSpec) { ! message = this.decryptRecordFragment(contentType, message.ToArray()); ! DebugHelper.WriteLine("Decrypted record data", message.ToArray()); } } - - // Set last handshake message received to None - this.context.LastHandshakeMsg = HandshakeType.None; - // Process record - byte[] result = message.ToArray(); - switch (contentType) { - case ContentType.ClientHelloV2: - // Set the last handshake message received as the standard ClientHello - this.context.LastHandshakeMsg = HandshakeType.ClientHello; - result = null; - break; - case ContentType.Alert: ! this.ProcessAlert((AlertLevel)message.ReadByte(), (AlertDescription)message.ReadByte()); result = null; break; --- 104,121 ---- if (this.context.IsActual && contentType != ContentType.ChangeCipherSpec) { ! result = this.decryptRecordFragment(contentType, buffer); ! DebugHelper.WriteLine("Decrypted record data", result); ! } ! else ! { ! result = buffer; } } switch (contentType) { case ContentType.Alert: ! this.ProcessAlert((AlertLevel)result[0], (AlertDescription)result[1]); result = null; break; *************** *** 135,138 **** --- 129,133 ---- case ContentType.Handshake: + TlsStream message = new TlsStream(result); while (!message.EOF) { *************** *** 141,151 **** // Update handshakes of current messages ! this.context.HandshakeMessages.Write(message.ToArray()); break; default: ! throw new TlsException( ! AlertDescription.UnexpectedMessage, ! "Unknown record received from server."); } --- 136,144 ---- // Update handshakes of current messages ! this.context.HandshakeMessages.Write(result); break; default: ! return null; } *************** *** 153,165 **** } ! private byte[] ReadRecordBuffer(ContentType contentType) { switch (contentType) { ! case ContentType.ClientHelloV2: return this.ReadClientHelloV2(); default: ! if (!Enum.IsDefined(typeof(ContentType), contentType)) { throw new TlsException(AlertDescription.DecodeError); --- 146,158 ---- } ! private byte[] ReadRecordBuffer(int contentType) { switch (contentType) { ! case 0x80: return this.ReadClientHelloV2(); default: ! if (!Enum.IsDefined(typeof(ContentType), (ContentType)contentType)) { throw new TlsException(AlertDescription.DecodeError); *************** *** 169,200 **** } private byte[] ReadClientHelloV2() { ! short protocol = this.ReadShort(); ! short cipherSpecLength = this.ReadShort(); ! short sessionIdLength = this.ReadShort(); ! short challengeLength = this.ReadShort(); short length = (challengeLength > 32) ? (short)32 : challengeLength; // Read CipherSpecs ! byte[] cipherSpecV2 = new byte[cipherSpecLength]; ! this.innerStream.Read(cipherSpecV2, 0, cipherSpecV2.Length); // Read session ID ! byte[] sessionId = new byte[sessionIdLength]; ! this.innerStream.Read(sessionId, 0, sessionId.Length); // Read challenge ID ! byte[] challenge = new byte[challengeLength]; ! this.innerStream.Read(challenge, 0, challenge.Length); ! // Check that the message has a valid protocol version ! SecurityProtocolType protocolType = this.context.DecodeProtocolCode(protocol); ! if (protocolType != SecurityProtocolType.Ssl3 && protocolType != SecurityProtocolType.Tls) ! { ! throw new TlsException( ! AlertDescription.ProtocolVersion, "Invalid protocol version on message received"); ! } ! if (challengeLength < 16 || cipherSpecLength == 0 || (cipherSpecLength % 3) != 0) { --- 162,230 ---- } + private short ReadShort() + { + byte[] b = new byte[2]; + this.innerStream.Read(b, 0, b.Length); + + short val = BitConverter.ToInt16(b, 0); + + return System.Net.IPAddress.HostToNetworkOrder(val); + } + + private void ProcessAlert(AlertLevel alertLevel, AlertDescription alertDesc) + { + switch (alertLevel) + { + case AlertLevel.Fatal: + throw new TlsException(alertLevel, alertDesc); + + case AlertLevel.Warning: + default: + switch (alertDesc) + { + case AlertDescription.CloseNotify: + this.context.ConnectionEnd = true; + break; + } + break; + } + } + + #endregion + + #region Record Buffer read + private byte[] ReadClientHelloV2() { ! int msgLength = this.innerStream.ReadByte(); ! ! // Read the message contents ! byte[] tmp = new byte[msgLength]; ! this.innerStream.Read(tmp, 0, tmp.Length); ! ! // Add them to a TlsStream ! TlsStream stream = new TlsStream(tmp); ! ! int msgType = stream.ReadByte(); ! if (msgType != 1) ! { ! throw new TlsException(AlertDescription.DecodeError); ! } ! short protocol = stream.ReadInt16(); ! short cipherSpecLength = stream.ReadInt16(); ! short sessionIdLength = stream.ReadInt16(); ! short challengeLength = stream.ReadInt16(); short length = (challengeLength > 32) ? (short)32 : challengeLength; // Read CipherSpecs ! byte[] cipherSpecV2 = stream.ReadBytes(cipherSpecLength); // Read session ID ! byte[] sessionId = stream.ReadBytes(sessionIdLength); // Read challenge ID ! byte[] challenge = stream.ReadBytes(challengeLength); ! // Check the Challenge Length if (challengeLength < 16 || cipherSpecLength == 0 || (cipherSpecLength % 3) != 0) { *************** *** 208,216 **** } ! // Select the cipher suite collection ! this.Context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(protocolType); // Select the Cipher suite ! this.ProcessCipherSpecV2Buffer(protocolType, cipherSpecV2); // Updated the Client Random --- 238,246 ---- } ! // Update the protocol version ! this.Context.ChangeProtocol(protocol); // Select the Cipher suite ! this.ProcessCipherSpecV2Buffer(this.Context.SecurityProtocol, cipherSpecV2); // Updated the Client Random *************** *** 218,221 **** --- 248,257 ---- Buffer.BlockCopy(challenge, 0, this.context.ClientRandom, 0, length); + // Update the Handshake Hashes + this.Context.HandshakeMessages.Write(tmp); + + // Updated the LastHandshake message + this.context.LastHandshakeMsg = HandshakeType.ClientHello; + return new byte[0]; } *************** *** 246,278 **** } - private short ReadShort() - { - byte[] b = new byte[2]; - this.innerStream.Read(b, 0, b.Length); - - short val = BitConverter.ToInt16(b, 0); - - return System.Net.IPAddress.HostToNetworkOrder(val); - } - - private void ProcessAlert(AlertLevel alertLevel, AlertDescription alertDesc) - { - switch (alertLevel) - { - case AlertLevel.Fatal: - throw new TlsException(alertLevel, alertDesc); - - case AlertLevel.Warning: - default: - switch (alertDesc) - { - case AlertDescription.CloseNotify: - this.context.ConnectionEnd = true; - break; - } - break; - } - } - #endregion --- 282,285 ---- *************** *** 413,419 **** #region Cryptography Methods ! private byte[] encryptRecordFragment( ! ContentType contentType, ! byte[] fragment) { byte[] mac = null; --- 420,424 ---- #region Cryptography Methods ! private byte[] encryptRecordFragment(ContentType contentType, byte[] fragment) { byte[] mac = null; *************** *** 449,455 **** } ! private TlsStream decryptRecordFragment( ! ContentType contentType, ! byte[] fragment) { byte[] dcrFragment = null; --- 454,458 ---- } ! private byte[] decryptRecordFragment(ContentType contentType, byte[] fragment) { byte[] dcrFragment = null; *************** *** 510,514 **** this.context.ReadSequenceNumber++; ! return new TlsStream(dcrFragment); } --- 513,517 ---- this.context.ReadSequenceNumber++; ! return dcrFragment; } Index: Context.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/Context.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Context.cs 26 Apr 2004 09:18:45 -0000 1.10 --- Context.cs 24 Sep 2004 21:33:34 -0000 1.11 *************** *** 407,410 **** --- 407,428 ---- } + public void ChangeProtocol(short protocol) + { + SecurityProtocolType protocolType = this.DecodeProtocolCode(protocol); + + if ((protocolType & this.SecurityProtocolFlags) == protocolType || + (this.SecurityProtocolFlags & SecurityProtocolType.Default) == SecurityProtocolType.Default) + { + this.SecurityProtocol = protocolType; + this.SupportedCiphers.Clear(); + this.SupportedCiphers = null; + this.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(protocolType); + } + else + { + throw new TlsException(AlertDescription.ProtocolVersion, "Incorrect protocol version received from server"); + } + } + #endregion } |
From: Carlos G. Á. <car...@us...> - 2004-09-23 21:10:55
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15301 Modified Files: RecordProtocol.cs Log Message: Removed test code Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** RecordProtocol.cs 23 Sep 2004 20:31:24 -0000 1.18 --- RecordProtocol.cs 23 Sep 2004 21:10:44 -0000 1.19 *************** *** 82,91 **** } - if (this.context.LastHandshakeMsg == 0) - { - this.innerStream.ReadByte(); - this.innerStream.ReadByte(); - } - // Try to read the Record Content Type int type = this.innerStream.ReadByte(); --- 82,85 ---- |
From: Carlos G. Á. <car...@us...> - 2004-09-23 20:31:36
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6057 Modified Files: ContentType.cs RecordProtocol.cs Log Message: Added suport for the ClientHelloV2 message Index: ContentType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContentType.cs 3 Mar 2004 16:22:36 -0000 1.1 --- ContentType.cs 23 Sep 2004 20:31:24 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- internal enum ContentType : byte { + ClientHelloV2 = 1, ChangeCipherSpec = 20, Alert = 21, Index: RecordProtocol.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RecordProtocol.cs 26 Apr 2004 09:18:45 -0000 1.17 --- RecordProtocol.cs 23 Sep 2004 20:31:24 -0000 1.18 *************** *** 24,27 **** --- 24,28 ---- using System; + using System.Collections; using System.IO; using System.Security.Cryptography; *************** *** 80,88 **** "The session is finished and it's no longer valid."); } ! // Try to read the Record Content Type int type = this.innerStream.ReadByte(); - - // There are no more data for read if (type == -1) { --- 81,93 ---- "The session is finished and it's no longer valid."); } ! ! if (this.context.LastHandshakeMsg == 0) ! { ! this.innerStream.ReadByte(); ! this.innerStream.ReadByte(); ! } ! // Try to read the Record Content Type int type = this.innerStream.ReadByte(); if (type == -1) { *************** *** 91,135 **** ContentType contentType = (ContentType)type; ! short protocol = this.readShort(); ! short length = this.readShort(); ! ! // Read Record data ! int received = 0; ! byte[] buffer = new byte[length]; ! while (received != length) ! { ! received += this.innerStream.Read( ! buffer, received, buffer.Length - received); ! } ! ! DebugHelper.WriteLine( ! ">>>> Read record ({0}|{1})", ! this.context.DecodeProtocolCode(protocol), ! contentType); ! DebugHelper.WriteLine("Record data", buffer); TlsStream message = new TlsStream(buffer); - // Check that the message has a valid protocol version - if (protocol != this.context.Protocol && - this.context.ProtocolNegotiated) - { - throw new TlsException( - AlertDescription.ProtocolVersion, - "Invalid protocol version on message received from server"); - } - // Decrypt message contents if needed ! if (contentType == ContentType.Alert && length == 2) { } else { ! if (this.context.IsActual && ! contentType != ContentType.ChangeCipherSpec) { ! message = this.decryptRecordFragment( ! contentType, ! message.ToArray()); DebugHelper.WriteLine("Decrypted record data", message.ToArray()); --- 96,112 ---- ContentType contentType = (ContentType)type; ! byte[] buffer = this.ReadRecordBuffer(contentType); TlsStream message = new TlsStream(buffer); // Decrypt message contents if needed ! if (contentType == ContentType.Alert && buffer.Length == 2) { } else { ! if (this.context.IsActual && contentType != ContentType.ChangeCipherSpec) { ! message = this.decryptRecordFragment(contentType, message.ToArray()); DebugHelper.WriteLine("Decrypted record data", message.ToArray()); *************** *** 145,152 **** switch (contentType) { case ContentType.Alert: ! this.processAlert( ! (AlertLevel)message.ReadByte(), ! (AlertDescription)message.ReadByte()); break; --- 122,134 ---- switch (contentType) { + case ContentType.ClientHelloV2: + // Set the last handshake message received as the standard ClientHello + this.context.LastHandshakeMsg = HandshakeType.ClientHello; + result = null; + break; + case ContentType.Alert: ! this.ProcessAlert((AlertLevel)message.ReadByte(), (AlertDescription)message.ReadByte()); ! result = null; break; *************** *** 177,181 **** } ! private short readShort() { byte[] b = new byte[2]; --- 159,256 ---- } ! private byte[] ReadRecordBuffer(ContentType contentType) ! { ! switch (contentType) ! { ! case ContentType.ClientHelloV2: ! return this.ReadClientHelloV2(); ! ! default: ! if (!Enum.IsDefined(typeof(ContentType), contentType)) ! { ! throw new TlsException(AlertDescription.DecodeError); ! } ! return this.ReadStandardRecordBuffer(); ! } ! } ! ! private byte[] ReadClientHelloV2() ! { ! short protocol = this.ReadShort(); ! short cipherSpecLength = this.ReadShort(); ! short sessionIdLength = this.ReadShort(); ! short challengeLength = this.ReadShort(); ! short length = (challengeLength > 32) ? (short)32 : challengeLength; ! ! // Read CipherSpecs ! byte[] cipherSpecV2 = new byte[cipherSpecLength]; ! this.innerStream.Read(cipherSpecV2, 0, cipherSpecV2.Length); ! ! // Read session ID ! byte[] sessionId = new byte[sessionIdLength]; ! this.innerStream.Read(sessionId, 0, sessionId.Length); ! ! // Read challenge ID ! byte[] challenge = new byte[challengeLength]; ! this.innerStream.Read(challenge, 0, challenge.Length); ! ! // Check that the message has a valid protocol version ! SecurityProtocolType protocolType = this.context.DecodeProtocolCode(protocol); ! if (protocolType != SecurityProtocolType.Ssl3 && protocolType != SecurityProtocolType.Tls) ! { ! throw new TlsException( ! AlertDescription.ProtocolVersion, "Invalid protocol version on message received"); ! } ! ! if (challengeLength < 16 || cipherSpecLength == 0 || (cipherSpecLength % 3) != 0) ! { ! throw new TlsException(AlertDescription.DecodeError); ! } ! ! // Updated the Session ID ! if (sessionId.Length > 0) ! { ! this.context.SessionId = sessionId; ! } ! ! // Select the cipher suite collection ! this.Context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(protocolType); ! ! // Select the Cipher suite ! this.ProcessCipherSpecV2Buffer(protocolType, cipherSpecV2); ! ! // Updated the Client Random ! this.context.ClientRandom = new byte[32]; ! Buffer.BlockCopy(challenge, 0, this.context.ClientRandom, 0, length); ! ! return new byte[0]; ! } ! ! private byte[] ReadStandardRecordBuffer() ! { ! short protocol = this.ReadShort(); ! short length = this.ReadShort(); ! ! // Read Record data ! int received = 0; ! byte[] buffer = new byte[length]; ! while (received != length) ! { ! received += this.innerStream.Read(buffer, received, buffer.Length - received); ! } ! ! // Check that the message has a valid protocol version ! if (protocol != this.context.Protocol && this.context.ProtocolNegotiated) ! { ! throw new TlsException( ! AlertDescription.ProtocolVersion, "Invalid protocol version on message received"); ! } ! ! DebugHelper.WriteLine("Record data", buffer); ! ! return buffer; ! } ! ! private short ReadShort() { byte[] b = new byte[2]; *************** *** 187,193 **** } ! private void processAlert( ! AlertLevel alertLevel, ! AlertDescription alertDesc) { switch (alertLevel) --- 262,266 ---- } ! private void ProcessAlert(AlertLevel alertLevel, AlertDescription alertDesc) { switch (alertLevel) *************** *** 447,450 **** --- 520,614 ---- #endregion + + #region CipherSpecV2 processing + + private void ProcessCipherSpecV2Buffer(SecurityProtocolType protocol, byte[] buffer) + { + TlsStream codes = new TlsStream(buffer); + + string prefix = (protocol == SecurityProtocolType.Ssl3) ? "SSL_" : "TLS_"; + + while (codes.Position < codes.Length) + { + byte check = codes.ReadByte(); + + if (check == 0) + { + // SSL/TLS cipher spec + int index = 0; + short code = codes.ReadInt16(); + if ((index = this.Context.SupportedCiphers.IndexOf(code)) != -1) + { + this.Context.Cipher = this.Context.SupportedCiphers[index]; + break; + } + } + else + { + byte[] tmp = new byte[2]; + codes.Read(tmp, 0, tmp.Length); + + int tmpCode = ((check & 0xff) << 16) | ((tmp[0] & 0xff) << 8) | (tmp[1] & 0xff); + CipherSuite cipher = this.MapV2CipherCode(prefix, tmpCode); + + if (cipher != null) + { + this.Context.Cipher = cipher; + break; + } + } + } + + if (this.Context.Cipher == null) + { + throw new TlsException(AlertDescription.InsuficientSecurity, "Insuficient Security"); + } + } + + private CipherSuite MapV2CipherCode(string prefix, int code) + { + try + { + switch (code) + { + case 65664: + // TLS_RC4_128_WITH_MD5 + return this.Context.SupportedCiphers[prefix + "RSA_WITH_RC4_128_MD5"]; + + case 131200: + // TLS_RC4_128_EXPORT40_WITH_MD5 + return this.Context.SupportedCiphers[prefix + "RSA_EXPORT_WITH_RC4_40_MD5"]; + + case 196736: + // TLS_RC2_CBC_128_CBC_WITH_MD5 + return this.Context.SupportedCiphers[prefix + "RSA_EXPORT_WITH_RC2_CBC_40_MD5"]; + + case 262272: + // TLS_RC2_CBC_128_CBC_EXPORT40_WITH_MD5 + return this.Context.SupportedCiphers[prefix + "RSA_EXPORT_WITH_RC2_CBC_40_MD5"]; + + case 327808: + // TLS_IDEA_128_CBC_WITH_MD5 + return null; + + case 393280: + // TLS_DES_64_CBC_WITH_MD5 + return null; + + case 458944: + // TLS_DES_192_EDE3_CBC_WITH_MD5 + return null; + + default: + return null; + } + } + catch + { + return null; + } + } + + #endregion } } |
From: Soner D. <de...@gs...> - 2004-09-18 20:51:23
|
When working with boolean data PgSql returns this exception: insufficient data left in message |
From: Soner D. <de...@gs...> - 2004-09-08 12:04:26
|
Ok, I found the exact problem. The constraint violation occurs because of the varchar lenght restriction. maxLength value of the restriction generated by FillSchema must be equal to the length of column in the database. But it is always 0 ! Therefore any attempt to fill the DataSet throws an exception.. Is this a bug ? |
From: Soner D. <de...@gs...> - 2004-09-08 10:29:53
|
Before starting, thanks to everyone working on this project. Great job! Here is the matter.. I want to use Strongly Typed Datasets in the Data Access Layer of a project. As I don't want to write the whole of the layer by hand, I've decided to develop a Data Access Layer Generator for PostgreSQL. I've already finished the part that creates CRUD functions on the Database layer. And now, I'm writing the part that creates the Data Access Layer code in C#. The generator use `xsd.exe` to generate the class code for schemas genereted by FillSchema method of PgDataAdapter. Everything seems working.. The DAL can than see and use the Strongly Typed DataSet by xsd.exe. Except one problem.. When a method trys to fill the DataSet, it occurs a constraint violation exception even there is nothing violating a constraint. Then I inspected the schema file and I saw a strange restriction in a field:: <xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true" type="xs:int" /> <xs:element name="Name" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="0" /> </xs:restriction> </xs:simpleType> </xs:element> I could not understand why the Name element contains a simpleType node containing a restriction. Because there is no restriction about this column on the database. ( Well, it is a varchar(200) column ) Could this restriction be the reason of the constraint violation exception ? Why and how is it generated ? Thanks in advance. Soner |
From: Carlos G. Á. <car...@us...> - 2004-08-28 20:50:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10502 Modified Files: PgCommand.cs Log Message: Added nbetter checks in the InternalSetOutputParameters method Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** PgCommand.cs 22 Jul 2004 10:57:53 -0000 1.40 --- PgCommand.cs 28 Aug 2004 20:50:10 -0000 1.41 *************** *** 577,595 **** int i = 0; ! object[] values = (object[])this.statement.Rows[0]; ! ! while (paramEnumerator.MoveNext()) ! { ! PgParameter parameter = ((PgParameter)paramEnumerator.Current); ! if (parameter.Direction == ParameterDirection.Output || ! parameter.Direction == ParameterDirection.InputOutput || ! parameter.Direction == ParameterDirection.ReturnValue) ! { ! parameter.Value = values[i]; ! i++; ! } ! } ! } } --- 577,600 ---- int i = 0; ! if (this.statement.Rows != null && this.statement.Rows.Length > 0) ! { ! object[] values = (object[])this.statement.Rows[0]; ! if (values != null && values.Length > 0) ! { ! while (paramEnumerator.MoveNext()) ! { ! PgParameter parameter = ((PgParameter)paramEnumerator.Current); ! if (parameter.Direction == ParameterDirection.Output || ! parameter.Direction == ParameterDirection.InputOutput || ! parameter.Direction == ParameterDirection.ReturnValue) ! { ! parameter.Value = values[i]; ! i++; ! } ! } ! } ! } ! } } |
From: Carlos G. Á. <car...@us...> - 2004-08-28 20:48:14
|
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-serv10214 Modified Files: TlsClientKeyExchange.cs Log Message: Updated file Index: TlsClientKeyExchange.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/Mono.Security/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TlsClientKeyExchange.cs 9 Mar 2004 22:04:55 -0000 1.7 --- TlsClientKeyExchange.cs 28 Aug 2004 20:48:05 -0000 1.8 *************** *** 47,64 **** protected override void ProcessAsSsl3() { ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! RSA rsa = (RSA)context.SslStream.PrivateKeyCertSelectionDelegate( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes((int)this.Length); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(rsa); ! byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); // Create master secret --- 47,70 ---- protected override void ProcessAsSsl3() { ! AsymmetricAlgorithm privKey = null; ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! privKey = context.SslStream.RaisePrivateKeySelection( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! if (privKey == null) ! { ! throw new TlsException(AlertDescription.UserCancelled, "Server certificate Private Key unavailable."); ! } ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes((int)this.Length); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(privKey); ! byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); // Create master secret *************** *** 72,92 **** // Clear resources ! rsa.Clear(); ! } protected override void ProcessAsTls1() { ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! RSA rsa = (RSA)context.SslStream.PrivateKeyCertSelectionDelegate( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes(this.ReadInt16()); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(rsa); byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); --- 78,105 ---- // Clear resources ! privKey.Clear(); ! } protected override void ProcessAsTls1() { ! AsymmetricAlgorithm privKey = null; ! ServerContext context = (ServerContext)this.Context; // Select the private key information ! // Select the private key information ! privKey = context.SslStream.RaisePrivateKeySelection( ! new X509Certificate(context.ServerSettings.Certificates[0].RawData), ! null); ! ! if (privKey == null) ! { ! throw new TlsException(AlertDescription.UserCancelled, "Server certificate Private Key unavailable."); ! } ! ! // Read client premaster secret byte[] clientSecret = this.ReadBytes(this.ReadInt16()); // Decrypt premaster secret ! RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(privKey); byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); *************** *** 102,106 **** // Clear resources ! rsa.Clear(); } --- 115,119 ---- // Clear resources ! privKey.Clear(); } |
From: Carlos G. Á. <car...@us...> - 2004-07-22 11:00:16
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20594 Modified Files: changelog.txt Log Message: 2004-07-22 Carlos Guzman Alvarez <car...@te...> * USe PascalCase naming for private methods in all classes. Index: changelog.txt =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/changelog.txt,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** changelog.txt 21 Jul 2004 11:03:30 -0000 1.122 --- changelog.txt 22 Jul 2004 11:00:07 -0000 1.123 *************** *** 2,5 **** --- 2,12 ---- ------------------------------------------------------- + + + 2004-07-22 Carlos Guzman Alvarez <car...@te...> + + * USe PascalCase naming for private methods in all classes. + + 2004-06-12 Carlos Guzman Alvarez <car...@te...> |
From: Carlos G. Á. <car...@us...> - 2004-07-22 10:59:38
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20452 Modified Files: PgTimeSpan.cs Log Message: 2004-07-22 Carlos Guzman Alvarez <car...@te...> * USe PascalCase naming for private methods in all classes. Index: PgTimeSpan.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgTypes/PgTimeSpan.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgTimeSpan.cs 9 Feb 2004 14:21:04 -0000 1.6 --- PgTimeSpan.cs 22 Jul 2004 10:59:30 -0000 1.7 *************** *** 81,85 **** #endregion ! #region ICOMPARABLE public int CompareTo(object obj) --- 81,85 ---- #endregion ! #region IComparable methods public int CompareTo(object obj) |
From: Carlos G. Á. <car...@us...> - 2004-07-22 10:59:08
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20328 Modified Files: PgCharSetCollection.cs PgClientErrorCollection.cs PgDbClient.cs PgOutputPacket.cs PgResponsePacket.cs PgStatement.cs PgType.cs PgTypeCollection.cs Log Message: 2004-07-22 Carlos Guzman Alvarez <car...@te...> * USe PascalCase naming for private methods in all classes. Index: PgResponsePacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgResponsePacket.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** PgResponsePacket.cs 20 Jul 2004 18:41:43 -0000 1.27 --- PgResponsePacket.cs 22 Jul 2004 10:58:58 -0000 1.28 *************** *** 242,246 **** if (type.FormatCode == 0) { ! return this.readStringArray(type, length); } else --- 242,246 ---- if (type.FormatCode == 0) { ! return this.ReadStringArray(type, length); } else *************** *** 276,285 **** if (type.SystemType.IsPrimitive) { ! return this.readPrimitiveArray(elementType, length, dimensions, flags, lengths, lowerBounds); } else { ! return this.readNonPrimitiveArray(elementType, length, dimensions, flags, lengths, lowerBounds); } --- 276,285 ---- if (type.SystemType.IsPrimitive) { ! return this.ReadPrimitiveArray(elementType, length, dimensions, flags, lengths, lowerBounds); } else { ! return this.ReadNonPrimitiveArray(elementType, length, dimensions, flags, lengths, lowerBounds); } *************** *** 564,568 **** #region Array Handling Methods ! private Array readPrimitiveArray(PgType elementType, int length, int dimensions, int flags, int[] lengths, int[] lowerBounds) { --- 564,568 ---- #region Array Handling Methods ! private Array ReadPrimitiveArray(PgType elementType, int length, int dimensions, int flags, int[] lengths, int[] lowerBounds) { *************** *** 570,574 **** // Read array data ! byte[] sourceArray = this.decodeArrayData(elementType, data.Length, length); Buffer.BlockCopy(sourceArray, 0, data, 0, sourceArray.Length); --- 570,574 ---- // Read array data ! byte[] sourceArray = this.DecodeArrayData(elementType, data.Length, length); Buffer.BlockCopy(sourceArray, 0, data, 0, sourceArray.Length); *************** *** 577,581 **** } ! private Array readNonPrimitiveArray(PgType elementType, int length, int dimensions, int flags, int[] lengths, int[] lowerBounds) { --- 577,581 ---- } ! private Array ReadNonPrimitiveArray(PgType elementType, int length, int dimensions, int flags, int[] lengths, int[] lowerBounds) { *************** *** 591,595 **** } ! private Array readStringArray(PgType type, int length) { PgType elementType = PgDbClient.Types[type.ElementType]; --- 591,595 ---- } ! private Array ReadStringArray(PgType type, int length) { PgType elementType = PgDbClient.Types[type.ElementType]; *************** *** 611,615 **** } ! private byte[] decodeArrayData(PgType type, int elementCount, int length) { byte[] data = new byte[length]; --- 611,615 ---- } ! private byte[] DecodeArrayData(PgType type, int elementCount, int length) { byte[] data = new byte[length]; Index: PgTypeCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgTypeCollection.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PgTypeCollection.cs 20 Jul 2004 18:41:43 -0000 1.11 --- PgTypeCollection.cs 22 Jul 2004 10:58:58 -0000 1.12 *************** *** 77,81 **** foreach(PgType item in this) { ! if (this.cultureAwareCompare(item.Name, name)) { return index; --- 77,81 ---- foreach(PgType item in this) { ! if (this.CultureAwareCompare(item.Name, name)) { return index; *************** *** 107,112 **** return type; } ! ! private bool cultureAwareCompare(string strA, string strB) { return CultureInfo.CurrentCulture.CompareInfo.Compare( --- 107,116 ---- return type; } ! ! #endregion ! ! #region Private methods ! ! private bool CultureAwareCompare(string strA, string strB) { return CultureInfo.CurrentCulture.CompareInfo.Compare( Index: PgType.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgType.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PgType.cs 20 Jul 2004 18:41:43 -0000 1.13 --- PgType.cs 22 Jul 2004 10:58:58 -0000 1.14 *************** *** 101,105 **** this.formatCode = formatCode; this.size = size; ! this.systemType = this.inferSystemType(); } --- 101,105 ---- this.formatCode = formatCode; this.size = size; ! this.systemType = this.InferSystemType(); } *************** *** 143,147 **** #region Private Methods ! private Type inferSystemType() { switch (this.dataType) --- 143,147 ---- #region Private Methods ! private Type InferSystemType() { switch (this.dataType) Index: PgCharSetCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgCharSetCollection.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgCharSetCollection.cs 10 Apr 2004 20:16:07 -0000 1.6 --- PgCharSetCollection.cs 22 Jul 2004 10:58:58 -0000 1.7 *************** *** 55,59 **** foreach (PgCharSet item in this) { ! if (this.cultureAwareCompare(item.CharSet, charset)) { return index; --- 55,59 ---- foreach (PgCharSet item in this) { ! if (this.CultureAwareCompare(item.CharSet, charset)) { return index; *************** *** 93,99 **** return charSet; ! } ! private bool cultureAwareCompare(string strA, string strB) { return CultureInfo.CurrentCulture.CompareInfo.Compare( --- 93,103 ---- return charSet; ! } ! #endregion ! ! #region Private Methods ! ! private bool CultureAwareCompare(string strA, string strB) { return CultureInfo.CurrentCulture.CompareInfo.Compare( Index: PgDbClient.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** PgDbClient.cs 21 Jul 2004 08:03:30 -0000 1.51 --- PgDbClient.cs 22 Jul 2004 10:58:58 -0000 1.52 *************** *** 292,296 **** PgDbClient.InitializeCharSets(); ! this.initializeSocket(); lock (this) --- 292,296 ---- PgDbClient.InitializeCharSets(); ! this.InitializeSocket(); lock (this) *************** *** 351,360 **** catch (IOException ex) { ! this.detach(); throw new PgClientException(ex.Message); } catch (PgClientException ex) { ! this.detach(); throw ex; } --- 351,360 ---- catch (IOException ex) { ! this.Detach(); throw new PgClientException(ex.Message); } catch (PgClientException ex) { ! this.Detach(); throw ex; } *************** *** 369,373 **** this.SendPacket(packet, PgFrontEndCodes.TERMINATE); ! this.detach(); } catch (IOException ex) --- 369,373 ---- this.SendPacket(packet, PgFrontEndCodes.TERMINATE); ! this.Detach(); } catch (IOException ex) *************** *** 855,859 **** #region Private Methods ! private void initializeSocket() { IPAddress hostadd = Dns.Resolve(settings.ServerName).AddressList[0]; --- 855,859 ---- #region Private Methods ! private void InitializeSocket() { IPAddress hostadd = Dns.Resolve(settings.ServerName).AddressList[0]; *************** *** 891,895 **** } ! private void detach() { // Close streams --- 891,895 ---- } ! private void Detach() { // Close streams Index: PgStatement.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgStatement.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** PgStatement.cs 20 Jul 2004 18:41:43 -0000 1.25 --- PgStatement.cs 22 Jul 2004 10:58:58 -0000 1.26 *************** *** 253,257 **** { response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } --- 253,257 ---- { response = this.db.ReceiveResponsePacket(); ! this.ProcessSqlPacket(response); } *************** *** 343,347 **** { response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } --- 343,347 ---- { response = this.db.ReceiveResponsePacket(); ! this.ProcessSqlPacket(response); } *************** *** 414,418 **** { response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } --- 414,418 ---- { response = this.db.ReceiveResponsePacket(); ! this.ProcessSqlPacket(response); } *************** *** 456,460 **** { response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); if (this.hasRows && --- 456,460 ---- { response = this.db.ReceiveResponsePacket(); ! this.ProcessSqlPacket(response); if (this.hasRows && *************** *** 562,566 **** { response = this.db.ReceiveResponsePacket(); ! this.processSqlPacket(response); } --- 562,566 ---- { response = this.db.ReceiveResponsePacket(); ! this.ProcessSqlPacket(response); } *************** *** 627,631 **** #region Response Methods ! private void processSqlPacket(PgResponsePacket packet) { switch (packet.Message) --- 627,631 ---- #region Response Methods ! private void ProcessSqlPacket(PgResponsePacket packet) { switch (packet.Message) *************** *** 636,649 **** 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; --- 636,649 ---- 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; *************** *** 656,664 **** case PgBackendCodes.COMMAND_COMPLETE: ! this.processTag(packet); break; case PgBackendCodes.PARAMETER_DESCRIPTION: ! this.processParameterDescription(packet); break; --- 656,664 ---- case PgBackendCodes.COMMAND_COMPLETE: ! this.ProcessTag(packet); break; case PgBackendCodes.PARAMETER_DESCRIPTION: ! this.ProcessParameterDescription(packet); break; *************** *** 670,674 **** } ! private void processTag(PgResponsePacket packet) { string[] elements = null; --- 670,674 ---- } ! private void ProcessTag(PgResponsePacket packet) { string[] elements = null; *************** *** 697,701 **** } ! private void processFunctionResult(PgResponsePacket packet) { int length = packet.ReadInt(); --- 697,701 ---- } ! private void ProcessFunctionResult(PgResponsePacket packet) { int length = packet.ReadInt(); *************** *** 704,708 **** } ! private void processRowDescription(PgResponsePacket packet) { this.rowDescriptor = new PgRowDescriptor(packet.ReadShort()); --- 704,708 ---- } ! private void ProcessRowDescription(PgResponsePacket packet) { this.rowDescriptor = new PgRowDescriptor(packet.ReadShort()); *************** *** 722,726 **** } ! private void processParameterDescription(PgResponsePacket packet) { this.parameters = new PgParameter[packet.ReadShort()]; --- 722,726 ---- } ! private void ProcessParameterDescription(PgResponsePacket packet) { this.parameters = new PgParameter[packet.ReadShort()]; *************** *** 732,736 **** } ! private void processDataRow(PgResponsePacket packet) { int fieldCount = packet.ReadShort(); --- 732,736 ---- } ! private void ProcessDataRow(PgResponsePacket packet) { int fieldCount = packet.ReadShort(); Index: PgOutputPacket.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** PgOutputPacket.cs 21 Jul 2004 11:00:38 -0000 1.28 --- PgOutputPacket.cs 22 Jul 2004 10:58:58 -0000 1.29 *************** *** 260,264 **** foreach (object element in array) { ! this.writeParameter(packet, elementType.DataType, size, element); } --- 260,264 ---- foreach (object element in array) { ! this.WriteParameter(packet, elementType.DataType, size, element); } *************** *** 270,410 **** else { ! this.writeParameter(this, parameter.DataType.DataType, size, parameter.Value); ! } ! } ! } ! ! #endregion ! ! #region Private Methods ! ! private void writeParameter(PgOutputPacket packet, PgDataType dataType, int size, object value) ! { ! switch (dataType) ! { ! case PgDataType.Binary: ! packet.WriteInt(((byte[])value).Length); ! packet.Write((byte[])value); ! break; ! ! case PgDataType.Byte: ! packet.WriteInt(size); ! packet.Write((byte)value); ! break; ! ! case PgDataType.Int2: ! packet.WriteInt(size); ! packet.WriteShort(Convert.ToInt16(value)); ! break; ! ! case PgDataType.Int4: ! packet.WriteInt(size); ! packet.WriteInt(Convert.ToInt32(value)); ! break; ! ! case PgDataType.Int8: ! packet.WriteInt(size); ! packet.WriteLong(Convert.ToInt64(value)); ! break; ! ! case PgDataType.Interval: ! packet.WriteInt(size); ! packet.WriteInterval(TimeSpan.Parse(value.ToString())); ! break; ! ! case PgDataType.Decimal: ! { ! string paramValue = value.ToString(); ! packet.WriteInt(encoding.GetByteCount(paramValue)); ! packet.Write(paramValue.ToCharArray()); ! } ! break; ! ! case PgDataType.Double: ! packet.WriteInt(size); ! packet.WriteDouble(Convert.ToDouble(value)); ! break; ! ! case PgDataType.Float: ! packet.WriteInt(size); ! packet.WriteFloat(Convert.ToSingle(value)); ! break; ! ! case PgDataType.Currency: ! packet.WriteInt(size); ! packet.WriteInt(Convert.ToInt32(Convert.ToSingle(value)*100)); ! break; ! ! case PgDataType.Date: ! packet.WriteInt(size); ! packet.WriteDate(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Time: ! // packet.WriteInt(size); ! packet.WriteTime(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.TimeWithTZ: ! // packet.WriteInt(size); ! packet.WriteTimeWithTZ(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Timestamp: ! // packet.WriteInt(size); ! packet.WriteTimestamp(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.TimestampWithTZ: ! // packet.WriteInt(size); ! packet.WriteTimestampWithTZ(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Char: ! case PgDataType.VarChar: ! { ! string paramValue = value.ToString() + PgCodes.NULL_TERMINATOR; ! packet.WriteString(paramValue); } - break; - - case PgDataType.Point: - packet.WriteInt(size); - packet.WritePoint((PgPoint)value); - break; - - case PgDataType.Circle: - packet.WriteInt(size); - packet.WriteCircle((PgCircle)value); - break; - - case PgDataType.Line: - packet.WriteInt(size); - packet.WriteLine((PgLine)value); - break; - - case PgDataType.LSeg: - packet.WriteInt(size); - packet.WriteLSeg((PgLSeg)value); - break; - - case PgDataType.Box: - packet.WriteInt(size); - packet.WriteBox((PgBox)value); - break; - - case PgDataType.Polygon: - PgPolygon polygon = (PgPolygon)value; - - packet.WriteInt((size*polygon.Points.Length) + 4); - packet.WritePolygon(polygon); - break; - - case PgDataType.Path: - PgPath path = (PgPath)value; - - packet.WriteInt((size*path.Points.Length) + 5); - packet.WritePath(path); - break; } } --- 270,275 ---- else { ! this.WriteParameter(this, parameter.DataType.DataType, size, parameter.Value); } } } *************** *** 457,460 **** #endregion ! } } \ No newline at end of file --- 322,460 ---- #endregion ! ! #region Private Methods ! ! private void WriteParameter(PgOutputPacket packet, PgDataType dataType, int size, object value) ! { ! switch (dataType) ! { ! case PgDataType.Binary: ! packet.WriteInt(((byte[])value).Length); ! packet.Write((byte[])value); ! break; ! ! case PgDataType.Byte: ! packet.WriteInt(size); ! packet.Write((byte)value); ! break; ! ! case PgDataType.Int2: ! packet.WriteInt(size); ! packet.WriteShort(Convert.ToInt16(value)); ! break; ! ! case PgDataType.Int4: ! packet.WriteInt(size); ! packet.WriteInt(Convert.ToInt32(value)); ! break; ! ! case PgDataType.Int8: ! packet.WriteInt(size); ! packet.WriteLong(Convert.ToInt64(value)); ! break; ! ! case PgDataType.Interval: ! packet.WriteInt(size); ! packet.WriteInterval(TimeSpan.Parse(value.ToString())); ! break; ! ! case PgDataType.Decimal: ! { ! string paramValue = value.ToString(); ! packet.WriteInt(encoding.GetByteCount(paramValue)); ! packet.Write(paramValue.ToCharArray()); ! } ! break; ! ! case PgDataType.Double: ! packet.WriteInt(size); ! packet.WriteDouble(Convert.ToDouble(value)); ! break; ! ! case PgDataType.Float: ! packet.WriteInt(size); ! packet.WriteFloat(Convert.ToSingle(value)); ! break; ! ! case PgDataType.Currency: ! packet.WriteInt(size); ! packet.WriteInt(Convert.ToInt32(Convert.ToSingle(value) * 100)); ! break; ! ! case PgDataType.Date: ! packet.WriteInt(size); ! packet.WriteDate(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Time: ! // packet.WriteInt(size); ! packet.WriteTime(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.TimeWithTZ: ! // packet.WriteInt(size); ! packet.WriteTimeWithTZ(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Timestamp: ! // packet.WriteInt(size); ! packet.WriteTimestamp(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.TimestampWithTZ: ! // packet.WriteInt(size); ! packet.WriteTimestampWithTZ(Convert.ToDateTime(value)); ! break; ! ! case PgDataType.Char: ! case PgDataType.VarChar: ! { ! string paramValue = value.ToString() + PgCodes.NULL_TERMINATOR; ! packet.WriteString(paramValue); ! } ! break; ! ! case PgDataType.Point: ! packet.WriteInt(size); ! packet.WritePoint((PgPoint)value); ! break; ! ! case PgDataType.Circle: ! packet.WriteInt(size); ! packet.WriteCircle((PgCircle)value); ! break; ! ! case PgDataType.Line: ! packet.WriteInt(size); ! packet.WriteLine((PgLine)value); ! break; ! ! case PgDataType.LSeg: ! packet.WriteInt(size); ! packet.WriteLSeg((PgLSeg)value); ! break; ! ! case PgDataType.Box: ! packet.WriteInt(size); ! packet.WriteBox((PgBox)value); ! break; ! ! case PgDataType.Polygon: ! PgPolygon polygon = (PgPolygon)value; ! ! packet.WriteInt((size * polygon.Points.Length) + 4); ! packet.WritePolygon(polygon); ! break; ! ! case PgDataType.Path: ! PgPath path = (PgPath)value; ! ! packet.WriteInt((size * path.Points.Length) + 5); ! packet.WritePath(path); ! break; ! } ! } ! ! #endregion ! } } \ No newline at end of file Index: PgClientErrorCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgClientErrorCollection.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PgClientErrorCollection.cs 10 Apr 2004 20:16:07 -0000 1.6 --- PgClientErrorCollection.cs 22 Jul 2004 10:58:58 -0000 1.7 *************** *** 54,58 **** foreach(PgClientError item in this) { ! if (this.cultureAwareCompare(item.Message, errorMessage)) { return index; --- 54,58 ---- foreach(PgClientError item in this) { ! if (this.CultureAwareCompare(item.Message, errorMessage)) { return index; *************** *** 83,87 **** } ! private bool cultureAwareCompare(string strA, string strB) { return CultureInfo.CurrentCulture.CompareInfo.Compare( --- 83,91 ---- } ! #endregion ! ! #region Private Methods ! ! private bool CultureAwareCompare(string strA, string strB) { return CultureInfo.CurrentCulture.CompareInfo.Compare( |
From: Carlos G. Á. <car...@us...> - 2004-07-22 10:58:47
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/Design/ParameterCollection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20269 Modified Files: PgParameterCollectionEditor.cs PgParameterConverter.cs Log Message: 2004-07-22 Carlos Guzman Alvarez <car...@te...> * USe PascalCase naming for private methods in all classes. Index: PgParameterConverter.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/Design/ParameterCollection/PgParameterConverter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgParameterConverter.cs 9 Feb 2004 14:20:06 -0000 1.2 --- PgParameterConverter.cs 22 Jul 2004 10:58:36 -0000 1.3 *************** *** 27,32 **** { internal class PgParameterConverter : TypeConverter ! { ! public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) --- 27,34 ---- { internal class PgParameterConverter : TypeConverter ! { ! #region Methods ! ! public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) *************** *** 69,72 **** --- 71,76 ---- return base.ConvertTo(context, culture, value, destinationType); } + + #endregion } } Index: PgParameterCollectionEditor.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/Design/ParameterCollection/PgParameterCollectionEditor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgParameterCollectionEditor.cs 9 Feb 2004 14:20:06 -0000 1.2 --- PgParameterCollectionEditor.cs 22 Jul 2004 10:58:36 -0000 1.3 *************** *** 27,34 **** { internal class PgParameterCollectionEditor : System.ComponentModel.Design.CollectionEditor ! { ! private PgParameterCollection parameters; ! public PgParameterCollectionEditor(Type type) : base(type) { parameters = null; --- 27,40 ---- { internal class PgParameterCollectionEditor : System.ComponentModel.Design.CollectionEditor ! { ! #region Fields ! ! private PgParameterCollection parameters; ! #endregion ! ! #region Methods ! ! public PgParameterCollectionEditor(Type type) : base(type) { parameters = null; *************** *** 39,43 **** PgParameter parameter = (PgParameter)base.CreateInstance(type); ! parameter.ParameterName = this.generateParameterName("Parameter"); return parameter; --- 45,49 ---- PgParameter parameter = (PgParameter)base.CreateInstance(type); ! parameter.ParameterName = this.GenerateParameterName("Parameter"); return parameter; *************** *** 50,54 **** } ! private string generateParameterName(string prefix) { string parameterName = String.Empty; --- 56,64 ---- } ! #endregion ! ! #region Private Methods ! ! private string GenerateParameterName(string prefix) { string parameterName = String.Empty; *************** *** 68,71 **** --- 78,83 ---- return parameterName; } + + #endregion } } \ No newline at end of file |