summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-19 00:42:50 +0000
committerAlan Conway <aconway@apache.org>2006-10-19 00:42:50 +0000
commit025451b1e26c48ca58c388921827929d11c9459c (patch)
treec17089878b1a40d6b310e8bc964e9130d4fdc8cc /cpp/src/qpid
parent0bb663e29bc993e94171be1427c5686702bde091 (diff)
downloadqpid-python-025451b1e26c48ca58c388921827929d11c9459c.tar.gz
Fixed various minor TODO issues.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@465432 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/broker/SessionHandlerImpl.cpp9
-rw-r--r--cpp/src/qpid/broker/SessionHandlerImpl.h20
-rw-r--r--cpp/src/qpid/client/Channel.cpp4
-rw-r--r--cpp/src/qpid/framing/AMQHeaderBody.cpp4
-rw-r--r--cpp/src/qpid/io/APRSocket.cpp1
-rw-r--r--cpp/src/qpid/io/BlockingAPRSessionContext.cpp3
6 files changed, 13 insertions, 28 deletions
diff --git a/cpp/src/qpid/broker/SessionHandlerImpl.cpp b/cpp/src/qpid/broker/SessionHandlerImpl.cpp
index 157fca5acb..0713b84164 100644
--- a/cpp/src/qpid/broker/SessionHandlerImpl.cpp
+++ b/cpp/src/qpid/broker/SessionHandlerImpl.cpp
@@ -48,14 +48,7 @@ SessionHandlerImpl::SessionHandlerImpl(SessionContext* _context,
framemax(65536),
heartbeat(0) {}
-SessionHandlerImpl::~SessionHandlerImpl(){
- // TODO aconway 2006-09-07: Should be auto_ptr or plain members.
- delete channelHandler;
- delete connectionHandler;
- delete basicHandler;
- delete exchangeHandler;
- delete queueHandler;
-}
+SessionHandlerImpl::~SessionHandlerImpl(){}
Channel* SessionHandlerImpl::getChannel(u_int16_t channel){
channel_iterator i = channels.find(channel);
diff --git a/cpp/src/qpid/broker/SessionHandlerImpl.h b/cpp/src/qpid/broker/SessionHandlerImpl.h
index 4504541623..afaae74d97 100644
--- a/cpp/src/qpid/broker/SessionHandlerImpl.h
+++ b/cpp/src/qpid/broker/SessionHandlerImpl.h
@@ -71,11 +71,11 @@ class SessionHandlerImpl : public virtual qpid::io::SessionHandler,
AutoDelete* const cleaner;
const u_int32_t timeout;//timeout for auto-deleted queues (in ms)
- ConnectionHandler* connectionHandler;
- ChannelHandler* channelHandler;
- BasicHandler* basicHandler;
- ExchangeHandler* exchangeHandler;
- QueueHandler* queueHandler;
+ std::auto_ptr<ConnectionHandler> connectionHandler;
+ std::auto_ptr<ChannelHandler> channelHandler;
+ std::auto_ptr<BasicHandler> basicHandler;
+ std::auto_ptr<ExchangeHandler> exchangeHandler;
+ std::auto_ptr<QueueHandler> queueHandler;
std::map<u_int16_t, Channel*> channels;
std::vector<Queue::shared_ptr> exclusiveQueues;
@@ -212,11 +212,11 @@ class SessionHandlerImpl : public virtual qpid::io::SessionHandler,
virtual ~BasicHandlerImpl(){}
};
- inline virtual ChannelHandler* getChannelHandler(){ return channelHandler; }
- inline virtual ConnectionHandler* getConnectionHandler(){ return connectionHandler; }
- inline virtual BasicHandler* getBasicHandler(){ return basicHandler; }
- inline virtual ExchangeHandler* getExchangeHandler(){ return exchangeHandler; }
- inline virtual QueueHandler* getQueueHandler(){ return queueHandler; }
+ inline virtual ChannelHandler* getChannelHandler(){ return channelHandler.get(); }
+ inline virtual ConnectionHandler* getConnectionHandler(){ return connectionHandler.get(); }
+ inline virtual BasicHandler* getBasicHandler(){ return basicHandler.get(); }
+ inline virtual ExchangeHandler* getExchangeHandler(){ return exchangeHandler.get(); }
+ inline virtual QueueHandler* getQueueHandler(){ return queueHandler.get(); }
inline virtual AccessHandler* getAccessHandler(){ return 0; }
inline virtual FileHandler* getFileHandler(){ return 0; }
diff --git a/cpp/src/qpid/client/Channel.cpp b/cpp/src/qpid/client/Channel.cpp
index 0563dbaaba..99e827488c 100644
--- a/cpp/src/qpid/client/Channel.cpp
+++ b/cpp/src/qpid/client/Channel.cpp
@@ -119,9 +119,7 @@ void Channel::deleteQueue(Queue& queue, bool ifunused, bool ifempty, bool synch)
void Channel::bind(const Exchange& exchange, const Queue& queue, const std::string& key, const FieldTable& args, bool synch){
string e = exchange.getName();
string q = queue.getName();
- // TODO aconway 2006-10-10: not const correct, get rid of const_cast.
- //
- AMQFrame* frame = new AMQFrame(id, new QueueBindBody(0, q, e, key,!synch, const_cast<FieldTable&>(args)));
+ AMQFrame* frame = new AMQFrame(id, new QueueBindBody(0, q, e, key,!synch, args));
if(synch){
sendAndReceive(frame, queue_bind_ok);
}else{
diff --git a/cpp/src/qpid/framing/AMQHeaderBody.cpp b/cpp/src/qpid/framing/AMQHeaderBody.cpp
index eb360d8bc8..6bb24e67c7 100644
--- a/cpp/src/qpid/framing/AMQHeaderBody.cpp
+++ b/cpp/src/qpid/framing/AMQHeaderBody.cpp
@@ -63,11 +63,7 @@ void qpid::framing::AMQHeaderBody::print(std::ostream& out) const
{
out << "header, content_size=" << getContentSize()
<< " (" << size() << " bytes)" << ", headers=" ;
- // TODO aconway 2006-09-26: Hack to see headers.
- // Should write proper op << for BasicHeaderProperties.
- //
const BasicHeaderProperties* props =
dynamic_cast<const BasicHeaderProperties*>(getProperties());
- // TODO aconway 2006-09-26: Lose the static cast, fix BasicHeaderProperties
if (props) out << const_cast<BasicHeaderProperties*>(props)->getHeaders();
}
diff --git a/cpp/src/qpid/io/APRSocket.cpp b/cpp/src/qpid/io/APRSocket.cpp
index 80fb642c8e..824c376c3b 100644
--- a/cpp/src/qpid/io/APRSocket.cpp
+++ b/cpp/src/qpid/io/APRSocket.cpp
@@ -45,7 +45,6 @@ void APRSocket::write(qpid::framing::Buffer& buffer){
do{
bytes = buffer.available();
apr_socket_send(socket, buffer.start(), &bytes);
- // TODO aconway 2006-10-05: why don't we check status here?
buffer.move(bytes);
}while(bytes > 0);
}
diff --git a/cpp/src/qpid/io/BlockingAPRSessionContext.cpp b/cpp/src/qpid/io/BlockingAPRSessionContext.cpp
index aee223ca3b..88e6b6b0fc 100644
--- a/cpp/src/qpid/io/BlockingAPRSessionContext.cpp
+++ b/cpp/src/qpid/io/BlockingAPRSessionContext.cpp
@@ -122,8 +122,7 @@ void BlockingAPRSessionContext::write(){
int written = 0;
apr_size_t bytes = available;
while(available > written){
- apr_status_t s = apr_socket_send(socket, data + written, &bytes);
- assert(s == 0); // TODO aconway 2006-10-05: Error Handling.
+ apr_socket_send(socket, data + written, &bytes);
written += bytes;
bytes = available - written;
}