summaryrefslogtreecommitdiff
path: root/cpp/common/io/src/BlockingAPRSessionContext.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
committerAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
commit2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6 (patch)
tree886eb0659c6f28c2f1d26de7d5fd29fff0072dc5 /cpp/common/io/src/BlockingAPRSessionContext.cpp
parent9fc2b6c5f0848d65f1bf20e62279c055d12a1d40 (diff)
downloadqpid-python-2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6.tar.gz
Turned up gcc warnings, fixed warnings in code, enabled -Werror.
Note: #include "qpid_test_plugin.h" instead of <cppunit/TestPlugin.h> Works around warning from a cppunit macro. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@462834 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/common/io/src/BlockingAPRSessionContext.cpp')
-rw-r--r--cpp/common/io/src/BlockingAPRSessionContext.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/cpp/common/io/src/BlockingAPRSessionContext.cpp b/cpp/common/io/src/BlockingAPRSessionContext.cpp
index 99352c90d5..6d1dc3470c 100644
--- a/cpp/common/io/src/BlockingAPRSessionContext.cpp
+++ b/cpp/common/io/src/BlockingAPRSessionContext.cpp
@@ -15,6 +15,7 @@
* limitations under the License.
*
*/
+#include <assert.h>
#include <iostream>
#include "BlockingAPRSessionContext.h"
#include "BlockingAPRAcceptor.h"
@@ -32,10 +33,10 @@ BlockingAPRSessionContext::BlockingAPRSessionContext(apr_socket_t* _socket,
bool _debug)
: socket(_socket),
debug(_debug),
- inbuf(65536),
- outbuf(65536),
handler(0),
acceptor(_acceptor),
+ inbuf(65536),
+ outbuf(65536),
closed(false){
reader = new Reader(this);
@@ -73,9 +74,9 @@ void BlockingAPRSessionContext::read(){
inbuf.flip();
if(!initiated){
- ProtocolInitiation* init = new ProtocolInitiation();
- if(init->decode(inbuf)){
- handler->initiated(init);
+ ProtocolInitiation* protocolInit = new ProtocolInitiation();
+ if(protocolInit->decode(inbuf)){
+ handler->initiated(protocolInit);
if(debug) std::cout << "RECV: [" << &socket << "]: Initialised " << std::endl;
initiated = true;
}
@@ -122,6 +123,7 @@ void BlockingAPRSessionContext::write(){
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.
written += bytes;
bytes = available - written;
}
@@ -146,9 +148,8 @@ void BlockingAPRSessionContext::send(AMQFrame* frame){
}
}
-void BlockingAPRSessionContext::init(SessionHandler* handler){
- this->handler = handler;
- //start the threads
+void BlockingAPRSessionContext::init(SessionHandler* _handler){
+ handler = _handler;
rThread->start();
wThread->start();
}