UltraMonkey-L7 V3(multi-thread implementation)
Revision | b9d8e263c3490861db7eb2f5de02549feceb125d (tree) |
---|---|
Time | 2012-07-31 13:37:34 |
Author | Hiroaki Nakano <nakano.hiroaki@nttc...> |
Commiter | Hiroaki Nakano |
ticket 29127, 29128 l7directordのモジュール名チェックを外す
29127 l7directordのモジュール名チェックを外す
29128 サービス監視に失敗したときは、ポート監視に移行してしまう
Signed-off-by: Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp>
@@ -892,9 +892,7 @@ sub validate_config { | ||
892 | 892 | } |
893 | 893 | } |
894 | 894 | elsif ($name eq 'scheduler') { |
895 | - my $valid_scheduler = qr{lc|rr|wrr}; | |
896 | - $value = lc $value; | |
897 | - if (!defined $value || $value !~ /^(?:$valid_scheduler)$/) { | |
895 | + if ( $value =~ /[^a-z]/ ) { | |
898 | 896 | config_error($line, 'ERR0105', $config); |
899 | 897 | } |
900 | 898 | } |
@@ -933,35 +931,16 @@ sub validate_config { | ||
933 | 931 | } |
934 | 932 | } |
935 | 933 | elsif ($name eq 'module') { |
936 | - ## V3 Un-offering (url,pfileter). | |
937 | - my %key_option = ( url => ['--pattern-match', '--uri-pattern-match', '--host-pattern-match'], | |
938 | - sessionless => [], | |
939 | - ip => [], | |
940 | - sslid => [], | |
941 | - ); | |
942 | 934 | my $module = undef; |
943 | 935 | my $option = undef; |
944 | - my $key = q{}; | |
945 | 936 | if (defined $value) { |
946 | 937 | $value =~ s/["']//g; |
947 | 938 | ($module, $option) = split /\s+/, $value, 2; |
948 | 939 | } |
949 | - $module = lc $module; | |
950 | - if ( !defined $module || !exists $key_option{$module} ) { | |
940 | + if ( $module =~ /[^a-z]/ ) { | |
951 | 941 | config_error($line, 'ERR0111', $config); |
952 | 942 | } |
953 | - for my $key_opt ( @{$key_option{$module}} ) { | |
954 | - if (defined $option && $option =~ /$key_opt\s+(\S+)/) { | |
955 | - $key .= q{ } if $key; | |
956 | - $key .= $key_opt . q{ } . $1; | |
957 | - } | |
958 | - } | |
959 | - if ( !$key && @{$key_option{$module}} ) { | |
960 | - # when omit cookie module key option | |
961 | - my $key_opt = join q{' or `}, @{$key_option{$module}}; | |
962 | - config_error($line, 'ERR0112', $module, $key_opt, $config); | |
963 | - } | |
964 | - $value = {name => $module, option => $option, key => $key}; | |
943 | + $value = {name => $module, option => $option}; | |
965 | 944 | } |
966 | 945 | elsif ($name eq 'sorryserver') { |
967 | 946 | my $forward = 'masq'; |
@@ -2137,9 +2116,9 @@ sub health_check { | ||
2137 | 2116 | my $service_status = &$health_check_func($v, $r); |
2138 | 2117 | |
2139 | 2118 | if ($service_status == $SERVICE_DOWN) { |
2119 | + undef $r->{num_connects}; | |
2140 | 2120 | if (!defined $current_status || $current_status == $SERVICE_UP) { |
2141 | 2121 | $r->{fail_counts}++; |
2142 | - undef $r->{num_connects}; | |
2143 | 2122 | if ($r->{fail_counts} >= $v->{checkcount}) { |
2144 | 2123 | ld_log( _message( 'ERR0602', get_ip_port($r) ) ); |
2145 | 2124 | service_set($v_r_list, 'down'); |
@@ -4291,15 +4270,14 @@ sub _message_only { | ||
4291 | 4270 | ERR0103 => "Invalid value (set any word) `%s'.", |
4292 | 4271 | ERR0104 => "Invalid value (set `custom', `connect', `negotiate', `ping', `off', `on' " |
4293 | 4272 | . "or positive number) `%s'.", |
4294 | - ERR0105 => "Invalid value (set `lc', `rr' or `wrr') `%s'.", | |
4273 | + ERR0105 => "Invalid schedule module (should be only lowercase letters (a-z)) `%s'.", | |
4295 | 4274 | ERR0106 => "Invalid value (set `http', `https', `ftp', `smtp', `pop', `imap', " |
4296 | 4275 | . "`ldap', `nntp', `dns', `mysql', `pgsql', `sip', or `none') `%s'.", |
4297 | 4276 | ERR0107 => "Invalid value (forwarding mode must be `masq' or `tproxy') `%s'.", |
4298 | 4277 | ERR0108 => "Invalid port number `%s'.", |
4299 | 4278 | ERR0109 => "Invalid protocol (protocol must be `tcp') `%s'.", |
4300 | 4279 | ERR0110 => "Invalid HTTP method (set `GET' or `HEAD') `%s'.", |
4301 | - ERR0111 => "Invalid module (set `url', `pfilter', `ip', `sslid' or `sessionless') `%s'.", | |
4302 | - # ERR0111 => "Invalid module (set `cinsert', `cpassive', `crewrite', `url', `pfilter', `ip', `sslid' or `sessionless') `%s'.", | |
4280 | + ERR0111 => "Invalid protocol module (should be only lowercase letters (a-z)) `%s'.", | |
4303 | 4281 | ERR0112 => "Invalid module key option (`%s' module must set `%s' option) `%s'.", |
4304 | 4282 | ERR0113 => "Invalid QoS value (set 0 or 1-999[KMG]. must specify unit(KMG)) `%s'.", |
4305 | 4283 | ERR0114 => "Invalid address `%s'.", |