Browse Source

[1924] (minor) Style cleanups

* Spaces
* Remove commented-out code
* Use full relative path to header
Michal 'vorner' Vaner 12 years ago
parent
commit
10166e33f1
3 changed files with 9 additions and 11 deletions
  1. 2 3
      src/lib/cc/session.cc
  2. 4 5
      src/lib/cc/tests/session_unittests.cc
  3. 3 3
      src/lib/python/isc/cc/session.py

+ 2 - 3
src/lib/cc/session.cc

@@ -479,14 +479,13 @@ Session::group_sendmsg(ConstElementPtr msg, std::string group,
         arg(group);
     ElementPtr env = Element::createMap();
     long int nseq = ++impl_->sequence_;
-    
+
     env->set("type", Element::create("send"));
     env->set("from", Element::create(impl_->lname_));
     env->set("to", Element::create(to));
     env->set("group", Element::create(group));
     env->set("instance", Element::create(instance));
     env->set("seq", Element::create(nseq));
-    //env->set("msg", Element::create(msg->toWire()));
 
     sendmsg(env, msg);
     return (nseq);
@@ -513,7 +512,7 @@ Session::reply(ConstElementPtr envelope, ConstElementPtr newmsg) {
         arg(newmsg->str());
     ElementPtr env = Element::createMap();
     long int nseq = ++impl_->sequence_;
-    
+
     env->set("type", Element::create("send"));
     env->set("from", Element::create(impl_->lname_));
     env->set("to", Element::create(envelope->get("from")->stringValue()));

+ 4 - 5
src/lib/cc/tests/session_unittests.cc

@@ -26,7 +26,7 @@
 
 #include <cc/session.h>
 #include <cc/data.h>
-#include <session_unittests_config.h>
+#include <cc/tests/session_unittests_config.h>
 
 using namespace isc::cc;
 
@@ -50,7 +50,6 @@ TEST(AsioSession, establish) {
                        "/aaaaaaaaaa/aaaaaaaaaa/aaaaaaaaaa/aaaaaaaaaa/"
                   ), isc::cc::SessionError
     );
-                  
 }
 
 // This class sets up a domain socket for the session to connect to
@@ -70,7 +69,7 @@ public:
                                boost::bind(&TestDomainSocket::acceptHandler,
                                            this, _1));
     }
-    
+
     ~TestDomainSocket() {
         socket_.close();
         unlink(BIND10_TEST_SOCKET_FILE);
@@ -89,7 +88,7 @@ public:
         const unsigned int length_net = htonl(length);
         const unsigned short header_length = header_wire.length();
         const unsigned short header_length_net = htons(header_length);
-    
+
         socket_.send(asio::buffer(&length_net, sizeof(length_net)));
         socket_.send(asio::buffer(&header_length_net,
                                   sizeof(header_length_net)));
@@ -112,7 +111,7 @@ public:
         asio::async_read(socket_,  asio::buffer(data_buf, 0),
                          boost::bind(&TestDomainSocket::sendLname, this));
     }
-    
+
 private:
     asio::io_service& io_service_;
     asio::local::stream_protocol::endpoint ep_;

+ 3 - 3
src/lib/python/isc/cc/session.py

@@ -30,7 +30,7 @@ class SessionTimeout(Exception): pass
 
 class Session:
     MSGQ_DEFAULT_TIMEOUT = 4000
-    
+
     def __init__(self, socket_file=None):
         self._socket = None
         self._lname = None
@@ -159,7 +159,7 @@ class Session:
         if len(data) == 0: # server closed connection
             raise ProtocolError("Read of 0 bytes: connection closed")
         return data
-        
+
     def _receive_len_data(self):
         """Reads self._recv_len_size bytes of data from the socket into
            self._recv_len_data
@@ -203,7 +203,7 @@ class Session:
             # they may never both be non-zero (we are either starting
             # a full read, or continuing one of the reads
             assert self._recv_size == 0 or self._recv_len_size == 0
-            
+
             if self._recv_size == 0:
                 if self._recv_len_size == 0:
                     # both zero, start a new full read