BIND 10 trac678, updated. a32e082284a9afc697ac57ce02f76023d9402d1c [trac678] merge code from ticket 657

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Mar 15 13:08:24 UTC 2011


The branch, trac678 has been updated
       via  a32e082284a9afc697ac57ce02f76023d9402d1c (commit)
      from  d48aaf1aba81578c0e91609d97f83b83df93435e (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 a32e082284a9afc697ac57ce02f76023d9402d1c
Author: hanfeng <ben.han.cn at gmail.com>
Date:   Tue Mar 15 21:07:35 2011 +0800

    [trac678] merge code from ticket 657

-----------------------------------------------------------------------

Summary of changes:
 src/lib/asiolink/tcp_server.cc |   16 ++++++++++++----
 src/lib/asiolink/udp_server.cc |   13 +++++++++----
 2 files changed, 21 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/asiolink/tcp_server.cc b/src/lib/asiolink/tcp_server.cc
index 14d4eb4..f8c7808 100644
--- a/src/lib/asiolink/tcp_server.cc
+++ b/src/lib/asiolink/tcp_server.cc
@@ -81,10 +81,18 @@ TCPServer::operator()(error_code ec, size_t length) {
             /// try again
             do {
                 CORO_YIELD acceptor_->async_accept(*socket_, *this);
-                /// If user stop the server which will close the acceptor
-                /// we just return
-                if (ec == asio::error::bad_descriptor)
-                    CORO_YIELD return;
+
+                // return if we meet fatal error
+                // Todo add log
+                if (ec) {
+                    using namespace asio::error;
+                    if (ec.value() != would_block && ec.value() != try_again &&
+                            ec.value() != connection_aborted &&
+                            ec.value() != interrupted) {
+                        return;
+                    }
+                }
+
 
             } while (ec);
 
diff --git a/src/lib/asiolink/udp_server.cc b/src/lib/asiolink/udp_server.cc
index 35e65d0..77ba1d4 100644
--- a/src/lib/asiolink/udp_server.cc
+++ b/src/lib/asiolink/udp_server.cc
@@ -188,10 +188,15 @@ UDPServer::operator()(error_code ec, size_t length) {
                     buffer(data_->data_.get(), MAX_LENGTH), *data_->sender_,
                     *this);
 
-                // If the server is stopped which will close the socket, 
-                // we just return
-                if (ec == asio::error::bad_descriptor)
-                    CORO_YIELD return;
+                //return if we met fatal error
+                //Todo add log
+                if (ec) {
+                    using namespace asio::error;
+                    if (ec.value() != would_block && ec.value() != try_again &&
+                            ec.value() != interrupted) {
+                        return;
+                    }
+                }
 
             } while (ec || length == 0);
 




More information about the bind10-changes mailing list