Commit a53adb0b authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1539] some documentation update

parent 0e000599
......@@ -112,7 +112,20 @@ private:
MessageRenderer& renderer_;
};
/// TBD document it.
// A helper container of socket session forwarder.
//
// This class provides a simple wrapper interface to SocketSessionForwarder
// so that the caller doesn't have to worry about exception handling or
// parameter building.
//
// It internally maintains whether the underlying forwarder establishes a
// connection to the receiver. Its connect() wrapper tries connection
// setup only when necessary, so the caller can just always call connect().
// It also closes the connection on destruction, when necessary, automatically.
//
// Its push() wrapper takes the session data to be forwarded in the form of
// IOMessage object, and converts it to the parameters that the underlying
// SocketSessionForwarder expects.
class SocketSessionForwarderHolder {
public:
SocketSessionForwarderHolder(BaseSocketSessionForwarder& forwarder) :
......@@ -211,9 +224,7 @@ public:
bool processNotify(const IOMessage& io_message, Message& message,
OutputBuffer& buffer,
auto_ptr<TSIGContext> tsig_context);
bool processUpdate(const IOMessage& io_message, Message& message,
OutputBuffer& buffer,
auto_ptr<TSIGContext> tsig_context);
bool processUpdate(const IOMessage& io_message);
IOService io_service_;
......@@ -275,6 +286,7 @@ private:
bool xfrout_connected_;
AbstractXfroutClient& xfrout_client_;
// Socket session forwarder for dynamic update requests
SocketSessionForwarderHolder ddns_forwarder_;
/// Increment query counter
......@@ -617,8 +629,7 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
send_answer = impl_->processNotify(io_message, message, buffer,
tsig_context);
} else if (opcode == Opcode::UPDATE()) {
send_answer = impl_->processUpdate(io_message, message, buffer,
tsig_context);
send_answer = impl_->processUpdate(io_message);
} else if (opcode != Opcode::QUERY()) {
LOG_DEBUG(auth_logger, DBG_AUTH_DETAIL, AUTH_UNSUPPORTED_OPCODE)
.arg(message.getOpcode().toText());
......@@ -836,11 +847,7 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
}
bool
AuthSrvImpl::processUpdate(const IOMessage& io_message,
Message& /*message*/,
OutputBuffer& /*buffer*/,
std::auto_ptr<TSIGContext> /*tsig_context*/)
{
AuthSrvImpl::processUpdate(const IOMessage& io_message) {
try {
ddns_forwarder_.connect();
ddns_forwarder_.push(io_message);
......
......@@ -19,8 +19,6 @@
#include <exceptions/exceptions.h>
#include <util/io/socketsession.h>
#include <cc/data.h>
#include <cc/session.h>
......@@ -31,8 +29,6 @@
#include <utility>
#include <vector>
#include <sys/socket.h>
namespace isc {
namespace testutils {
......
......@@ -31,7 +31,11 @@ namespace isc {
namespace util {
namespace unittests {
// Mock socket session forwarder
/// \brief Mock socket session forwarder.
///
/// It emulates the behavior of SocketSessionForwarder without involving
/// network communication, and allowing the tester to customize the behavior
/// and to examine forwarded data afterwards.
class MockSocketSessionForwarder :
public isc::util::io::BaseSocketSessionForwarder
{
......@@ -101,7 +105,6 @@ public:
void disableConnect() { connect_ok_ = false; }
void enableConnect() { connect_ok_ = true; }
void disableClose() { close_ok_ = false; }
void enableClose() { close_ok_ = true; }
void disablePush() { push_ok_ = false; }
void enablePush() { push_ok_ = true; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment