summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-04-17 12:21:38 +0000
committerGordon Sim <gsim@apache.org>2008-04-17 12:21:38 +0000
commit9295f8955c9ce5cb43f810da0bb7f76e3a44ac7a (patch)
treed9b0688192156cdfb120767233d5d1e6f8a1e372
parent6c182692e056a17879be543b2ec132fe56f09df2 (diff)
downloadqpid-python-9295f8955c9ce5cb43f810da0bb7f76e3a44ac7a.tar.gz
Some fixes to the transitional spec defs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@649059 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/ConnectionHandler.cpp40
-rw-r--r--qpid/cpp/src/qpid/broker/ConnectionHandler.h24
-rw-r--r--qpid/cpp/xml/extra.xml14
3 files changed, 33 insertions, 45 deletions
diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
index 315e03fb2b..0e91c081c0 100644
--- a/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
@@ -26,6 +26,7 @@
#include "qpid/framing/Connection010StartBody.h"
#include "qpid/framing/ClientInvoker.h"
#include "qpid/framing/ServerInvoker.h"
+#include "qpid/log/Statement.h"
using namespace qpid;
using namespace qpid::broker;
@@ -38,9 +39,9 @@ const std::string PLAIN = "PLAIN";
const std::string en_US = "en_US";
}
-void ConnectionHandler::close(ReplyCode code, const string& text, ClassId classId, MethodId methodId)
+void ConnectionHandler::close(ReplyCode code, const string& text, ClassId, MethodId)
{
- handler->client.close(code, text, classId, methodId);
+ handler->client.close(code, text);
}
void ConnectionHandler::handle(framing::AMQFrame& frame)
@@ -51,16 +52,16 @@ void ConnectionHandler::handle(framing::AMQFrame& frame)
if (handler->serverMode) {
handled = invoke(static_cast<AMQP_ServerOperations::Connection010Handler&>(*handler.get()), *method);
} else {
- handled = invoke(static_cast<AMQP_ClientOperations::ConnectionHandler&>(*handler.get()), *method);
+ handled = invoke(static_cast<AMQP_ClientOperations::Connection010Handler&>(*handler.get()), *method);
}
if (!handled) {
handler->connection.getChannel(frame.getChannel()).in(frame);
}
}catch(ConnectionException& e){
- handler->client.close(e.code, e.what(), method->amqpClassId(), method->amqpMethodId());
+ handler->client.close(e.code, e.what());
}catch(std::exception& e){
- handler->client.close(541/*internal error*/, e.what(), method->amqpClassId(), method->amqpMethodId());
+ handler->client.close(541/*internal error*/, e.what());
}
}
@@ -116,9 +117,11 @@ void ConnectionHandler::Handler::open(const string& /*virtualHost*/,
}
-void ConnectionHandler::Handler::close(uint16_t /*replyCode*/, const string& /*replyText*/,
- uint16_t /*classId*/, uint16_t /*methodId*/)
+void ConnectionHandler::Handler::close(uint16_t replyCode, const string& replyText)
{
+ if (replyCode != 200) {
+ QPID_LOG(warning, "Client closed connection with " << replyCode << ": " << replyText);
+ }
client.closeOk();
connection.getOutput().close();
}
@@ -128,11 +131,9 @@ void ConnectionHandler::Handler::closeOk(){
}
-void ConnectionHandler::Handler::start(uint8_t /*versionMajor*/,
- uint8_t /*versionMinor*/,
- const FieldTable& /*serverProperties*/,
- const string& /*mechanisms*/,
- const string& /*locales*/)
+void ConnectionHandler::Handler::start(const FieldTable& /*serverProperties*/,
+ const framing::Array& /*mechanisms*/,
+ const framing::Array& /*locales*/)
{
string uid = "qpidd";
string pwd = "qpidd";
@@ -147,20 +148,21 @@ void ConnectionHandler::Handler::secure(const string& /*challenge*/)
}
void ConnectionHandler::Handler::tune(uint16_t channelMax,
- uint32_t frameMax,
- uint16_t heartbeat)
+ uint16_t frameMax,
+ uint16_t /*heartbeatMin*/,
+ uint16_t heartbeatMax)
{
connection.setFrameMax(frameMax);
- connection.setHeartbeat(heartbeat);
- server.tuneOk(channelMax, frameMax, heartbeat);
- server.open("/", "", true);
+ connection.setHeartbeat(heartbeatMax);
+ server.tuneOk(channelMax, frameMax, heartbeatMax);
+ server.open("/", Array(), true);
}
-void ConnectionHandler::Handler::openOk(const string& /*knownHosts*/)
+void ConnectionHandler::Handler::openOk(const framing::Array& /*knownHosts*/)
{
}
-void ConnectionHandler::Handler::redirect(const string& /*host*/, const string& /*knownHosts*/)
+void ConnectionHandler::Handler::redirect(const string& /*host*/, const framing::Array& /*knownHosts*/)
{
}
diff --git a/qpid/cpp/src/qpid/broker/ConnectionHandler.h b/qpid/cpp/src/qpid/broker/ConnectionHandler.h
index d949d51c43..24fe8ce104 100644
--- a/qpid/cpp/src/qpid/broker/ConnectionHandler.h
+++ b/qpid/cpp/src/qpid/broker/ConnectionHandler.h
@@ -41,10 +41,10 @@ class Connection;
class ConnectionHandler : public framing::FrameHandler
{
struct Handler : public framing::AMQP_ServerOperations::Connection010Handler,
- public framing::AMQP_ClientOperations::ConnectionHandler
+ public framing::AMQP_ClientOperations::Connection010Handler
{
framing::AMQP_ClientProxy::Connection010 client;
- framing::AMQP_ServerProxy::Connection server;
+ framing::AMQP_ServerProxy::Connection010 server;
Connection& connection;
bool serverMode;
@@ -57,26 +57,24 @@ class ConnectionHandler : public framing::FrameHandler
void heartbeat() {}
void open(const std::string& virtualHost,
const framing::Array& capabilities, bool insist);
- void close(uint16_t replyCode, const std::string& replyText,
- uint16_t classId, uint16_t methodId);
+ void close(uint16_t replyCode, const std::string& replyText);
void closeOk();
- void start(uint8_t versionMajor,
- uint8_t versionMinor,
- const qpid::framing::FieldTable& serverProperties,
- const std::string& mechanisms,
- const std::string& locales);
+ void start(const qpid::framing::FieldTable& serverProperties,
+ const framing::Array& mechanisms,
+ const framing::Array& locales);
void secure(const std::string& challenge);
void tune(uint16_t channelMax,
- uint32_t frameMax,
- uint16_t heartbeat);
+ uint16_t frameMax,
+ uint16_t heartbeatMin,
+ uint16_t heartbeatMax);
- void openOk(const std::string& knownHosts);
+ void openOk(const framing::Array& knownHosts);
- void redirect(const std::string& host, const std::string& knownHosts);
+ void redirect(const std::string& host, const framing::Array& knownHosts);
};
std::auto_ptr<Handler> handler;
public:
diff --git a/qpid/cpp/xml/extra.xml b/qpid/cpp/xml/extra.xml
index f91f737c94..36a76765d5 100644
--- a/qpid/cpp/xml/extra.xml
+++ b/qpid/cpp/xml/extra.xml
@@ -356,7 +356,7 @@
<assert check="notnull" />
</field>
- <field name="known-hosts" domain="known-hosts" />
+ <field name="known-hosts" domain="array" />
</method>
<method name = "heartbeat" index="10">
@@ -391,18 +391,6 @@
<field name="reply-code" domain="reply-code" />
<field name="reply-text" domain="reply-text" />
-
- <field name="class-id" domain="class-id" label="failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the method.
- </doc>
- </field>
-
- <field name="method-id" domain="method-id" label="failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
</method>
<!-- - Method: connection.close-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->