diff options
| author | Gordon Sim <gsim@apache.org> | 2008-03-03 14:49:06 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-03-03 14:49:06 +0000 |
| commit | b4dac41573e33e1a04a2b7b8c9a35f5e72b662bc (patch) | |
| tree | 15e25a2dc7b42f3788f9dccdd7e632dcf8c346d2 /cpp/src/qpid/sys/AsynchIOAcceptor.cpp | |
| parent | 928699508993a5ccc59254027773281883d1e973 (diff) | |
| download | qpid-python-b4dac41573e33e1a04a2b7b8c9a35f5e72b662bc.tar.gz | |
A further step to final 0-10 spec.
The extra.xml fragment adds class defs for connection in session that are in line with latest spec but use old schema.
The preview codepath (99-0) remains unaltered.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@633108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/AsynchIOAcceptor.cpp')
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIOAcceptor.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp index 0586eb9d36..c24205f53e 100644 --- a/cpp/src/qpid/sys/AsynchIOAcceptor.cpp +++ b/cpp/src/qpid/sys/AsynchIOAcceptor.cpp @@ -94,7 +94,7 @@ class AsynchIOHandler : public qpid::sys::ConnectionOutputHandler { std::queue<framing::AMQFrame> frameQueue; Mutex frameQueueLock; bool frameQueueClosed; - bool initiated; + bool isInitiated; bool readError; std::string identifier; bool isClient; @@ -105,7 +105,7 @@ class AsynchIOHandler : public qpid::sys::ConnectionOutputHandler { AsynchIOHandler() : inputHandler(0), frameQueueClosed(false), - initiated(false), + isInitiated(false), readError(false), isClient(false) {} @@ -128,6 +128,8 @@ class AsynchIOHandler : public qpid::sys::ConnectionOutputHandler { void send(framing::AMQFrame&); void close(); void activateOutput(); + void initiated(const framing::ProtocolInitiation&); + // Input side void readbuff(AsynchIO& aio, AsynchIO::BufferBase* buff); @@ -259,13 +261,18 @@ void AsynchIOHandler::activateOutput() { aio->notifyPendingWrite(); } +void AsynchIOHandler::initiated(const framing::ProtocolInitiation& pi) +{ + write(pi); +} + // Input side void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { if (readError) { return; } framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount); - if(initiated){ + if(isInitiated){ framing::AMQFrame frame; try{ while(frame.decode(in)) { @@ -282,7 +289,7 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { if(protocolInit.decode(in)){ QPID_LOG(debug, "INIT [" << identifier << "]"); inputHandler->initiated(protocolInit); - initiated = true; + isInitiated = true; } } // TODO: unreading needs to go away, and when we can cope @@ -324,10 +331,10 @@ void AsynchIOHandler::nobuffs(AsynchIO&) { } void AsynchIOHandler::idle(AsynchIO&){ - if (isClient && !initiated) { + if (isClient && !isInitiated) { //get & write protocol header from upper layers write(inputHandler->getInitiation()); - initiated = true; + isInitiated = true; return; } ScopedLock<Mutex> l(frameQueueLock); |
