]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add mon_caps used for unconnected monitor messages
authorGreg Farnum <gregf@hq.newdream.net>
Mon, 22 Mar 2010 22:23:19 +0000 (15:23 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Tue, 23 Mar 2010 18:41:52 +0000 (11:41 -0700)
src/mon/Monitor.cc
src/mon/Monitor.h

index d862a238df44771446e6b1ebf58625f53577489e..ad7b124a11d3c8dcd76039c94088b3db2a118161 100644 (file)
@@ -104,6 +104,9 @@ Monitor::Monitor(int w, MonitorStore *s, Messenger *m, MonMap *map) :
   paxos_service[PAXOS_LOG] = new LogMonitor(this, add_paxos(PAXOS_LOG));
   paxos_service[PAXOS_CLASS] = new ClassMonitor(this, add_paxos(PAXOS_CLASS));
   paxos_service[PAXOS_AUTH] = new AuthMonitor(this, add_paxos(PAXOS_AUTH));
+
+  mon_caps = new MonCaps();
+  mon_caps->set_allow_all(true);
 }
 
 Paxos *Monitor::add_paxos(int type)
@@ -132,7 +135,7 @@ Monitor::~Monitor()
   while (!session_map.sessions.empty()) {
     session_map.remove_session(session_map.sessions.front());
   }
-
+  delete mon_caps;
 }
 
 void Monitor::init()
@@ -740,6 +743,8 @@ void Monitor::fill_caps(Message *m)
       msg->caps = &s->caps;
       s->put();
     }
+  } else { //it has to be a monitor if the Connection's not set
+    msg->caps = mon_caps;
   }
 }
 
index c8b2f03cecd477ac273303f95aa9eef646bb5503..6c9c0f260bed5a0f69b8bf57ea111ed86aa91802 100644 (file)
@@ -218,6 +218,8 @@ public:
   }
   //fill in caps field if possible
   void fill_caps(Message *m);
+  //mon_caps is used for un-connected messages from monitors
+  MonCaps * mon_caps;
   bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);
   bool ms_verify_authorizer(Connection *con, int peer_type,
                            int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply,