diff options
| author | Alan Conway <aconway@apache.org> | 2008-08-15 22:40:30 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-08-15 22:40:30 +0000 |
| commit | a89ff937607b452a1b890861700eea08e08e7724 (patch) | |
| tree | a1bc1cf7404c71a0219a585aaa7aa6dcfbb542d8 /cpp/src/qpid/cluster/ConnectionInterceptor.cpp | |
| parent | 828592ed28dc68137c007dbc8ec92d6826cab929 (diff) | |
| download | qpid-python-a89ff937607b452a1b890861700eea08e08e7724.tar.gz | |
Fix memory leak in Cluster and enable valgrind in ais_check
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@686409 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ConnectionInterceptor.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/ConnectionInterceptor.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/cpp/src/qpid/cluster/ConnectionInterceptor.cpp b/cpp/src/qpid/cluster/ConnectionInterceptor.cpp index 81d496597a..c13651eccb 100644 --- a/cpp/src/qpid/cluster/ConnectionInterceptor.cpp +++ b/cpp/src/qpid/cluster/ConnectionInterceptor.cpp @@ -42,7 +42,6 @@ ConnectionInterceptor::ConnectionInterceptor( } ConnectionInterceptor::~ConnectionInterceptor() { - assert(isClosed); assert(connection == 0); } @@ -52,7 +51,6 @@ void ConnectionInterceptor::received(framing::AMQFrame& f) { } void ConnectionInterceptor::deliver(framing::AMQFrame& f) { - // ostringstream os; os << f; printf("Received: %s\n", os.str().c_str()); // FIXME aconway 2008-08-08: remove receivedNext(f); } @@ -82,9 +80,19 @@ void ConnectionInterceptor::deliverClosed() { connection = 0; } +void ConnectionInterceptor::dirtyClose() { + // Not closed via cluster self-delivery but closed locally. + // Used for dirty cluster shutdown where active connections + // must be cleaned up. + connection = 0; +} + bool ConnectionInterceptor::doOutput() { + // FIXME aconway 2008-08-15: this is not correct. + // Run in write threads so order of execution of doOutput is not determinate. + // Will only work reliably for in single-consumer tests. + if (connection->hasOutput()) { - QPID_LOG(debug, "Intercept doOutput, call doOutputNext"); // FIXME aconway 2008-08-08: remove cluster.send(AMQFrame(in_place<ClusterConnectionDoOutputBody>()), this); return doOutputNext(); } @@ -92,13 +100,9 @@ bool ConnectionInterceptor::doOutput() { } void ConnectionInterceptor::deliverDoOutput() { - if (isShadow()) { - QPID_LOG(debug, "Shadow deliver do output, call doOutputNext"); // FIXME aconway 2008-08-08: remove + // FIXME aconway 2008-08-15: see comment in doOutput. + if (isShadow()) doOutputNext(); - } - else { - QPID_LOG(debug, "Primary deliver doOutput, ignore."); // FIXME aconway 2008-08-08: remove - } } }} // namespace qpid::cluster |
