BIND 10 trac805, updated. bb00c59b03275b564938cbbb32956639bf76e5e8 [805] some trivial cleanups: typo, constify, string=>char* conversion (based on the seeming intent), indentation.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Dec 30 22:43:30 UTC 2011
The branch, trac805 has been updated
via bb00c59b03275b564938cbbb32956639bf76e5e8 (commit)
from ad4b9819be1af780f17018d82097dedd6965c19d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bb00c59b03275b564938cbbb32956639bf76e5e8
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Fri Dec 30 14:42:15 2011 -0800
[805] some trivial cleanups: typo, constify, string=>char* conversion
(based on the seeming intent), indentation.
-----------------------------------------------------------------------
Summary of changes:
src/lib/asiodns/tcp_server.h | 3 ++-
src/lib/asiodns/tests/dns_server_unittest.cc | 26 ++++++++++++++------------
src/lib/asiodns/udp_server.cc | 7 ++++---
src/lib/asiodns/udp_server.h | 5 +++--
4 files changed, 23 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/asiodns/tcp_server.h b/src/lib/asiodns/tcp_server.h
index 71cd5ba..c7fac87 100644
--- a/src/lib/asiodns/tcp_server.h
+++ b/src/lib/asiodns/tcp_server.h
@@ -42,9 +42,10 @@ public:
const isc::asiolink::SimpleCallback* checkin = NULL,
const DNSLookup* lookup = NULL,
const DNSAnswer* answer = NULL);
+
/// \brief Constructor
/// \param io_service the asio::io_service to work with
- /// \param fd the file descriptor of opened UDP socket
+ /// \param fd the file descriptor of opened TCP socket
/// \param v6 the socket in fd is ipv6 one (if false, it is ipv4)
/// \param checkin the callbackprovider for non-DNS events
/// \param lookup the callbackprovider for DNS lookup events
diff --git a/src/lib/asiodns/tests/dns_server_unittest.cc b/src/lib/asiodns/tests/dns_server_unittest.cc
index 92b5f02..e67f4a2 100644
--- a/src/lib/asiodns/tests/dns_server_unittest.cc
+++ b/src/lib/asiodns/tests/dns_server_unittest.cc
@@ -74,12 +74,12 @@ using namespace isc::asiodns;
using namespace asio;
namespace {
-const char* server_ip = "::1";
+const char* const server_ip = "::1";
const int server_port = 5553;
-const char* server_port_str = "5553";
+const char* const server_port_str = "5553";
//message client send to udp server, which isn't dns package
//just for simple testing
-const std::string query_message("BIND10 is awesome");
+const char* const query_message = "BIND10 is awesome";
// \brief provide capacity to derived class the ability
// to stop DNSServer at certern point
@@ -205,7 +205,7 @@ class SimpleClient : public ServerStopper {
class UDPClient : public SimpleClient {
public:
- //After 1 seconds without feedback client will stop wait
+ //After 1 second without feedback client will stop wait
static const unsigned int server_time_out = 1;
UDPClient(asio::io_service& service, const ip::udp::endpoint& server) :
@@ -310,12 +310,14 @@ class TCPClient : public SimpleClient {
uint16_t data_to_send_len_;
};
-// \brief provide the context which including two client and
-// two server, udp client will only communicate with udp server, same for tcp client
+// \brief provide the context which including two clients and
+// two servers, UDP client will only communicate with UDP server, same for TCP
+// client
//
-// This is only the active part of the test. We run the test case twice, once for each
-// type of initialization (once when giving it the address and port, once when giving
-// the file descriptor), to ensure it works both ways exactly the same.
+// This is only the active part of the test. We run the test case twice, once
+// for each type of initialization (once when giving it the address and port,
+// once when giving the file descriptor), to ensure it works both ways exactly
+// the same.
class DNSServerTestBase : public::testing::Test {
protected:
void TearDown() {
@@ -338,9 +340,9 @@ class DNSServerTestBase : public::testing::Test {
stopper->setServerToStop(server);
(*server)();
client->sendDataThenWaitForFeedback(query_message);
- // Since thread hasn't been introduced into the tool box, using signal
- // to make sure run function will eventually return even server stop
- // failed
+ // Since thread hasn't been introduced into the tool box, using
+ // signal to make sure run function will eventually return even
+ // server stop failed
void (*prev_handler)(int) =
std::signal(SIGALRM, DNSServerTestBase::stopIOService);
alarm(io_service_time_out);
diff --git a/src/lib/asiodns/udp_server.cc b/src/lib/asiodns/udp_server.cc
index a47e699..176853d 100644
--- a/src/lib/asiodns/udp_server.cc
+++ b/src/lib/asiodns/udp_server.cc
@@ -174,13 +174,14 @@ struct UDPServer::Data {
/// The constructor. It just creates new internal state object
/// and lets it handle the initialization.
UDPServer::UDPServer(io_service& io_service, const ip::address& addr,
- const uint16_t port, SimpleCallback* checkin, DNSLookup* lookup,
- DNSAnswer* answer) :
+ const uint16_t port, SimpleCallback* checkin,
+ DNSLookup* lookup, DNSAnswer* answer) :
data_(new Data(io_service, addr, port, checkin, lookup, answer))
{ }
UDPServer::UDPServer(io_service& io_service, int fd, bool v6,
- SimpleCallback* checkin, DNSLookup* lookup, DNSAnswer* answer) :
+ SimpleCallback* checkin, DNSLookup* lookup,
+ DNSAnswer* answer) :
data_(new Data(io_service, fd, v6, checkin, lookup, answer))
{ }
diff --git a/src/lib/asiodns/udp_server.h b/src/lib/asiodns/udp_server.h
index 2d564fc..f5a9b85 100644
--- a/src/lib/asiodns/udp_server.h
+++ b/src/lib/asiodns/udp_server.h
@@ -51,6 +51,7 @@ public:
isc::asiolink::SimpleCallback* checkin = NULL,
DNSLookup* lookup = NULL,
DNSAnswer* answer = NULL);
+
/// \brief Constructor
/// \param io_service the asio::io_service to work with
/// \param fd the file descriptor of opened UDP socket
@@ -59,8 +60,8 @@ public:
/// \param lookup the callbackprovider for DNS lookup events
/// \param answer the callbackprovider for DNS answer events
UDPServer(asio::io_service& io_service, int fd, bool v6,
- isc::asiolink::SimpleCallback* checkin = NULL,
- DNSLookup* lookup = NULL, DNSAnswer* answer = NULL);
+ isc::asiolink::SimpleCallback* checkin = NULL,
+ DNSLookup* lookup = NULL, DNSAnswer* answer = NULL);
/// \brief The function operator
void operator()(asio::error_code ec = asio::error_code(),
More information about the bind10-changes
mailing list