Commit 18e7dfa3 authored by Matthieu Kermagoret's avatar Matthieu Kermagoret
Browse files

SSH: fix iterator removal. This fixes #5027.

parent b172cc43
......@@ -89,10 +89,11 @@ void session::close() {
// Notify listeners.
{
for (_listnrs_it = _listnrs.begin();
_listnrs_it != _listnrs.end();
++_listnrs_it)
(*_listnrs_it)->on_close(*this);
_listnrs_it = _listnrs.begin();
while (_listnrs_it != _listnrs.end()) {
std::set<listener*>::iterator it(_listnrs_it++);
(*it)->on_close(*this);
}
}
// Close socket.
......@@ -492,10 +493,11 @@ void session::_key() {
_step = session_keepalive;
_step_string = "keep-alive";
{
for (_listnrs_it = _listnrs.begin();
_listnrs_it != _listnrs.end();
++_listnrs_it)
(*_listnrs_it)->on_connected(*this);
_listnrs_it = _listnrs.begin();
while (_listnrs_it != _listnrs.end()) {
std::set<listener*>::iterator it(_listnrs_it++);
(*it)->on_connected(*this);
}
}
}
return ;
......@@ -550,10 +552,11 @@ void session::_passwd() {
_step = session_keepalive;
_step_string = "keep-alive";
{
for (_listnrs_it = _listnrs.begin();
_listnrs_it != _listnrs.end();
++_listnrs_it)
(*_listnrs_it)->on_connected(*this);
_listnrs_it = _listnrs.begin();
while (_listnrs_it != _listnrs.end()) {
std::set<listener*>::iterator it(_listnrs_it++);
(*it)->on_connected(*this);
}
}
}
return ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment