Remove dangerous reference 27/30227/4
authorZofia Abramowska <z.abramowska@samsung.com>
Wed, 12 Nov 2014 15:36:52 +0000 (16:36 +0100)
committerZofia Abramowska <z.abramowska@samsung.com>
Thu, 13 Nov 2014 15:35:51 +0000 (16:35 +0100)
commitcb00a4e9ea320a3f74cb28b06e30bb7b5e43d613
tree83e0379e33c6ecaa69feb43c94a31ee58831905b
parent481d3058557b53ed807fce6ba6412da683e0f392
Remove dangerous reference

RequestContext contained reference to an external BinaryQueue. One
problem was, BBQ was held inside vector (so practically any operation
on vector made this object out-of-date), second problem was,
RequestContext was passed to other classes inside shared_ptr, so owner
of this bbq looses control other its reference.
Moreover, soon RequestContext will be held pending (e.g. when waiting
for external Agent to return answer) inside cynara logic, so BBQ stored
inside RequestContext needs to be alive as long as corresponding
connection is opened. Not more, not less.

Change-Id: I79c9eb9b5e74927bd7bb159da01fae23612ca83e
18 files changed:
src/client-async/sockets/SocketClientAsync.cpp
src/client-async/sockets/SocketClientAsync.h
src/common/containers/BinaryQueue.h
src/common/exceptions/ContextErrorException.h [new file with mode: 0644]
src/common/protocol/Protocol.h
src/common/protocol/ProtocolAdmin.cpp
src/common/protocol/ProtocolAdmin.h
src/common/protocol/ProtocolClient.cpp
src/common/protocol/ProtocolClient.h
src/common/protocol/ProtocolFrameSerializer.cpp
src/common/protocol/ProtocolFrameSerializer.h
src/common/protocol/ProtocolSignal.cpp
src/common/protocol/ProtocolSignal.h
src/common/request/RequestContext.h
src/common/sockets/SocketClient.cpp
src/common/sockets/SocketClient.h
src/service/sockets/Descriptor.cpp
src/service/sockets/Descriptor.h