summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectionList.cpp8
-rw-r--r--connectionParam.h12
2 files changed, 13 insertions, 7 deletions
diff --git a/connectionList.cpp b/connectionList.cpp
index 81a0f49..baa8c44 100644
--- a/connectionList.cpp
+++ b/connectionList.cpp
@@ -44,7 +44,13 @@ ConnectionList::~ConnectionList()
void ConnectionList::addConnection(ConnectionParam &conn, const std::string &name)
{
Lock lock(mutex_);
-// connections_[name]=conn;
+
+ std::pair<ConnectionMap::iterator, bool> ret = connections_.insert(ConnectionMap::value_type(name, conn));
+ if(!ret.second)
+ {
+ connections_.erase(ret.first);
+ connections_.insert(ConnectionMap::value_type(name, conn));
+ }
}
void ConnectionList::clear()
diff --git a/connectionParam.h b/connectionParam.h
index 671c909..ac7b8e2 100644
--- a/connectionParam.h
+++ b/connectionParam.h
@@ -40,12 +40,12 @@
class ConnectionParam
{
public:
- ConnectionParam(Options& opt,KeyDerivation& kd,Cypher& c,AuthAlgo& a,SeqWindow& seq);
- const Options& opt_;
- const KeyDerivation& kd_;
- const Cypher& c_;
- const AuthAlgo& a_;
- const SeqWindow& seq_;
+ ConnectionParam(Options& opt, KeyDerivation& kd, Cypher& c, AuthAlgo& a, SeqWindow& seq);
+ Options& opt_;
+ KeyDerivation& kd_;
+ Cypher& c_;
+ AuthAlgo& a_;
+ SeqWindow& seq_;
};
#endif