• R/O
  • HTTP
  • SSH
  • HTTPS

ultramonkey-l7-v2: コミット

UltraMonkey-L7 V2(single-thread implementation)


コミットメタ情報

リビジョンa79d28986be76db2e8b83a9c2a841142632231c3 (tree)
日時2010-06-08 02:03:28
作者Kohei TANUMA <tanuma@user...>
コミッターKohei TANUMA

ログメッセージ

HTTP::Response->as_string returns all http messages which include all HTTP header and HTTP content.
If HTTP method is 'HEAD', server will send only HTTP header and never send HTTP content.
If HTTP method is 'GET', server will send both HTTP header and HTTP content.
So, use HTTP::Response->as_string when HTTP method is 'HEAD', and use HTTP::Response->content when HTTP method is 'GET'.

変更サマリ

差分

--- a/l7directord/l7directord
+++ b/l7directord/l7directord
@@ -2124,15 +2124,7 @@ sub check_http {
21242124 my $status_line = $res->status_line;
21252125 $status_line =~ s/[\r\n]//g;
21262126
2127- my $response = "";
2128- my ($res_head, $res_body) = split /\n\n/, $res->as_string, 2;
2129- if ($v->{httpmethod} eq "HEAD") {
2130- $response = $res_head;
2131- }
2132- else {
2133- $response = $res_body;
2134- }
2135-
2127+ my $response = $v->{httpmethod} eq "HEAD" ? $res->as_string : $res->content;
21362128 my $recstr = $r->{receive};
21372129 if (!$res->is_success) {
21382130 ld_log( _message( 'WRN1102', $status_line, $r->{server}{ip}, $port ) ) if (!defined $status || $status eq $SERVICE_UP);
旧リポジトリブラウザで表示