UltraMonkey-L7 V3(multi-thread implementation)
Revisão | 9c96ee0f61e10e97d6a8a96bdaebf35afc2ed685 (tree) |
---|---|
Hora | 2013-06-13 16:29:18 |
Autor | Hiroaki Nakano <nakano.hiroaki@nttc...> |
Commiter | Hiroaki Nakano |
Merge branch 'TIME_UTC_fix' into v3.1.0-devel
@@ -3038,7 +3038,12 @@ bool l7vs::l7vsadm::execute(int argc, char *argv[]) | ||
3038 | 3038 | |
3039 | 3039 | // Lock retrying. |
3040 | 3040 | boost::xtime xt; |
3041 | +#if BOOST_VERSION >= 105000 | |
3042 | + xtime_get(&xt, boost::TIME_UTC_); | |
3043 | +#else | |
3041 | 3044 | xtime_get(&xt, boost::TIME_UTC); |
3045 | +#endif | |
3046 | + | |
3042 | 3047 | xt.sec += command_wait_interval; |
3043 | 3048 | boost::thread::sleep(xt); |
3044 | 3049 | } |
@@ -106,7 +106,12 @@ void session_thread_control::upstream_run() | ||
106 | 106 | if (state == WAIT) { // after create or session end. this thread is pooling mode |
107 | 107 | boost::mutex::scoped_lock lock(upthread_condition_mutex); |
108 | 108 | boost::xtime wait; |
109 | +#if BOOST_VERSION >= 105000 | |
110 | + boost::xtime_get(&wait, boost::TIME_UTC_); | |
111 | +#else | |
109 | 112 | boost::xtime_get(&wait, boost::TIME_UTC); |
113 | +#endif | |
114 | + | |
110 | 115 | wait.sec += 1; |
111 | 116 | upthread_running_mutex.unlock(); |
112 | 117 | upthread_condition.timed_wait(lock, wait); // thread is condition wait( start at notify_all() ) |
@@ -169,7 +174,12 @@ void session_thread_control::downstream_run() | ||
169 | 174 | boost::mutex::scoped_lock lock(downthread_condition_mutex); |
170 | 175 | // downthread_condition.wait( lock ); // thread is condition wait( start at notify_all() ) |
171 | 176 | boost::xtime wait; |
177 | +#if BOOST_VERSION >= 105000 | |
178 | + boost::xtime_get(&wait, boost::TIME_UTC_); | |
179 | +#else | |
172 | 180 | boost::xtime_get(&wait, boost::TIME_UTC); |
181 | +#endif | |
182 | + | |
173 | 183 | wait.sec += 1; |
174 | 184 | downthread_running_mutex.unlock(); |
175 | 185 | downthread_condition.timed_wait(lock, wait); // thread is condition wait( start at notify_all() ) |
@@ -822,7 +822,12 @@ void tcp_session::up_thread_run() | ||
822 | 822 | } //message alive end. |
823 | 823 | if (ssl_flag && up_thread_next_call_function.first == UP_FUNC_CLIENT_ACCEPT_EVENT) { //handshake timeout check |
824 | 824 | boost::xtime now_time; |
825 | +#if BOOST_VERSION >= 105000 | |
826 | + boost::xtime_get(&now_time, boost::TIME_UTC_); | |
827 | +#else | |
825 | 828 | boost::xtime_get(&now_time, boost::TIME_UTC); |
829 | +#endif | |
830 | + | |
826 | 831 | if ((now_time.sec - start_handshake_time.sec) > ssl_handshake_time_out) { // timeout detect. |
827 | 832 | boost::system::error_code error_code; |
828 | 833 | client_ssl_socket.close(error_code); |
@@ -1123,7 +1128,12 @@ void tcp_session::up_thread_client_accept(const TCP_PROCESS_TYPE_TAG process_typ | ||
1123 | 1128 | if (ssl_flag) { |
1124 | 1129 | upthread_status = UPTHREAD_LOCK; |
1125 | 1130 | // try ssl handshake |
1131 | +#if BOOST_VERSION >= 105000 | |
1132 | + boost::xtime_get(&start_handshake_time, boost::TIME_UTC_); | |
1133 | +#else | |
1126 | 1134 | boost::xtime_get(&start_handshake_time, boost::TIME_UTC); |
1135 | +#endif | |
1136 | + | |
1127 | 1137 | client_ssl_socket.setoption(error_code); |
1128 | 1138 | client_ssl_socket.async_handshake(boost::bind(&tcp_session::up_thread_client_handshake_handle, |
1129 | 1139 | this, |
@@ -4192,7 +4202,12 @@ void tcp_session::down_thread_sorryserver_handle_async_read_some(tcp_session::TC | ||
4192 | 4202 | //! milliseconds to boost::xtime converter |
4193 | 4203 | void tcp_session::to_time(int in, boost::xtime &xt) |
4194 | 4204 | { |
4205 | +#if BOOST_VERSION >= 105000 | |
4206 | + boost::xtime_get(&xt, boost::TIME_UTC_); | |
4207 | +#else | |
4195 | 4208 | boost::xtime_get(&xt, boost::TIME_UTC); |
4209 | +#endif | |
4210 | + | |
4196 | 4211 | xt.sec += (in / 1000); |
4197 | 4212 | xt.nsec += (in % 1000) * 1000000; |
4198 | 4213 | if (xt.nsec >= 1000000000) { |