+[Sep. 11 2014] 3.1.2-1 HIBARI Michiro, Hiroaki Nakano
+ - Fixed degraded bug: re-patch for fixed #30300.
+
[Mar. 9 2014] 3.1.1-1 HIBARI Michiro, Hiroaki Nakano
- #33102 fix memory leak.
- #33255 fix accessing endpoint at deleted realserver.
AC_PREREQ(2.59)
AC_INIT(l7vsd, 3.1.1, ultramonkey-l7-develop@lists.sourceforge.jp)
PACKAGENAME=l7vsd
-VERSION=3.1.1
+VERSION=3.1.2
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
virtual void down_thread_sorryserver_async_read_some_handler(const boost::system::error_code &error_code, std::size_t len);
virtual void down_thread_sorryserver_handle_async_read_some(const TCP_PROCESS_TYPE_TAG);
virtual void up_thread_client_ssl_socket_clear_socket_handler();
+ virtual void up_thread_client_disconnect_handler(const boost::system::error_code &error_code);
//! down thread receive from realserver and raise module event of handle_realserver_recv
//! @param[in] process_type is process type
public:
// typedef
typedef boost::function< void (const boost::system::error_code &) > async_handshake_handler_t;
+ typedef boost::function< void (const boost::system::error_code &) > async_shutdown_handler_t;
// constructor
tcp_ssl_socket(
return error_code ? false : true;
}
+ virtual void async_shutdown(async_handshake_handler_t handler) {
+ boost::mutex::scoped_lock lock(ssl_mutex);
+ boost::system::error_code error_code;
+ shutdown_con++;
+ my_socket->lowest_layer().cancel(error_code);
+ my_socket->async_shutdown(ssl_strand.wrap(handler));
+ }
+
virtual std::size_t read_some(const boost::asio::mutable_buffers_1 &buffers, boost::system::error_code &error_code) {
boost::mutex::scoped_lock lock(ssl_mutex);
if (write_con > 0 || handshake_con > 0) {
return write_con;
}
+ void decrement_shutdown_con() {
+ boost::mutex::scoped_lock lock(ssl_mutex);
+ shutdown_con--;
+ ssl_cond.notify_one();
+ }
+
+ int get_shutdown_con() {
+ return shutdown_con;
+ }
+
void wait_async_event_all_end() {
boost::mutex::scoped_lock lock(ssl_mutex);
- while (handshake_con > 0 || read_con > 0 || write_con > 0) {
+ while (handshake_con > 0 || read_con > 0 || write_con > 0 || shutdown_con > 0) {
boost::format fmt("handshake_con : %d read_con = %d write_con = %d ");
fmt % handshake_con % read_con % write_con ;
Logger::putLogInfo(LOG_CAT_L7VSD_SESSION, 999, fmt.str(), __FILE__, __LINE__);
int handshake_con;
int read_con;
int write_con;
+ int shutdown_con;
virtual void set_quickack(boost::system::error_code &error_code) {
int err = ::setsockopt(my_socket->lowest_layer().native(), IPPROTO_TCP, TCP_QUICKACK, &opt_info.quickack_val, sizeof(opt_info.quickack_val));
buffer_element.first += sendbuffer_rest_size;
buffer_element.second -= sendbuffer_rest_size;
sendbuffer_rest_size = 0;
+
+ //add remain item
+ data_ptr->buffer_sequence.push_back(buffer_element);
+ //delete the item
+ data_ptr->buffer_sequence.pop_front();
break;
}
}
boost::asio::placeholders::error));
} else {
#if BOOST_VERSION >= 105000
- boost::xtime_get(&start_handshake_time, boost::TIME_UTC_);
+ boost::xtime_get(&client_connected_time, boost::TIME_UTC_);
#else
- boost::xtime_get(&start_handshake_time, boost::TIME_UTC);
+ boost::xtime_get(&client_connected_time, boost::TIME_UTC);
#endif
upthread_status = UPTHREAD_ACTIVE;
}
fmt % boost::this_thread::get_id() % ec.message();
Logger::putLogInfo(LOG_CAT_L7VSD_SESSION, 999, fmt.str(), __FILE__, __LINE__);
#endif
- func_tag = UP_FUNC_CLIENT_DISCONNECT;
+ upthread_status = UPTHREAD_LOCK;
+ tcp_ssl_socket::async_shutdown_handler_t handler;
+ handler = boost::bind(&tcp_session::up_thread_client_disconnect_handler, this, boost::asio::placeholders::error);
+ client_ssl_socket.async_shutdown(handler);
+ up_thread_next_call_function = up_thread_function_array[UP_FUNC_CLIENT_DISCONNECT_EVENT];
+ return;
} else if (ec == boost::asio::error::eof) {
#ifdef DEBUG
boost::format fmt("Thread ID[%d] ssl_shutdown fail: %s");
downthread_status_cond.notify_one();
}
+void tcp_session::up_thread_client_disconnect_handler(const boost::system::error_code &error_code)
+{
+ if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_SESSION))) {
+ boost::format fmt("Thread ID[%d] FUNC IN up_thread_client_disconnect_handler");
+ fmt % boost::this_thread::get_id();
+ Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, fmt.str(), __FILE__, __LINE__);
+ }
+
+ client_ssl_socket.decrement_shutdown_con();
+
+ tcp_thread_message *up_msg = new tcp_thread_message();
+ if (error_code == boost::asio::error::try_again) {
+ tcp_ssl_socket::async_shutdown_handler_t handler;
+ handler = boost::bind(&tcp_session::up_thread_client_disconnect_handler, this, boost::asio::placeholders::error);
+ client_ssl_socket.async_shutdown(handler);
+ up_thread_next_call_function = up_thread_function_array[UP_FUNC_CLIENT_DISCONNECT_EVENT];
+ return;
+ } else {
+ up_msg->message = up_que_function_map[UP_FUNC_CLIENT_DISCONNECT_EVENT];
+ while (!up_thread_message_que.push(up_msg)) {}
+ }
+
+ upthread_status_cond.notify_one();
+
+ if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_SESSION))) {
+ boost::format fmt("Thread ID[%d] FUNC OUT up_thread_client_disconnect_handler");
+ fmt % boost::this_thread::get_id() ;
+ Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, fmt.str(), __FILE__, __LINE__);
+ }
+}
+
void tcp_session::up_thread_client_ssl_socket_clear_socket_handler()
{
if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_SESSION))) {
Summary: The Layer-7 Virtual Server
Name: ultramonkeyl7
-Version: 3.1.1
+Version: 3.1.2
Release: 1%{?dist}
License: LGPLv2.1
Group: System Environment/Daemons
%{moduledevel_tempdir}/*
%changelog
+* Wed Sep 11 2014 Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp> 3.1.2-1
+- Update for 3.1.2-1
+- Marge from 3.1.2-devel to master. And modefy version.
+- Fixed degraded bug: re-patch for fixed ticket 30300.
+
* Fri Mar 7 2014 Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp> 3.1.1-1
- Update for 3.1.1-1
- Marge from 3.1.1-devel to master. And modefy version.