File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ INCLUDE_DIR = ${PREFIX}/include
33LIBRARY_DIR = ${PREFIX}/lib
44export LIBRARY_NAME = dnscpp
55export SONAME = 1.3
6- export VERSION = 1.3.4
6+ export VERSION = 1.3.5
77
88all :
99 $(MAKE ) -C src all
Original file line number Diff line number Diff line change @@ -107,7 +107,16 @@ size_t Sockets::deliver(size_t maxcalls)
107107 // when responses from tcp sockets are delivered, it is possible that at the same
108108 // time those sockets are removed from the underlying array (by the onUnused() method),
109109 // to ensure that we can use a simple iterator, we make a copy of the sockets
110- auto sockets = _tcps;
110+ // (note that the Tcp object has smarty detection of user-space destruction, so we
111+ // cannot make a normal copy of the shared_ptr<Tcp> here, as that would keep the
112+ // object in space)
113+ std::vector<Tcp*> sockets;
114+
115+ // micro-optimization
116+ sockets.reserve (_tcps.size ());
117+
118+ // copy them one at a time
119+ for (const auto &socket : _tcps) sockets.push_back (socket.get ());
111120
112121 // deliver the buffer from all tcp sockets
113122 for (auto &socket : sockets)
You can’t perform that action at this time.
0 commit comments