Changeset 38602

Show
Ignore:
Timestamp:
10/19/10 16:28:26 (19 months ago)
Author:
mumumu
Message:

- changed default timeout value (3 to 10)
- newly added recv_limit configuration. default value is 64K. (damn! amazon.co.jp)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/tiarra/trunk/module/Auto/FetchTitle.pm

    r37367 r38602  
    7272our $MAX_ACTIVE_REQUESTS        = 3; 
    7373our $MAX_URLS_IN_SINGLE_MESSAGE = 3; 
    74 our $DEFAULT_RECV_LIMIT         = 4*1024; # 4K bytes. 
    75 our $DEFAULT_TIMEOUT            = 3;  # sec. 
     74our $DEFAULT_RECV_LIMIT         = 64*1024; # 64K bytes. Damn amazon.co.jp! 
     75our $DEFAULT_TIMEOUT            = 10;  # sec. 
    7676our $MAX_REDIRECTS              = 5; 
    7777our $MAX_REDIRECTS_LIMIT        = 20; 
     
    521521  my $anchor; 
    522522  ($url, $anchor) = split(/#/, $url, 2); 
     523  my $recv_limit = $this->config->recv_limit || $DEFAULT_RECV_LIMIT; 
     524  $this->_debug($full_ch_name, "recv_limit: $recv_limit"); 
     525 
    523526  my $req = { 
    524527    old          => undef,    # undef for first (non-redirect) request. 
     
    541544    headers      => {}, 
    542545    cookies      => [],    # cookies for this request. 
    543     recv_limit   => $DEFAULT_RECV_LIMIT, 
     546    recv_limit   => $recv_limit, 
    544547    max_redirects=> undef, # integer. 
    545548    timeout      => undef, 
     
    11941197  $DEBUG and $this->_debug($req, "debug: progress $rlen / $req->{recv_limit}"); 
    11951198 
     1199   
    11961200  if( my $addr = !$req->{addr_checked} && $req->{httpclient}->{addr} ) 
    11971201  { 
     
    23092313 
    23102314# リクエストタイムアウトまでの時間(秒). 
    2311 timeout: 3 
     2315# タイムアウトエラーが頻発するようならこの値を 
     2316# 大きくしてください 
     2317timeout: 10  
     2318 
     2319# 取得するコンテンツのバイト数 
     2320# イマドキのサイトはこれで十分のはずですが、 
     2321# 遅い回線を使っている場合はこの値を小さく 
     2322# してみてください。 
     2323recv_limit: 65536  
    23122324 
    23132325# 有効にするチャンネルとオプションとURLの設定.