BIND 10 trac388, updated. 354ca192db138bdd942734ff985b6e21c8445a82 [trac388] add check to avoid stop server twice
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Feb 24 01:55:40 UTC 2011
The branch, trac388 has been updated
via 354ca192db138bdd942734ff985b6e21c8445a82 (commit)
from 8f331c78a07959b413f4a00e3b3f7a935cd42b2f (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 354ca192db138bdd942734ff985b6e21c8445a82
Author: hanfeng <ben.han.cn at gmail.com>
Date: Thu Feb 24 09:53:36 2011 +0800
[trac388] add check to avoid stop server twice
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
src/lib/asiolink/tcp_server.cc | 4 ++++
src/lib/asiolink/udp_server.cc | 3 +++
3 files changed, 12 insertions(+), 0 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 6e37c66..f6a205f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+ 172. [func] feng
+ Add stop interface into dns server, so we can stop each running
+ server individually.With it, user can reconfigure its running server
+ with different ip address or port.
+
171. [func] feng, jerry, jinmei, vorner
b10-auth, src/lib/datasrc: in memory data source now works as a
complete data source for authoritative DNS servers and b10-auth
diff --git a/src/lib/asiolink/tcp_server.cc b/src/lib/asiolink/tcp_server.cc
index 6c58587..8fb8c84 100644
--- a/src/lib/asiolink/tcp_server.cc
+++ b/src/lib/asiolink/tcp_server.cc
@@ -189,6 +189,10 @@ TCPServer::asyncLookup() {
}
void TCPServer::stop() {
+ //server should not be stopped twice
+ if (stopped_by_hand_)
+ return;
+
stopped_by_hand_ = true;
acceptor_->close();
socket_->close();
diff --git a/src/lib/asiolink/udp_server.cc b/src/lib/asiolink/udp_server.cc
index 73d7785..daea014 100644
--- a/src/lib/asiolink/udp_server.cc
+++ b/src/lib/asiolink/udp_server.cc
@@ -281,6 +281,9 @@ UDPServer::asyncLookup() {
/// Stop the UDPServer
void
UDPServer::stop() {
+ //server should not be stopped twice
+ if (data_->stopped_by_hand_)
+ return;
data_->stopped_by_hand_ = true;
data_->socket_->close();
}
More information about the bind10-changes
mailing list