Exception on destructing the SMTP Transport instance #3645

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@bboer

When the SMTP destructs the socket gets closed automatically to free up resources which is good, hoewever when the SMTP Transport desctructs it also calls the disconnect on the SMTP Protocol which is in the middle of destruction and does not have a valid socket anymore. At that moment the sess is still set to true resulting in an Exception on destruction. Implementint / overriding the _disconnect from the SMTP protocol makes sure quit gets issued as well. Quit in itself already checks if the session is still there and makes sure the session gets set to false after quitting.

@bboer bboer When the SMTP destructs the socket gets closed automatically to free …
…up resources which is good, hoewever when the SMTP Transport desctructs it also calls the disconnect on the SMTP Protocol which is in the middle of destruction and does not have a valid socket anymore. At that moment the sess is still set to true resulting in an Exception on destruction. Implementint / overriding the _disconnect from the SMTP protocol makes sure quit gets issued as well. Quit in itself already checks if the session is still there and makes sure the session gets set to false after quitting.
9e456df
@Maks3w
Zend Framework member

Please add a test case for this to avoid regressions.

Hint: Create a test asset extending from Smtp class and call the __destruct() method

@weierophinney weierophinney added a commit that referenced this pull request Feb 5, 2013
@weierophinney weierophinney [#3645] Added unit test
- Added unit test verifying that quit() gets called
3bbe2b5
@weierophinney weierophinney added a commit that referenced this pull request Feb 5, 2013
@weierophinney weierophinney Merge branch 'hotfix/3645' into develop
Forward port #3645
b53a2ce
@weierophinney weierophinney was assigned Feb 5, 2013
@weierophinney weierophinney added a commit that closed this pull request Feb 5, 2013
@weierophinney weierophinney Merge branch 'hotfix/3645'
Close #3645
ed5dbf1
@weierophinney
Zend Framework member

I've added a unit test, and merged.

@bboer

@weierophinney Thanks, did not get the time to add tests. Am glad it got merged :).

@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney [#3645] Added unit test
- Added unit test verifying that quit() gets called
8344d63
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney Merge branch 'hotfix/3645'
Close #3645
9d1e9ad
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney Merge branch 'hotfix/3645' into develop
Forward port #3645
af79269
@weierophinney weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
@weierophinney weierophinney [zendframework/zendframework#3645] Added unit test
- Added unit test verifying that quit() gets called
0c3a02f
@weierophinney weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
@weierophinney weierophinney Merge branch 'hotfix/3645' b428d8b
@weierophinney weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
@weierophinney weierophinney Merge branch 'hotfix/3645' into develop 71822ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment