Author: gsim Date: Wed Aug 19 17:59:25 2009 New Revision: 805904 URL: http://svn.apache.org/viewvc?rev=805904&view=rev Log: QPID-2058: Add a flag to the version of SessionImpl::send() that takes a FrameSet as content. This flag indicates whether the frames in that frame set are valid for sending over the connection or whether they should be reframed.
Modified: qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.h qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp Modified: qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp?rev=805904&r1=805903&r2=805904&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp Wed Aug 19 17:59:25 2009 @@ -319,7 +319,7 @@ } -Future SessionImpl::send(const AMQBody& command, const FrameSet& content) { +Future SessionImpl::send(const AMQBody& command, const FrameSet& content, bool reframe) { Acquire a(sendLock); SequenceNumber id = nextOut++; { @@ -337,7 +337,7 @@ frame.setEof(false); handleOut(frame); - if (content.isComplete()) { + if (reframe) { MethodContentAdaptor c(content); sendContent(c); } else { Modified: qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.h?rev=805904&r1=805903&r2=805904&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.h Wed Aug 19 17:59:25 2009 @@ -86,7 +86,15 @@ Future send(const framing::AMQBody& command); Future send(const framing::AMQBody& command, const framing::MethodContent& content); - Future send(const framing::AMQBody& command, const framing::FrameSet& content); + /** + * This method takes the content as a FrameSet; if reframe=false, + * the caller is resposnible for ensuring that the header and + * content frames in that set are correct for this connection + * (right flags, right fragmentation etc). If reframe=true, then + * the header and content from the frameset will be copied and + * reframed correctly for the connection. + */ + Future send(const framing::AMQBody& command, const framing::FrameSet& content, bool reframe=false); void sendRawFrame(framing::AMQFrame& frame); Demux& getDemux(); Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp?rev=805904&r1=805903&r2=805904&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp Wed Aug 19 17:59:25 2009 @@ -213,7 +213,7 @@ framing::MessageTransferBody transfer( framing::ProtocolVersion(), UpdateClient::UPDATE, message::ACCEPT_MODE_NONE, message::ACQUIRE_MODE_PRE_ACQUIRED); - sb.get()->send(transfer, message.payload->getFrames()); + sb.get()->send(transfer, message.payload->getFrames(), !message.payload->isContentReleased()); if (message.payload->isContentReleased()){ uint16_t maxFrameSize = sb.get()->getConnection()->getNegotiatedSettings().maxFrameSize; uint16_t maxContentSize = maxFrameSize - AMQFrame::frameOverhead(); --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org