[pgsqlclient-checkins] pgsqlclient_10/PostgreSql.Data.PgSqlClient/source PgConnection.cs,1.14,1.15
Status: Inactive
Brought to you by:
carlosga_fb
|
From: <car...@us...> - 2004-03-09 12:57:45
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3707 Modified Files: PgConnection.cs Log Message: 2004-03-09 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PgSqlClient/PgDataReader.cs: - Improved data reader implementation. Index: PgConnection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PgConnection.cs 8 Mar 2004 15:12:26 -0000 1.14 --- PgConnection.cs 9 Mar 2004 12:40:35 -0000 1.15 *************** *** 61,67 **** private PgClientMessageEventHandler infoMessageHandler; private PgClientNotificationEventHandler notificationHandler; - private CertificateValidationCallback certificateValidationCallback; - private CertificateSelectionCallback certificateSelectionCallback; - private PrivateKeySelectionCallback privateKeySelectionCallback; #endregion --- 61,64 ---- *************** *** 405,418 **** // Add Info message event handler ! infoMessageHandler = new PgClientMessageEventHandler(OnInfoMessage); ! dbConnection.DB.InfoMessage += infoMessageHandler; // Add notification event handler ! notificationHandler = new PgClientNotificationEventHandler(OnNotification); ! dbConnection.DB.Notification += notificationHandler; } catch (PgClientException ex) { ! state = ConnectionState.Closed; throw new PgException(ex.Message, ex); } --- 402,415 ---- // Add Info message event handler ! this.infoMessageHandler = new PgClientMessageEventHandler(OnInfoMessage); ! this.dbConnection.DB.InfoMessage += infoMessageHandler; // Add notification event handler ! this.notificationHandler = new PgClientNotificationEventHandler(OnNotification); ! this.dbConnection.DB.Notification += notificationHandler; } catch (PgClientException ex) { ! this.state = ConnectionState.Closed; throw new PgException(ex.Message, ex); } *************** *** 421,425 **** public void Close() { ! if (state == ConnectionState.Open) { try --- 418,422 ---- public void Close() { ! if (this.state == ConnectionState.Open) { try *************** *** 428,470 **** { // Close DataReader ! if (dataReader != null && ! !dataReader.IsClosed) { ! dataReader.Close(); } // Dispose Active commands ! DisposeActiveCommands(); // Rollback active transation ! if (activeTransaction != null) { ! activeTransaction.Dispose(); ! activeTransaction = null; } // Remove info message event handler ! dbConnection.DB.InfoMessage -= infoMessageHandler; // Remove notification event handler ! dbConnection.DB.Notification -= notificationHandler; ! ! // Remove SSL handlers ! if (this.dbConnection.Settings.SSL) { ! ServerCertValidation -= certificateValidationCallback; ! ClientCertSelection -= certificateSelectionCallback; ! PrivateKeySelection -= privateKeySelectionCallback; } // Close connection permanently or send it // back to the pool if (dbConnection.Pooled) { ! PgConnectionPool.FreeConnection(dbConnection); } else { ! dbConnection.Disconnect(); } } --- 425,470 ---- { // 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 info message event handler ! if (this.infoMessageHandler != null) ! { ! this.dbConnection.DB.InfoMessage -= this.infoMessageHandler; ! } // Remove notification event handler ! if (this.notificationHandler != null) { ! this.dbConnection.DB.Notification -= this.notificationHandler; } + // Remove SSL handlers + this.ServerCertValidation = null; + this.ClientCertSelection = null; + this.PrivateKeySelection = null; + // Close connection permanently or send it // back to the pool if (dbConnection.Pooled) { ! PgConnectionPool.FreeConnection(this.dbConnection); } else { ! this.dbConnection.Disconnect(); } } *************** *** 476,480 **** if (StateChange != null) { ! StateChange(this, new StateChangeEventArgs(ConnectionState.Open, state)); } } --- 476,482 ---- if (StateChange != null) { ! this.StateChange( ! this, ! new StateChangeEventArgs(ConnectionState.Open, this.state)); } } *************** *** 670,683 **** { // Server certificate validation ! certificateValidationCallback = new CertificateValidationCallback(OnServerCertificateValidation); ! dbConnection.DB.SslClientStream.ServerCertValidationDelegate = certificateValidationCallback; // Client certificate selection ! certificateSelectionCallback = new CertificateSelectionCallback(OnClientCertificateSelection); ! dbConnection.DB.SslClientStream.ClientCertSelectionDelegate = certificateSelectionCallback; // Private key selection ! privateKeySelectionCallback = new PrivateKeySelectionCallback(OnPrivateKeySelection); ! dbConnection.DB.SslClientStream.PrivateKeyCertSelectionDelegate = privateKeySelectionCallback; } --- 672,682 ---- { // Server certificate validation ! dbConnection.DB.SslClientStream.ServerCertValidationDelegate = new CertificateValidationCallback(OnServerCertificateValidation); // Client certificate selection ! dbConnection.DB.SslClientStream.ClientCertSelectionDelegate = new CertificateSelectionCallback(OnClientCertificateSelection); // Private key selection ! dbConnection.DB.SslClientStream.PrivateKeyCertSelectionDelegate = new PrivateKeySelectionCallback(OnPrivateKeySelection); } |