[pgsqlclient-checkins] SF.net SVN: pgsqlclient: [63] trunk/pgsqlclient/source/PostgreSql/Data/Postgr
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2006-03-28 12:34:40
|
Revision: 63 Author: carlosga_fb Date: 2006-03-28 04:34:28 -0800 (Tue, 28 Mar 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=63&view=rev Log Message: ----------- ?\194?\183 Changes for correct handling of SSL callbacks Modified Paths: -------------- trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnection.cs trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionInternal.cs trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionPool.cs Modified: trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnection.cs =================================================================== --- trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnection.cs 2006-03-28 12:14:23 UTC (rev 62) +++ trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnection.cs 2006-03-28 12:34:28 UTC (rev 63) @@ -326,6 +326,8 @@ else { this.connectionInternal = new PgConnectionInternal(this); + + this.SslSetup(); this.connectionInternal.OwningConnection = this; this.connectionInternal.Pooled = false; @@ -344,10 +346,6 @@ // Add notification event handler this.connectionInternal.Database.Notification = new NotificationCallback(this.OnNotification); - - // Add SSL callback handlers - this.connectionInternal.Database.UserCertificateValidationCallback = new RemoteCertificateValidationCallback(OnUserCertificateValidation); - this.connectionInternal.Database.UserCertificateSelectionCallback = new LocalCertificateSelectionCallback(OnUserCertificateSelection); } catch (PgClientException ex) { @@ -445,9 +443,20 @@ #endregion - #region \xB7 Event Handlers Methods \xB7 + #region \xB7 SSL Setup \xB7 - private void OnInfoMessage(PgClientException ex) + internal void SslSetup() + { + // Add SSL callback handlers + this.connectionInternal.Database.UserCertificateValidationCallback = new RemoteCertificateValidationCallback(OnUserCertificateValidation); + this.connectionInternal.Database.UserCertificateSelectionCallback = new LocalCertificateSelectionCallback(OnUserCertificateSelection); + } + + #endregion + + #region \xB7 Event Handlers Methods \xB7 + + private void OnInfoMessage(PgClientException ex) { if (this.InfoMessage != null) { Modified: trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionInternal.cs =================================================================== --- trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionInternal.cs 2006-03-28 12:14:23 UTC (rev 62) +++ trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionInternal.cs 2006-03-28 12:34:28 UTC (rev 63) @@ -101,6 +101,7 @@ { this.owningConnection = owningConnection; this.options = new PgConnectionOptions(owningConnection.ConnectionString); + this.database = new PgDatabase(this.options); this.created = 0; this.pooled = true; } @@ -113,7 +114,6 @@ { try { - this.database = new PgDatabase(this.options); this.database.Connect(); } catch (PgClientException ex) Modified: trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionPool.cs =================================================================== --- trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionPool.cs 2006-03-28 12:14:23 UTC (rev 62) +++ trunk/pgsqlclient/source/PostgreSql/Data/PostgreSqlClient/PgConnectionPool.cs 2006-03-28 12:34:28 UTC (rev 63) @@ -137,10 +137,12 @@ newConnection = this.Create(owningConnection); - newConnection.OwningConnection = owningConnection; - newConnection.Pooled = true; - newConnection.Created = System.DateTime.Now.Ticks; + newConnection.OwningConnection = owningConnection; + newConnection.Pooled = true; + newConnection.Created = System.DateTime.Now.Ticks; + owningConnection.SslSetup(); + newConnection.Connect(); this.locked.Add(newConnection); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |