-//
-// @file http_protocol_module_base.cpp
-// @brief shared object http protocol module absctract class
-//
-// Distributed under the Boost Software License, Version 1.0.(See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
-//
+/*
+ * @file http_protocol_module_base.cpp
+ * @brief shared object protocol module abstract class
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009 NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
#include <boost/xpressive/xpressive.hpp>
#include "http_protocol_module_base.h"
range('1', '3') >> repeat<2>(_d) >> _s >>
*_;
+cregex method_and_version_regex
+ = ( as_xpr("GET") | as_xpr("HEAD") | as_xpr("POST") |
+ as_xpr("PUT") | as_xpr("PROPFIND") | as_xpr("PROPPATCH") |
+ as_xpr("OPTIONS") | as_xpr("CONNECT") | as_xpr("COPY") |
+ as_xpr("TRACE") | as_xpr("DELETE") | as_xpr("LOCK") |
+ as_xpr("UNLOCK") | as_xpr("MOVE") | as_xpr("MKCOL")) >> _s >>
+ +~_s >> _s >>
+ "HTTP/" >> (as_xpr("1.0")|as_xpr("1.1"));
+
+cregex version_and_status_code_regex
+ = "HTTP/" >> (as_xpr("1.0")|as_xpr("1.1")) >> _s >>
+ range('1', '3') >> repeat<2>(_d) >> _s >>
+ *_;
+
cregex uri_regex
= +alpha >> _s >>
(s1 = *~_s) >> _s >>
}
+l7vs::http_protocol_module_base::CHECK_RESULT_TAG
+l7vs::http_protocol_module_base::check_http_method_and_version(
+ const char* buffer,
+ const size_t buffer_len ) const {
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [check_http_method_and_version] : "
+ "buffer_len = [%d]" );
+
+ outform % buffer_len;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
+ l7vs::http_protocol_module_base::CHECK_RESULT_TAG check_result = CHECK_OK;
+
+ char* check_string = NULL;
+ size_t line_length = 0;
+
+ if( buffer != NULL ){
+
+ for( line_length = 0; line_length < buffer_len; line_length++ ){
+
+ if( buffer[line_length] == '\r' || buffer[line_length] == '\n' ){
+
+ break;
+
+ }
+
+ }
+
+ if( line_length < buffer_len ){
+
+ check_string = (char*)malloc( line_length + 1 );
+
+ if( check_string != NULL ){
+ memcpy( check_string, buffer, line_length );
+
+ check_string[line_length] = '\0';
+
+ if( !regex_match( check_string, method_and_version_regex )){
+
+ check_result = CHECK_NG;
+
+ }
+
+ free( check_string );
+ }
+ else{
+
+ check_result = CHECK_NG;
+
+ }
+
+ }
+ else{
+
+ check_result = CHECK_INPOSSIBLE;
+
+ }
+
+ }
+ else{
+
+ check_result = CHECK_NG;
+
+ }
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [check_http_method_and_version] : "
+ "check_result = [%d]" );
+
+ outform % check_result;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
+ return check_result;
+
+}
+
+l7vs::http_protocol_module_base::CHECK_RESULT_TAG
+l7vs::http_protocol_module_base::check_http_version_and_status_code(
+ const char* buffer,
+ const size_t buffer_len ) const {
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [check_http_version_and_status_code] : "
+ "buffer_len = [%d]" );
+
+ outform % buffer_len;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
+ l7vs::http_protocol_module_base::CHECK_RESULT_TAG check_result = CHECK_OK;
+
+ char* check_string = NULL;
+ size_t line_length = 0;
+
+ if( buffer != NULL ){
+
+ for( line_length = 0; line_length < buffer_len; line_length++ ){
+
+ if( buffer[line_length] == '\r' || buffer[line_length] == '\n' ){
+
+ break;
+
+ }
+
+ }
+
+ if( line_length < buffer_len ){
+
+ check_string = (char*)malloc( line_length + 1 );
+
+ if( check_string != NULL ){
+ memcpy( check_string, buffer, line_length );
+
+ check_string[line_length] = '\0';
+
+ if( !regex_match( check_string, version_and_status_code_regex )){
+
+ check_result = CHECK_NG;
+
+ }
+
+ free( check_string );
+ }
+ else{
+
+ check_result = CHECK_NG;
+
+ }
+
+ }
+ else{
+
+ check_result = CHECK_INPOSSIBLE;
+
+ }
+
+ }
+ else{
+
+ check_result = CHECK_NG;
+
+ }
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [check_http_version_and_status_code] : "
+ "check_result = [%d]" );
+
+ outform % check_result;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
+ return check_result;
+
+}
bool l7vs::http_protocol_module_base::find_uri( const char* buffer,
const size_t buffer_len,
-//
-// @file http_protocol_module_base.h
-// @brief shared object http protocol module absctract class
-//
-// Distributed under the Boost Software License, Version 1.0.(See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
-//
-
+/*
+ * @file http_protocol_module_base.h
+ * @brief shared object protocol module abstract class
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009 NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
#ifndef HTTP_PROTOCOL_MODULE_BASE_H
#define HTTP_PROTOCOL_MODULE_BASE_H
//! @param const size_t buffer_len
//! @return CHECK_RESULT_TAG http method is valid
CHECK_RESULT_TAG check_http_method( const char*, const size_t ) const;
+
//! check http version function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @return CHECK_RESULT_TAG http version 1.0 or 1.1
CHECK_RESULT_TAG check_http_version( const char*, const size_t ) const;
+
//! check http status code function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @return CHECK_RESULT_TAG status code is nomal or error
CHECK_RESULT_TAG check_status_code( const char*, const size_t ) const;
+
+ //! check http method and version function
+ //! @param const char* buffer
+ //! @param const size_t buffer_len
+ //! @return CHECK_RESULT_TAG http method and version is valid
+ CHECK_RESULT_TAG check_http_method_and_version( const char*, const size_t ) const;
+
+ //! check http version and status code function
+ //! @param const char* buffer
+ //! @param const size_t buffer_len
+ //! @return CHECK_RESULT_TAG http version and status code is valid
+ CHECK_RESULT_TAG check_http_version_and_status_code( const char*, const size_t ) const;
+
//! serch uri function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param size_t& uri length
//! @return bool find is true. not find is false
bool find_uri( const char*, const size_t, size_t&, size_t&);
+
//! serch status function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param size_t& status length
//! @return bool find is true. not find is false
bool find_status_code( const char*, const size_t, size_t&, size_t& );
- //! serch http header
+
+ //! serch http header function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param const string& header name
//! @param size_t& header length
//! @return bool find is true. not find is false
bool find_http_header( const char*, const size_t, const std::string&, size_t&, size_t& );
- //! serch http header Cookie
+
+ //! serch http header Cookie function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param size_t& header offset
//! @param size_t& header length
//! @return bool find is true. not find is false
bool find_http_header_cookie( const char*, const size_t, size_t&, size_t& );
- //! serch http header Content_Length
+
+ //! serch http header Content_Length function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param size_t& header offset
//! @param size_t& header length
//! @return bool find is true. not find is false
bool find_http_header_content_length( const char*, const size_t, size_t&, size_t& );
- //! serch http header X_Forwarded_For
+
+ //! serch http header X_Forwarded_For function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param size_t& header offset
//! @param size_t& header length
//! @return bool find is true. not find is false
bool find_http_header_x_forwarded_for( const char*, const size_t, size_t&, size_t& );
- //! serch http header all
+
+ //! serch http header all function
//! @param const char* buffer
//! @param const size_t buffer_len
//! @param size_t& header offset
//! @param size_t& header length
//! @return bool find is true. not find is false
bool find_http_header_all( const char*, const size_t, size_t&, size_t& );
+
public:
+
//! constractor
http_protocol_module_base( std::string in_modulename ) : protocol_module_base( in_modulename ){};
+
//! destractor
virtual ~http_protocol_module_base(){};
};
+/*
+ * @file protocol_module_cinsert.cpp
+ * @brief shared object protocol module class
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009 NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
#include <vector>
#include <list>
#include <boost/date_time/posix_time/posix_time.hpp>
down_thread_data->client_endpoint_tcp = client_endpoint_tcp;
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rw_scoped_lock lock( session_thread_data_map_mutex );
session_thread_data_map[ up_thread_id ] = up_thread_data;
session_thread_data_map[ down_thread_id ] = down_thread_data;
}
try
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rw_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( up_thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else if( send_status_itr->status == SEND_NG )
{
- check_result = check_http_method(
+// check_result = check_http_method(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_itr->send_offset,
+// unsend_data_size );
+//
+// if( check_result == CHECK_OK )
+// {
+//
+// check_result = check_http_version(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_itr->send_offset,
+// unsend_data_size );
+// }
+
+ check_result = check_http_method_and_version(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
unsend_data_size );
if( check_result == CHECK_OK )
{
- check_result = check_http_version(
- (const char*)recive_data_itr->second.recive_buffer
- + send_status_itr->send_offset,
- unsend_data_size );
- }
-
- if( check_result == CHECK_OK )
- {
-
// find_result = find_http_header(
// (const char*)recive_data_itr->second.recive_buffer
// + send_status_itr->send_offset,
send_status_add.edit_division = 0;
send_status_add.send_offset = next_request_offset;
- check_result = check_http_method(
+// check_result = check_http_method(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_add.send_offset,
+// rest_request_data_size );
+//
+// if( check_result == CHECK_OK )
+// {
+//
+// check_result = check_http_version(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_add.send_offset,
+// rest_request_data_size );
+// }
+
+ check_result = check_http_method_and_version(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
rest_request_data_size );
if( check_result == CHECK_OK )
{
- check_result = check_http_version(
- (const char*)recive_data_itr->second.recive_buffer
- + send_status_add.send_offset,
- rest_request_data_size );
- }
-
- if( check_result == CHECK_OK )
- {
-
// find_result = find_http_header(
// (const char*)recive_data_itr->second.recive_buffer
// + send_status_add.send_offset,
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
boost::asio::ip::tcp::endpoint
endpoint_tmp( boost::asio::ip::address::from_string(cookie_address),
boost::lexical_cast<unsigned short>(cookie_port));
-
+
+ rs_list_lock();
+
rs_list_itr = rs_list_begin();
-
+
while( rs_list_itr != rs_list_end())
{
rs_list_itr = rs_list_next( rs_list_itr );
}
+
+ rs_list_unlock();
+
} catch (...)
{
boost::format outform( "cookie value invalid endpoint : [handle_realserver_select] : "
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else if( send_status_itr->status == SEND_NG )
{
- check_result = check_status_code(
+// check_result = check_status_code(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_itr->send_offset,
+// unsend_data_size );
+//
+// if( check_result == CHECK_OK )
+// {
+//
+// check_result = check_http_version(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_itr->send_offset,
+// unsend_data_size );
+// }
+
+ check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
unsend_data_size );
if( check_result == CHECK_OK )
{
- check_result = check_http_version(
- (const char*)recive_data_itr->second.recive_buffer
- + send_status_itr->send_offset,
- unsend_data_size );
- }
-
- if( check_result == CHECK_OK )
- {
-
// find_result = find_http_header(
// (const char*)recive_data_itr->second.recive_buffer
// + send_status_itr->send_offset,
send_status_add.edit_division = 0;
send_status_add.send_offset = next_response_offset;
- check_result = check_status_code(
+// check_result = check_status_code(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_add.send_offset,
+// rest_response_data_size );
+//
+// if( check_result == CHECK_OK )
+// {
+//
+// check_result = check_http_version(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_add.send_offset,
+// rest_response_data_size );
+// }
+
+ check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
rest_response_data_size );
if( check_result == CHECK_OK )
{
- check_result = check_http_version(
- (const char*)recive_data_itr->second.recive_buffer
- + send_status_add.send_offset,
- rest_response_data_size );
- }
-
- if( check_result == CHECK_OK )
- {
-
// find_result = find_http_header(
// (const char*)recive_data_itr->second.recive_buffer
// + send_status_add.send_offset,
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else if( send_status_itr->status == SEND_NG )
{
- check_result = check_status_code(
+// check_result = check_status_code(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_itr->send_offset,
+// unsend_data_size );
+//
+// if( check_result == CHECK_OK )
+// {
+// check_result = check_http_version(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_itr->send_offset,
+// unsend_data_size );
+// }
+
+ check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
unsend_data_size );
if( check_result == CHECK_OK )
{
- check_result = check_http_version(
- (const char*)recive_data_itr->second.recive_buffer
- + send_status_itr->send_offset,
- unsend_data_size );
- }
-
- if( check_result == CHECK_OK )
- {
// find_result = find_http_header(
// (const char*)recive_data_itr->second.recive_buffer
send_status_add.edit_division = 0;
send_status_add.send_offset = next_response_offset;
- check_result = check_status_code(
+// check_result = check_status_code(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_add.send_offset,
+// rest_response_data_size );
+//
+// if( check_result == CHECK_OK )
+// {
+// check_result = check_http_version(
+// (const char*)recive_data_itr->second.recive_buffer
+// + send_status_add.send_offset,
+// rest_response_data_size );
+// }
+
+ check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
rest_response_data_size );
if( check_result == CHECK_OK )
{
- check_result = check_http_version(
- (const char*)recive_data_itr->second.recive_buffer
- + send_status_add.send_offset,
- rest_response_data_size );
- }
-
- if( check_result == CHECK_OK )
- {
// find_result = find_http_header(
// (const char*)recive_data_itr->second.recive_buffer
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
try
{
{
- boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
+ rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
+/*
+ * @file protocol_module_cinsert.h
+ * @brief shared object protocol module class
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009 NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
#include <boost/thread/mutex.hpp>
#include <boost/shared_ptr.hpp>
#include "http_protocol_module_base.h"
+#include "wrlock.h"
#ifndef PROTOCOL_MODULE_CINSERT_H
#define PROTOCOL_MODULE_CINSERT_H
( unsend_size == in.unsend_size ) &&
( edit_division == in.edit_division ) &&
( send_endpoint == in.send_endpoint ) );
-// ( send_endpoint == in.send_endpoint ) &&
-// ( edit_data_list == in.edit_data_list ) );
}
bool operator!=( const send_status& in )
( unsend_size != in.unsend_size ) ||
( edit_division != in.edit_division ) ||
( send_endpoint != in.send_endpoint ) );
-// ( send_endpoint != in.send_endpoint ) ||
-// ( edit_data_list != in.edit_data_list ) );
}
send_status() :
( recive_buffer_2 == in.recive_buffer_2 ) &&
( recive_buffer_max_size == in.recive_buffer_max_size ) &&
( recive_buffer_rest_size == in.recive_buffer_rest_size ));
-// ( recive_buffer_rest_size == in.recive_buffer_rest_size ) &&
-// ( send_status_list == in.send_status_list ) );
}
bool operator!=( const recive_data& in )
( recive_buffer_2 != in.recive_buffer_2 ) ||
( recive_buffer_max_size != in.recive_buffer_max_size ) ||
( recive_buffer_rest_size != in.recive_buffer_rest_size ) );
-// ( recive_buffer_rest_size != in.recive_buffer_rest_size ) ||
-// ( send_status_list != in.send_status_list ) );
}
recive_data() :
{ return ( ( thread_id == in.thread_id ) &&
( thread_division == in.thread_division ) &&
( pair_thread_id == in.pair_thread_id ) &&
-// ( recive_data_map == in.recive_data_map ) &&
( end_flag == in.end_flag ) &&
( accept_end_flag == in.accept_end_flag ) &&
( sorry_flag == in.sorry_flag ) &&
return ( ( thread_id != in.thread_id ) ||
( thread_division != in.thread_division ) ||
( pair_thread_id != in.pair_thread_id ) ||
-// ( recive_data_map != in.recive_data_map ) ||
( end_flag != in.end_flag ) ||
( accept_end_flag != in.accept_end_flag ) ||
( sorry_flag != in.sorry_flag ) ||
boost::array< char, MAX_OPTION_SIZE > cookie_name;
boost::array< char, MAX_OPTION_SIZE > sorry_uri;
t_session_thread_data_map session_thread_data_map;
- boost::mutex session_thread_data_map_mutex;
+// boost::mutex session_thread_data_map_mutex;
+ wr_mutex session_thread_data_map_mutex;
public:
protocol_module_cinsert();