Commit 849cf2de authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner

[805] Log new servers

parent e031e1ad
......@@ -25,6 +25,7 @@ libasiodns_la_SOURCES += dns_service.cc dns_service.h
libasiodns_la_SOURCES += tcp_server.cc tcp_server.h
libasiodns_la_SOURCES += udp_server.cc udp_server.h
libasiodns_la_SOURCES += io_fetch.cc io_fetch.h
libasiodns_la_SOURCES += logger.h logger.cc
nodist_libasiodns_la_SOURCES = asiodns_messages.cc asiodns_messages.h
......
......@@ -14,6 +14,14 @@
$NAMESPACE isc::asiodns
% ASIODNS_FD_ADD_TCP adding a new TCP server by opened fd %1
A debug message informing about installing a file descriptor as a server.
The file descriptor number is noted.
% ASIODNS_FD_ADD_UDP adding a new UDP server by opened fd %1
A debug message informing about installing a file descriptor as a server.
The file descriptor number is noted.
% ASIODNS_FETCH_COMPLETED upstream fetch to %1(%2) has now completed
A debug message, this records that the upstream fetch (a query made by the
resolver on behalf of its client) to the specified address has completed.
......
......@@ -38,15 +38,13 @@
#include <dns/messagerenderer.h>
#include <dns/opcode.h>
#include <dns/rcode.h>
#include <log/logger.h>
#include <log/macros.h>
#include <asiodns/asiodns_messages.h>
#include <asiodns/io_fetch.h>
#include <util/buffer.h>
#include <util/random/qid_gen.h>
#include <asiodns/logger.h>
using namespace asio;
using namespace isc::asiolink;
......@@ -59,10 +57,6 @@ using namespace std;
namespace isc {
namespace asiodns {
/// Use the ASIO logger
isc::log::Logger logger("asiolink");
// Log debug verbosity
const int DBG_IMPORTANT = DBGLVL_TRACE_BASIC;
......
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <asiodns/logger.h>
namespace isc {
namespace asiodns {
/// Use the ASIO logger
isc::log::Logger logger("asiodns");
}
}
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <log/logger.h>
#include <log/macros.h>
#include <log/log_dbglevels.h>
#include <asiodns/asiodns_messages.h>
namespace isc {
namespace asiodns {
extern isc::log::Logger logger;
}
}
......@@ -29,8 +29,8 @@
#include <asiolink/dummy_io_cb.h>
#include <asiolink/tcp_endpoint.h>
#include <asiolink/tcp_socket.h>
#include <tcp_server.h>
#include <asiodns/tcp_server.h>
#include <asiodns/logger.h>
using namespace asio;
using asio::ip::udp;
......@@ -81,6 +81,8 @@ TCPServer::TCPServer(io_service& io_service, int fd, int af,
isc_throw(InvalidParameter, "Address family must be either AF_INET "
"or AF_INET6, not " << af);
}
logger.debug(DBGLVL_TRACE_BASIC, ASIODNS_FD_ADD_TCP, fd);
acceptor_.reset(new tcp::acceptor(io_service));
acceptor_->assign(af == AF_INET6 ? tcp::v6() : tcp::v4(), fd);
acceptor_->listen();
......
......@@ -29,6 +29,7 @@
#include <asiolink/udp_endpoint.h>
#include <asiolink/udp_socket.h>
#include "udp_server.h"
#include "logger.h"
#include <dns/opcode.h>
......@@ -84,6 +85,7 @@ struct UDPServer::Data {
isc_throw(InvalidParameter, "Address family must be either AF_INET "
"or AF_INET6, not " << af);
}
logger.debug(DBGLVL_TRACE_BASIC, ASIODNS_FD_ADD_UDP, fd);
// We must use different instantiations for v4 and v6;
// otherwise ASIO will bind to both
udp proto = af == AF_INET6 ? udp::v6() : udp::v4();
......
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