Browse Source

[trac1034] Modify message IDs to words separated by underscores

Stephen Morris 14 years ago
parent
commit
999736efa5
2 changed files with 17 additions and 17 deletions
  1. 7 7
      src/lib/asiodns/asiodns_messages.mes
  2. 10 10
      src/lib/asiodns/io_fetch.cc

+ 7 - 7
src/lib/asiodns/asiodns_messages.mes

@@ -14,32 +14,32 @@
 
 
 $NAMESPACE isc::asiodns
 $NAMESPACE isc::asiodns
 
 
-% ASIODNS_FETCHCOMP   upstream fetch to %1(%2) has now completed
+% 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
 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.
 resolver on behalf of its client) to the specified address has completed.
 
 
-% ASIODNS_FETCHSTOP   upstream fetch to %1(%2) has been stopped
+% ASIODNS_FETCH_STOPPED   upstream fetch to %1(%2) has been stopped
 An external component has requested the halting of an upstream fetch.  This
 An external component has requested the halting of an upstream fetch.  This
 is an allowed operation, and the message should only appear if debug is
 is an allowed operation, and the message should only appear if debug is
 enabled.
 enabled.
 
 
-% ASIODNS_OPENSOCK    error %1 opening %2 socket to %3(%4)
+% ASIODNS_OPEN_SOCKET    error %1 opening %2 socket to %3(%4)
 The asynchronous I/O code encountered an error when trying to open a socket
 The asynchronous I/O code encountered an error when trying to open a socket
 of the specified protocol in order to send a message to the target address.
 of the specified protocol in order to send a message to the target address.
 The number of the system error that cause the problem is given in the
 The number of the system error that cause the problem is given in the
 message.
 message.
 
 
-% ASIODNS_RECVSOCK    error %1 reading %2 data from %3(%4)
+% ASIODNS_READ_DATA    error %1 reading %2 data from %3(%4)
 The asynchronous I/O code encountered an error when trying to read data from
 The asynchronous I/O code encountered an error when trying to read data from
 the specified address on the given protocol.  The number of the system
 the specified address on the given protocol.  The number of the system
 error that cause the problem is given in the message.
 error that cause the problem is given in the message.
 
 
-% ASIODNS_SENDSOCK    error %1 sending data using %2 to %3(%4)
+% ASIODNS_SEND_DATA    error %1 sending data using %2 to %3(%4)
 The asynchronous I/O code encountered an error when trying send data to
 The asynchronous I/O code encountered an error when trying send data to
 the specified address on the given protocol.  The the number of the system
 the specified address on the given protocol.  The the number of the system
 error that cause the problem is given in the message.
 error that cause the problem is given in the message.
 
 
-% ASIODNS_RECVTMO     receive timeout while waiting for data from %1(%2)
+% ASIODNS_READ_TIMEOUT     receive timeout while waiting for data from %1(%2)
 An upstream fetch from the specified address timed out.  This may happen for
 An upstream fetch from the specified address timed out.  This may happen for
 any number of reasons and is most probably a problem at the remote server
 any number of reasons and is most probably a problem at the remote server
 or a problem on the network.  The message will only appear if debug is
 or a problem on the network.  The message will only appear if debug is
@@ -49,7 +49,7 @@ enabled.
 This message should not appear and indicates an internal error if it does.
 This message should not appear and indicates an internal error if it does.
 Please enter a bug report.
 Please enter a bug report.
 
 
-% ASIODNS_UNKRESULT  unknown result (%1) when IOFetch::stop() was executed for I/O to %2(%3)
+% ASIODNS_UNKNOWN_RESULT  unknown result (%1) when IOFetch::stop() was executed for I/O to %2(%3)
 The termination method of the resolver's upstream fetch class was called with
 The termination method of the resolver's upstream fetch class was called with
 an unknown result code (which is given in the message).  This message should
 an unknown result code (which is given in the message).  This message should
 not appear and may indicate an internal error.  Please enter a bug report.
 not appear and may indicate an internal error.  Please enter a bug report.

+ 10 - 10
src/lib/asiodns/io_fetch.cc

