OSDN Git Service

register_schedule呼ぶ箇所が存在しなかったバグ修正
authorokada <okada@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Sat, 14 Feb 2009 06:04:37 +0000 (06:04 +0000)
committerokada <okada@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Sat, 14 Feb 2009 06:04:37 +0000 (06:04 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-shamshel@6870 1ed66053-1c2d-0410-8867-f7571e6e31d3

include/virtualservice.h
src/virtualservice_tcp.cpp

index e7399e4..b7a68d0 100644 (file)
@@ -63,6 +63,21 @@ public:
 
        typedef boost::shared_ptr<boost::mutex>                                 mutex_ptr;
 
+       typedef std::list<l7vs::realserver>
+                                                                       rslist_type;
+       typedef boost::function< rslist_type::iterator (void)>
+                                                                       rslist_iterator_begin_func_type;
+       typedef boost::function< rslist_type::iterator (void)>
+                                                                       rslist_iterator_end_func_type;
+       typedef boost::function< rslist_type::iterator (rslist_type::iterator)>
+                                                                       rslist_iterator_next_func_type;
+       typedef boost::function< void (         const boost::thread::id,
+                                                                               rslist_iterator_begin_func_type,
+                                                                               rslist_iterator_end_func_type,
+                                                                               rslist_iterator_next_func_type,
+                                                                               boost::asio::ip::tcp::endpoint& ) >
+                                                               tcp_schedule_func_type;
+
        //!     @struct replication_header replication header structure
        struct  replication_header{
                unsigned int    data_num;
@@ -166,6 +181,15 @@ protected:
                return tmp_rep.pay_memory( inid, *outsize );
        }
 
+       void                                            schedule_rs(
+                                                                               boost::thread::id thread_id,
+                                                                               rslist_iterator_begin_func_type in_begin,
+                                                                               rslist_iterator_end_func_type in_end,
+                                                                               rslist_iterator_next_func_type in_next,
+                                                                               boost::asio::ip::tcp::endpoint& in_ep ){
+               schedmod->handle_schedule( thread_id, in_begin, in_end, in_next, in_ep );
+       }
+
 public:
        virtualservice_base(    const l7vsd&,
                                                        const replication&,
index bd7c25c..5c2d407 100644 (file)
@@ -314,6 +314,8 @@ void        l7vs::virtualservice_tcp::initialize( l7vs::error_code& err ){
                                        boost::bind( &l7vs::virtualservice_tcp::rs_list_unlock, this ),
                                        element.tcp_accept_endpoint,
                                        element.udp_recv_endpoint );
+       tcp_schedule_func_type  sched_rs_func   = boost::bind( &l7vs::virtualservice_tcp::schedule_rs, this, _1, _2, _3, _4, _5 );
+       protomod->register_schedule( sched_rs_func );
 
        l7vs::protocol_module_base::check_message_result pm_result;
        pm_result       =       protomod->check_parameter( element.protocol_args );