diff --git a/ChangeLog b/ChangeLog index be35ad3..b17690a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ E-MailRelay Change Log ====================== +1.1.2 -> 1.1.3 +-------------- +* Fix for dangling reference bug, seen after "quit" command on Windows. +* Keeps authentication after a "rset" command. + 1.1.1 -> 1.1.2 -------------- * Earlier check for un-bindable ports on startup, and later fork()ing [bug-id 776972]. diff --git a/configure b/configure index 7b28a7f..ff1cfc0 100755 --- a/configure +++ b/configure @@ -1459,7 +1459,7 @@ fi # Define the identity of the package. PACKAGE=emailrelay - VERSION=1.1.2 + VERSION=1.1.3 cat >>confdefs.h <<_ACEOF diff --git a/configure.ac b/configure.ac index c13c4aa..4ffa83f 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script. dnl AC_INIT(src/gsmtp/gsmtp.h) -AM_INIT_AUTOMAKE(emailrelay,1.1.2) +AM_INIT_AUTOMAKE(emailrelay,1.1.3) AM_CONFIG_HEADER(config.h) dnl === diff --git a/emailrelay.spec b/emailrelay.spec index c20de07..05d03be 100644 --- a/emailrelay.spec +++ b/emailrelay.spec @@ -1,10 +1,10 @@ Summary: Simple e-mail message transfer agent using SMTP Name: emailrelay -Version: 1.1.2 +Version: 1.1.3 Release: 1 Copyright: GPL Group: System Environment/Daemons -Source: http://emailrelay.sourceforge.net/.../emailrelay-src-1.1.2.tar.gz +Source: http://emailrelay.sourceforge.net/.../emailrelay-src-1.1.3.tar.gz BuildRoot: /tmp/emailrelay-install %define prefix /usr diff --git a/src/gsmtp/gadminserver.cpp b/src/gsmtp/gadminserver.cpp index 7dc41bf..7078673 100644 --- a/src/gsmtp/gadminserver.cpp +++ b/src/gsmtp/gadminserver.cpp @@ -52,6 +52,7 @@ GSmtp::AdminPeer::~AdminPeer() // only safe because AdminServer::dtor calls serverCleanup() -- otherwise // the derived part of the server may already be destroyed m_server.unregister( this ) ; + if( m_client.get() ) m_client->doneSignal().disconnect() ; } void GSmtp::AdminPeer::clientDone( std::string s ) diff --git a/src/gsmtp/gprotocolmessageforward.cpp b/src/gsmtp/gprotocolmessageforward.cpp index c135019..3388034 100644 --- a/src/gsmtp/gprotocolmessageforward.cpp +++ b/src/gsmtp/gprotocolmessageforward.cpp @@ -51,6 +51,8 @@ G::Signal3 & GSmtp::ProtocolMessageForward::stor GSmtp::ProtocolMessageForward::~ProtocolMessageForward() { + m_pm.doneSignal().disconnect() ; + if( m_client.get() ) m_client->doneSignal().disconnect() ; } G::Signal3 & GSmtp::ProtocolMessageForward::doneSignal() diff --git a/src/gsmtp/gprotocolmessagescanner.cpp b/src/gsmtp/gprotocolmessagescanner.cpp index 3f5408e..a67d34a 100644 --- a/src/gsmtp/gprotocolmessagescanner.cpp +++ b/src/gsmtp/gprotocolmessagescanner.cpp @@ -52,6 +52,7 @@ GSmtp::ProtocolMessageScanner::ProtocolMessageScanner( MessageStore & store , void GSmtp::ProtocolMessageScanner::scannerInit() { + storageDoneSignal().disconnect() ; // base-class signal m_scanner_client <<= new ScannerClient(m_scanner_server,m_scanner_connection_timeout,m_scanner_response_timeout) ; m_scanner_client->connectedSignal().connect( G::slot(*this,&ProtocolMessageScanner::connectDone) ) ; @@ -60,6 +61,12 @@ void GSmtp::ProtocolMessageScanner::scannerInit() GSmtp::ProtocolMessageScanner::~ProtocolMessageScanner() { + storageDoneSignal().disconnect() ; // base-class signal + if( m_scanner_client.get() ) + { + m_scanner_client->connectedSignal().disconnect() ; + m_scanner_client->doneSignal().disconnect() ; + } } G::Signal3 & GSmtp::ProtocolMessageScanner::preparedSignal() diff --git a/src/gsmtp/gserverprotocol.cpp b/src/gsmtp/gserverprotocol.cpp index a9f17bc..4d62f8c 100644 --- a/src/gsmtp/gserverprotocol.cpp +++ b/src/gsmtp/gserverprotocol.cpp @@ -141,7 +141,7 @@ void GSmtp::ServerProtocol::processDone( bool success , unsigned long , std::str void GSmtp::ServerProtocol::doQuit( const std::string & , bool & ) { - sendClosing() ; + // (could call sendClosing() here, but if it fails it does "delete this". m_sender.protocolDone() ; // do nothing more -- this object may have been deleted in protocolDone() } @@ -390,7 +390,7 @@ void GSmtp::ServerProtocol::doUnknown( const std::string & line , bool & ) void GSmtp::ServerProtocol::doRset( const std::string & , bool & ) { m_pmessage.clear() ; - m_sasl.init("") ; m_authenticated = false ; // (not clear in the RFCs) + // (could also reset authentication here) sendRsetReply() ; } @@ -574,6 +574,8 @@ void GSmtp::ServerProtocol::send( std::string line ) GSmtp::ServerProtocol::~ServerProtocol() { + m_pmessage.doneSignal().disconnect() ; + m_pmessage.preparedSignal().disconnect() ; } std::string GSmtp::ServerProtocol::parseFrom( const std::string & line ) const diff --git a/src/gsmtp/gsmtpclient.cpp b/src/gsmtp/gsmtpclient.cpp index a199dbb..dcdcd38 100644 --- a/src/gsmtp/gsmtpclient.cpp +++ b/src/gsmtp/gsmtpclient.cpp @@ -81,6 +81,11 @@ GSmtp::Client::Client( std::auto_ptr message , const Secrets & se m_protocol.doneSignal().connect( G::slot(*this,&Client::protocolDone) ) ; } +GSmtp::Client::~Client() +{ + m_protocol.doneSignal().disconnect() ; +} + std::string GSmtp::Client::startSending( const std::string & s , unsigned int connection_timeout ) { size_t pos = s.find(':') ; diff --git a/src/gsmtp/gsmtpclient.h b/src/gsmtp/gsmtpclient.h index f834ac8..73d7295 100644 --- a/src/gsmtp/gsmtpclient.h +++ b/src/gsmtp/gsmtpclient.h @@ -80,6 +80,9 @@ public: // message is fail()ed if the connection to the // downstream server cannot be made. + virtual ~Client() ; + // Destructor. + G::Signal1 & doneSignal() ; // Returns a signal which indicates that client processing // is complete. diff --git a/src/main/doxygen.cfg b/src/main/doxygen.cfg index 8543731..3e8522a 100644 --- a/src/main/doxygen.cfg +++ b/src/main/doxygen.cfg @@ -3,7 +3,7 @@ # General configuration options #--------------------------------------------------------------------------- PROJECT_NAME = E-MailRelay -PROJECT_NUMBER = 1.1.2 +PROJECT_NUMBER = 1.1.3 OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English EXTRACT_ALL = YES diff --git a/src/main/run.cpp b/src/main/run.cpp index 29bae16..5ec6a36 100644 --- a/src/main/run.cpp +++ b/src/main/run.cpp @@ -50,7 +50,7 @@ //static std::string Main::Run::versionNumber() { - return "1.1.2" ; + return "1.1.3" ; } Main::Run::Run( Main::Output & output , const G::Arg & arg , const std::string & switch_spec ) : @@ -62,6 +62,9 @@ Main::Run::Run( Main::Output & output , const G::Arg & arg , const std::string & Main::Run::~Run() { + if( m_store.get() ) m_store->signal().disconnect() ; + if( m_client.get() ) m_client->doneSignal().disconnect() ; + if( m_client.get() ) m_client->eventSignal().disconnect() ; } Main::Configuration Main::Run::cfg() const diff --git a/src/main/run.h b/src/main/run.h index d7a9991..e177f95 100644 --- a/src/main/run.h +++ b/src/main/run.h @@ -116,13 +116,13 @@ private: std::string m_switch_spec ; std::auto_ptr m_cl ; std::auto_ptr m_log_output ; - std::auto_ptr m_client ; G::Arg m_arg ; G::Signal3 m_signal ; - std::auto_ptr m_store ; + std::auto_ptr m_store ; // order dependency -- early std::auto_ptr m_client_secrets ; std::auto_ptr m_admin_server ; std::auto_ptr m_poll_timer ; + std::auto_ptr m_client ; // order dependency -- late } ; #endif