@@ -280,7 +280,7 @@ IOFetch::operator()(asio::error_code ec, size_t length) {
 
 
         // Open a connection to the target system.  For speed, if the operation
         // Open a connection to the target system.  For speed, if the operation
         // is synchronous (i.e. UDP operation) we bypass the yield.
         // is synchronous (i.e. UDP operation) we bypass the yield.
-        data_->origin = ASIODNS_OPENSOCK;
+        data_->origin = ASIODNS_OPEN_SOCKET;
         if (data_->socket->isOpenSynchronous()) {
         if (data_->socket->isOpenSynchronous()) {
             data_->socket->open(data_->remote_snd.get(), *this);
             data_->socket->open(data_->remote_snd.get(), *this);
         } else {
         } else {
@@ -290,7 +290,7 @@ IOFetch::operator()(asio::error_code ec, size_t length) {
         do {
         do {
             // Begin an asynchronous send, and then yield.  When the send completes,
             // Begin an asynchronous send, and then yield.  When the send completes,
             // we will resume immediately after this point.
             // we will resume immediately after this point.
-            data_->origin = ASIODNS_SENDSOCK;
+            data_->origin = ASIODNS_SEND_DATA;
             CORO_YIELD data_->socket->asyncSend(data_->msgbuf->getData(),
             CORO_YIELD data_->socket->asyncSend(data_->msgbuf->getData(),
                 data_->msgbuf->getLength(), data_->remote_snd.get(), *this);
                 data_->msgbuf->getLength(), data_->remote_snd.get(), *this);
     
     
@@ -313,7 +313,7 @@ IOFetch::operator()(asio::error_code ec, size_t length) {
             // received all the data before copying it back to the user's buffer.
             // received all the data before copying it back to the user's buffer.
             // And we want to minimise the amount of copying...
             // And we want to minimise the amount of copying...
     
     
-            data_->origin = ASIODNS_RECVSOCK;
+            data_->origin = ASIODNS_READ_DATA;
             data_->cumulative = 0;          // No data yet received
             data_->cumulative = 0;          // No data yet received
             data_->offset = 0;              // First data into start of buffer
             data_->offset = 0;              // First data into start of buffer
             data_->received->clear();       // Clear the receive buffer
             data_->received->clear();       // Clear the receive buffer
@@ -367,13 +367,13 @@ IOFetch::stop(Result result) {
         data_->stopped = true;
         data_->stopped = true;
         switch (result) {
         switch (result) {
             case TIME_OUT:
             case TIME_OUT:
-                LOG_DEBUG(logger, DBG_COMMON, ASIODNS_RECVTMO).
+                LOG_DEBUG(logger, DBG_COMMON, ASIODNS_READ_TIMEOUT).
                     arg(data_->remote_snd->getAddress().toText()).
                     arg(data_->remote_snd->getAddress().toText()).
                     arg(data_->remote_snd->getPort());
                     arg(data_->remote_snd->getPort());
                 break;
                 break;
 
 
             case SUCCESS:
             case SUCCESS:
-                LOG_DEBUG(logger, DBG_ALL, ASIODNS_FETCHCOMP).
+                LOG_DEBUG(logger, DBG_ALL, ASIODNS_FETCH_COMPLETED).
                     arg(data_->remote_rcv->getAddress().toText()).
                     arg(data_->remote_rcv->getAddress().toText()).
                     arg(data_->remote_rcv->getPort());
                     arg(data_->remote_rcv->getPort());
                 break;
                 break;
@@ -382,13 +382,13 @@ IOFetch::stop(Result result) {
                 // Fetch has been stopped for some other reason.  This is
                 // Fetch has been stopped for some other reason.  This is
                 // allowed but as it is unusual it is logged, but with a lower
                 // allowed but as it is unusual it is logged, but with a lower
                 // debug level than a timeout (which is totally normal).
                 // debug level than a timeout (which is totally normal).
-                LOG_DEBUG(logger, DBG_IMPORTANT, ASIODNS_FETCHSTOP).
+                LOG_DEBUG(logger, DBG_IMPORTANT, ASIODNS_FETCH_STOPPED).
                     arg(data_->remote_snd->getAddress().toText()).
                     arg(data_->remote_snd->getAddress().toText()).
                     arg(data_->remote_snd->getPort());
                     arg(data_->remote_snd->getPort());
                 break;
                 break;
 
 
             default:
             default:
-                LOG_ERROR(logger, ASIODNS_UNKRESULT).
+                LOG_ERROR(logger, ASIODNS_UNKNOWN_RESULT).
                     arg(data_->remote_snd->getAddress().toText()).
                     arg(data_->remote_snd->getAddress().toText()).
                     arg(data_->remote_snd->getPort());
                     arg(data_->remote_snd->getPort());
         }
         }
@@ -412,9 +412,9 @@ IOFetch::stop(Result result) {
 void IOFetch::logIOFailure(asio::error_code ec) {
 void IOFetch::logIOFailure(asio::error_code ec) {
 
 
     // Should only get here with a known error code.
     // Should only get here with a known error code.
-    assert((data_->origin == ASIODNS_OPENSOCK) ||
-           (data_->origin == ASIODNS_SENDSOCK) ||
-           (data_->origin == ASIODNS_RECVSOCK) ||
+    assert((data_->origin == ASIODNS_OPEN_SOCKET) ||
+           (data_->origin == ASIODNS_SEND_DATA) ||
+           (data_->origin == ASIODNS_READ_DATA) ||
            (data_->origin == ASIODNS_UNKORIGIN));
            (data_->origin == ASIODNS_UNKORIGIN));
 
 
     static const char* PROTOCOL[2] = {"TCP", "UDP"};
     static const char* PROTOCOL[2] = {"TCP", "UDP"};