|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #############################################################################
  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Name:        http.pm
  | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Purpose:     lib::http
  | 
| 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Author:      Graciliano M. P. 
  | 
| 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Modified by:
  | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Created:     2005-02-04
  | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## RCS-ID:      
  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Copyright:   (c) 2005 Graciliano M. P. 
  | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ## Licence:     This program is free software; you can redistribute it and/or
  | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##              modify it under the same terms as Perl itself
  | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #############################################################################
  | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package lib::http ;
  | 
| 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
15
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
8654
 | 
   use strict qw(vars) ;
  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
46
 | 
    | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
17
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
   use vars qw($VERSION @ISA $DEBUG %STATUS) ;
  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
102
 | 
    | 
| 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   $VERSION = '0.01' ;
  | 
| 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###########
  | 
| 
22
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # REQUIRE #
  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###########
  | 
| 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
25
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
1191
 | 
   use Socket ;
  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4223
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
697
 | 
    | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ########
  | 
| 
28
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # VARS #
  | 
| 
29
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ########
  | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
31
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my $AGENT = "lib::http/$VERSION Perl/$] ($^O)" ;
  | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my @MONTHS_DAYS = ('',31,28,31,30,31,30,31,31,30,31,30,31) ;
  | 
| 
34
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
35
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my ( $ACCEPT_GZIP , $ENABLE_GZIP , @IDX_FIND , $FIND_IDX , %LIBS_IDX  , @TMPDIRS ) ;
  | 
| 
36
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my ( $TMPDIR , $TMPFILE , @INC_LIB , %INC_LIB , %URLS , %LIB_TREE ) ;
  | 
| 
37
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
38
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
12
 | 
   use constant URI_TIMEOUT => 60 ;
  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
104
 | 
    | 
| 
39
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
5
 | 
   use constant USER_AGENT => "perl-lib-httpd/$VERSION libwww-perl/$LWP::VERSION Perl/$] ($^O)" ;
  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6971
 | 
    | 
| 
40
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
41
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my @STATIC_TMPDIR = qw(libhttp lib/libhttp-tmp) ;
  | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
43
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my $LIB_VER = $] ;
  | 
| 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   $LIB_VER =~ s/(\d+)\.(\d\d\d)(\d\d\d)/$1 .'.'. ($2*1) .'.'. ($3*1)/ge ;
  | 
| 
45
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
46
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my @LIB_VERSIONED = (
  | 
| 
47
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'lib','site/lib', ## win32
  | 
| 
48
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'perl5','site_perl','perl5/site_perl','perl5/vendor_perl' , ## linux
  | 
| 
49
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ) ;
  | 
| 
50
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
51
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   {
  | 
| 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my @copy = @LIB_VERSIONED ;
  | 
| 
53
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     foreach my $LIB_VERSIONED_i ( @copy ) {
  | 
| 
54
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       push(@LIB_VERSIONED , "$LIB_VERSIONED_i/$LIB_VER") ;
  | 
| 
55
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
56
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
57
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   my %MONTHS_EG = (
  | 
| 
59
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'jan' => 1 ,
  | 
| 
60
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'feb' => 2 ,
  | 
| 
61
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'mar' => 3 ,
  | 
| 
62
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'apr' => 4 ,
  | 
| 
63
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'may' => 5 ,
  | 
| 
64
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'jun' => 6 ,
  | 
| 
65
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'jul' => 7 ,
  | 
| 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'aug' => 8 ,
  | 
| 
67
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'sep' => 9 ,
  | 
| 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'oct' => 10 ,
  | 
| 
69
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'nov' => 11 ,
  | 
| 
70
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'dec' => 12
  | 
| 
71
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   );
  | 
| 
72
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
73
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
74
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # IMPORT #
  | 
| 
75
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
76
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
77
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub import {
  | 
| 
78
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
12
 | 
   my $class = shift ;
  | 
| 
79
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
80
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
6
 | 
   if ( @_ == 1 ) {
  | 
| 
81
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( $_[0] eq 'unlink_tmpfile' ) {
  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
82
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       unlink_tmpfile(1) ;
  | 
| 
83
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       return ;
  | 
| 
84
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
85
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     elsif ( $_[0] =~ /debug/i ) {
  | 
| 
86
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $DEBUG = 1 ;
  | 
| 
87
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       return ;
  | 
| 
88
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
89
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
90
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
92
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
   my ( @bases ) = @_ ;
  | 
| 
93
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
94
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
4
 | 
   start() if @bases ;
  | 
| 
95
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
96
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
   my %idx ;
  | 
| 
97
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
98
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
31
 | 
   foreach my $bases_i ( @bases ) {
  | 
| 
99
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $uri = $bases_i ;
  | 
| 
100
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $uri =~ s/\/*$/\// ;
  | 
| 
101
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
102
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( !$INC_LIB{$uri}++ ) {
  | 
| 
103
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       push(@INC_LIB , $uri) ;
  | 
| 
104
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       push(@IDX_FIND , $uri) ;
  | 
| 
105
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 
  | 
| 
106
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       foreach my $LIB_VERSIONED_i ( @LIB_VERSIONED ) {
  | 
| 
107
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         my $uri_ver = "$uri$LIB_VERSIONED_i" ;
  | 
| 
108
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $uri_ver =~ s/\/*$/\//gs ;
  | 
| 
109
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
         if ( scalar get_head($uri_ver) && !$INC_LIB{$uri_ver}++ ) {
  | 
| 
110
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           push(@INC_LIB , $uri_ver) ;
  | 
| 
111
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           push(@IDX_FIND , $uri_ver) ;
  | 
| 
112
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }
  | 
| 
113
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
114
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
115
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
116
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
117
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
118
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
119
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #########
  | 
| 
120
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # START #
  | 
| 
121
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #########
  | 
| 
122
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
123
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub start {
  | 
| 
124
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   if ( !$TMPDIR ) {
  | 
| 
125
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     foreach my $STATIC_TMPDIR_i ( @STATIC_TMPDIR ) {
  | 
| 
126
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       if ( -d $STATIC_TMPDIR_i ) {
  | 
| 
127
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $TMPDIR = $STATIC_TMPDIR_i ;
  | 
| 
128
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         last ;
  | 
| 
129
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
130
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
131
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
132
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( !$TMPDIR ) {
  | 
| 
133
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my $tmp = tmpdir() ;
  | 
| 
134
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       if ( $tmp && -d $tmp ) {
  | 
| 
135
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         my @lyb = (a..z,0..9) ;
  | 
| 
136
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         my $rand ;
  | 
| 
137
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $rand .= $lyb[ rand(@lyb) ] while length($rand) < 6 ;
  | 
| 
138
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $tmp .= '/' if $tmp !~ /[\\\/]$/ ;
  | 
| 
139
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $tmp .= "libhttp-$rand-tmp" ;
  | 
| 
140
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         mkpath($tmp) ;
  | 
| 
141
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         if ( -d $tmp ) {
  | 
| 
142
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           $TMPDIR = $tmp ;
  | 
| 
143
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
           push(@TMPDIRS , $TMPDIR) ;
  | 
| 
144
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }
  | 
| 
145
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
146
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
147
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
148
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $TMPFILE = "$TMPDIR/libhttp.tmp" ;
  | 
| 
149
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
150
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
151
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($hash_hook , $has_lib) ;
  | 
| 
152
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $INC_i ( @INC ) {
  | 
| 
153
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $hash_hook = 1 if $INC_i == \&hook ;
  | 
| 
154
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $has_lib = 1 if $INC_i eq $TMPDIR ;
  | 
| 
155
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
157
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   push(@INC , \&hook) if !$hash_hook ;
  | 
| 
158
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   push(@INC , $TMPDIR) if !$has_lib ;
  | 
| 
159
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
160
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $SIG{INT} = \&end if !$SIG{INT} ;
  | 
| 
161
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
162
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return 1 ;
  | 
| 
163
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
164
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
165
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###############
  | 
| 
166
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # ENABLE_GZIP #
  | 
| 
167
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###############
  | 
| 
168
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
169
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub enable_gzip {
  | 
| 
170
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   return if $ENABLE_GZIP ;
  | 
| 
171
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $ENABLE_GZIP = 2 ;
  | 
| 
172
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
173
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   eval('use Compress::Zlib ;') ;
  | 
| 
174
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
175
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( !$@ && defined &Compress::Zlib::memGunzip ) {
  | 
| 
176
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $ACCEPT_GZIP = 1 ;
  | 
| 
177
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print ">> *** GZIP ON ***\n" if $DEBUG ;
  | 
| 
178
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
179
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
180
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $ENABLE_GZIP = 1 ;
  | 
| 
181
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
182
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
183
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
184
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # FIND_IDX #
  | 
| 
185
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
186
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
187
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub find_idx {
  | 
| 
188
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   return if $FIND_IDX ;
  | 
| 
189
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $FIND_IDX = 1 ;
  | 
| 
190
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
191
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my %idx ;
  | 
| 
192
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
193
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $IDX_FIND_i ( @IDX_FIND ) {
  | 
| 
194
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $fl_idx = "${IDX_FIND_i}libhttp.idx" ;
  | 
| 
195
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
196
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $fl_idx_local = $fl_idx ;
  | 
| 
197
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $fl_idx_local =~ s/^http:\/\///si ;
  | 
| 
198
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $fl_idx_local =~ s/\./_/gs ;
  | 
| 
199
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $fl_idx_local =~ s/\W/-/gs ;
  | 
| 
200
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $fl_idx_local =~ s/_idx$/.idx/gi ;
  | 
| 
201
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
202
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $fl_idx_local = "$TMPDIR/$fl_idx_local" ;
  | 
| 
203
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
204
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($idx , $idx_time) ;
  | 
| 
205
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
206
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($fl_size , $mdf_time) = (stat($fl_idx_local))[7,9] ;
  | 
| 
207
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( $fl_size ) {
  | 
| 
208
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my ( $code , $modf , $length ) = get_head($fl_idx) ;
  | 
| 
209
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       
  | 
| 
210
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       if ( $code == 200 && $fl_size == $length && $mdf_time >= $modf ) {
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
211
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $idx_time = $mdf_time ;
  | 
| 
212
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         open (IDX,$fl_idx_local) ; binmode(IDX) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
213
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         1 while( read(IDX, $idx , 1024*4 , length($idx) ) ) ;
  | 
| 
214
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         close(IDX) ;
  | 
| 
215
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
216
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
217
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
218
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( !$idx ) {
  | 
| 
219
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my $modf ;
  | 
| 
220
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       ( $idx , undef , $modf ) = get_url("$fl_idx.gz" , undef , 1) if $ENABLE_GZIP ;
  | 
| 
221
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       ( $idx , undef , $modf ) = get_url($fl_idx      , undef , 1) if !$idx ;
  | 
| 
222
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
223
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       if ( $idx ) {
  | 
| 
224
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $idx_time = $modf ;
  | 
| 
225
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         open (IDX,">$fl_idx_local") ; binmode(IDX) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
226
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         print IDX $idx ;
  | 
| 
227
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         close (IDX) ;
  | 
| 
228
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         utime($modf , $modf , $fl_idx_local) ;
  | 
| 
229
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
230
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
231
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
232
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $idx{$IDX_FIND_i} = [$idx , $idx_time] if $idx ;
  | 
| 
233
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
234
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
235
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $Key (sort keys %idx ) {
  | 
| 
236
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $LIBS_IDX{lib}{$Key} = $idx{$Key}[1] ;
  | 
| 
237
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
238
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my (@files) = split( /(?:"\r\n?|\n)+/s , $idx{$Key}[0] ) ;
  | 
| 
239
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
240
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     foreach my $files_i ( @files ) {
  | 
| 
241
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my ($file , $size) = split(/\s+=\s+/s , $files_i) ;
  | 
| 
242
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $size =~ s/\s+//gs ;
  | 
| 
243
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $LIBS_IDX{"$Key$file"} = $size ;
  | 
| 
244
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $LIBS_IDX{libs}{"$Key$file"} = [$Key , $file] ;
  | 
| 
245
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       my ($dir) = ( $file =~ /(.*?)[^\\\/]+$/ ) ;
  | 
| 
246
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $LIBS_IDX{dirs}{"$Key$dir"} = 1 ;
  | 
| 
247
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $LIBS_IDX{path}{$dir}{$Key} = 1 ;
  | 
| 
248
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
249
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
250
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
251
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ##print "*** IDX ON!\n" ;  ;
  | 
| 
252
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
253
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
254
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
255
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ########
  | 
| 
256
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # HOOK #
  | 
| 
257
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ########
  | 
| 
258
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
259
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub hook {
  | 
| 
260
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my $code = shift ;
  | 
| 
261
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $module = shift ;
  | 
| 
262
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
263
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   unlink_tmpfile() ;
  | 
| 
264
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
265
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##  enable_gzip() ;
  | 
| 
266
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##  find_idx() if $ENABLE_GZIP != 2 ;
  | 
| 
267
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
268
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   find_idx() ;
  | 
| 
269
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   enable_gzip() ;
  | 
| 
270
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
271
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $INC_LIB_i ( @INC_LIB ) {
  | 
| 
272
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $uri = $INC_LIB_i . $module ; #URI->new_abs($module , $INC_LIB_i)->canonical ;
  | 
| 
273
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     check_module_dep($uri , $module) ;
  | 
| 
274
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $fl = get_file($uri , $module) ;
  | 
| 
275
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $fl if ref $fl ;
  | 
| 
276
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     last if $fl ;
  | 
| 
277
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
278
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
279
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ## Return undef since tmpdir is at @INC:
  | 
| 
280
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return undef ;
  | 
| 
281
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
282
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
283
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ####################
  | 
| 
284
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # CHECK_MODULE_DEP #
  | 
| 
285
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ####################
  | 
| 
286
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
287
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub check_module_dep {
  | 
| 
288
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $url , $module ) = @_ ;
  | 
| 
289
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
290
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $pack = $module ;
  | 
| 
291
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $pack =~ s/[\\\/]/::/gs ;
  | 
| 
292
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $pack =~ s/\.(?:pm|pl|al)$//si ;
  | 
| 
293
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $pack =~ s/::/\//gs ;
  | 
| 
294
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $pack =~ s/[\\\/]*$/\//s ;
  | 
| 
295
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
296
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @dep ;
  | 
| 
297
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
298
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $INC_LIB_i ( @INC_LIB ) {
  | 
| 
299
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     push(@dep , [$INC_LIB_i , $pack]) ;
  | 
| 
300
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     push(@dep , [$INC_LIB_i , "auto/$pack"]) ;
  | 
| 
301
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
302
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
303
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $dep_i ( @dep ) {
  | 
| 
304
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     get_tree(@$dep_i) ;
  | 
| 
305
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
306
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
307
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
308
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
309
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_TREE #
  | 
| 
310
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
311
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
312
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_tree {
  | 
| 
313
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $inc_base , $dir ) = @_ ;
  | 
| 
314
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
315
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   #print "DEP> $inc_base $dir\n" ;
  | 
| 
316
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
317
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @files ;
  | 
| 
318
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
319
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( %LIBS_IDX && $LIBS_IDX{dirs}{"$inc_base$dir"} ) {
  | 
| 
320
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     foreach my $Key ( sort keys %LIBS_IDX ) {
  | 
| 
321
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       next if !$LIBS_IDX{$Key} || $Key =~ /\.gz$/ || $Key !~ /^\Q$inc_base$dir\E/ ;
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
322
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       if ( $inc_base =~ /^\Q$LIBS_IDX{libs}{$Key}[0]\E/ && $Key =~ /^\Q$inc_base\E(.*)/ ) {
  | 
| 
323
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         push(@files , $1) ;
  | 
| 
324
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
325
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
326
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
327
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
328
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( !@files ) {
  | 
| 
329
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $has_lib_idx ;
  | 
| 
330
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     foreach my $Key ( keys %{ $LIBS_IDX{lib} } ) {
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
331
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $has_lib_idx = 1 if $inc_base =~ /^\Q$Key\E/i ;
  | 
| 
332
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
333
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     @files = get_dir("$inc_base$dir" , $dir) if !$has_lib_idx ;
  | 
| 
334
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
335
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
336
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $files_i ( @files ) {
  | 
| 
337
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     ##print "FL> $inc_base > $files_i\n" ;
  | 
| 
338
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( $files_i =~ /\/$/ ) {
  | 
| 
339
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       get_tree($inc_base , $files_i) ;
  | 
| 
340
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
341
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     else {
  | 
| 
342
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       get_file("$inc_base$files_i" , $files_i) if $files_i !~ /\.pm$/ ;
  | 
| 
343
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
344
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
345
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
346
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
347
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
348
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #####################
  | 
| 
349
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_DIR_RECURSIVE #
  | 
| 
350
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #####################
  | 
| 
351
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
352
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_dir_recursive {
  | 
| 
353
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $inc_base , $dir ) = @_ ;
  | 
| 
354
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
355
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @files = get_dir("$inc_base$dir" , $dir) ;
  | 
| 
356
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
357
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @tree ;
  | 
| 
358
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
359
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $files_i ( @files ) {
  | 
| 
360
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( $files_i =~ /\/$/ ) {
  | 
| 
361
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       push(@tree , get_dir_recursive($inc_base , $files_i) ) ;
  | 
| 
362
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
363
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     else {
  | 
| 
364
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       push(@tree , $files_i) ;
  | 
| 
365
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
366
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
367
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
368
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return @tree ;
  | 
| 
369
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
370
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
371
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###########
  | 
| 
372
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_DIR #
  | 
| 
373
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###########
  | 
| 
374
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
375
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_dir {
  | 
| 
376
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $url_base , $pack_base ) = @_ ;
  | 
| 
377
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
378
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $dir = get_url($url_base , undef , 1) ;
  | 
| 
379
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
380
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return if !$dir ;
  | 
| 
381
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
382
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @files = parse_dir($dir) ;
  | 
| 
383
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
384
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $files_i ( @files ) {
  | 
| 
385
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $files_i = "$pack_base$files_i" ;
  | 
| 
386
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
387
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
388
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return @files ;
  | 
| 
389
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
390
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
391
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #############
  | 
| 
392
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # PARSE_DIR #
  | 
| 
393
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #############
  | 
| 
394
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
395
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub parse_dir {
  | 
| 
396
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $dir ) = @_ ;
  | 
| 
397
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
398
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my (@links) = ( $dir =~ /]*?href=['"]([^'"]+)['"]>.*?<\/a>/gsi );
  | 
| 
399
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
400
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @files ;
  | 
| 
401
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $links_i ( @links ) {
  | 
| 
402
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     next if $links_i !~ /(?:\w|\/)$/ || $links_i =~ /^(?:mailto:|\?|\/)/ ;
  | 
| 
403
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     push(@files , $links_i) ;
  | 
| 
404
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
405
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
406
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return @files ;
  | 
| 
407
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
408
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
409
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #################
  | 
| 
410
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_MODULE_FH #
  | 
| 
411
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #################
  | 
| 
412
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
413
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_module_fh {
  | 
| 
414
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $uri , $module ) = @_ ;
  | 
| 
415
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
416
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $new_file ;
  | 
| 
417
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
418
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   $new_file = get_file($uri , $module) || return ;
  | 
| 
419
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
420
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   open (my $fh , $new_file) ; binmode($fh) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
421
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $fh ;
  | 
| 
422
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
423
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
424
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
425
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_FILE #
  | 
| 
426
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
427
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
428
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_file {
  | 
| 
429
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $uri , $module ) = @_ ;
  | 
| 
430
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
431
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   return if (time - $URLS{$uri}{t}) < URI_TIMEOUT && $URLS{$uri}{status} == 404 ;
  | 
| 
432
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
433
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $new_file = $TMPDIR =~ /[\\\/]$/ ? "$TMPDIR$module" : "$TMPDIR/$module" ;
  | 
| 
434
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $file_dir = $new_file ;
  | 
| 
435
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $file_dir =~ s/[^\\\/]+$//gs ;
  | 
| 
436
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   mkpath($file_dir) ;
  | 
| 
437
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
438
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( -s $new_file && $LIBS_IDX{$uri} ) {
  | 
| 
439
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($fl_size , $mdf_time) = (stat($new_file))[7,9] ;
  | 
| 
440
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $idx_time ;
  | 
| 
441
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     foreach my $Key ( sort keys %{ $LIBS_IDX{lib} } ) {
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
442
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $idx_time = $LIBS_IDX{lib}{$Key} if $uri =~ /^\Q$Key\E/i ;
  | 
| 
443
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
444
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
445
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     return $new_file if $LIBS_IDX{$uri} == $fl_size && $idx_time ;
  | 
| 
446
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
447
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ( $code , $modf , $length ) = get_head($uri) ;
  | 
| 
448
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
449
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     return $new_file if $code == 200 && $fl_size == $length && $mdf_time >= $modf ;
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
450
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return if $code != 200 ;
  | 
| 
451
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
452
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
453
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($data , $code , $fl_time) ;
  | 
| 
454
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
455
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( $ACCEPT_GZIP && $uri !~ /(?:\.gz|\/)$/i ) {
  | 
| 
456
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $uri_gz = "$uri.gz" ; 
  | 
| 
457
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     if ( %LIBS_IDX && $LIBS_IDX{$uri_gz} ) {
  | 
| 
458
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       ($data , $code , $fl_time) = get_url($uri_gz) ;
  | 
| 
459
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $data = '' if $code != 200 ;
  | 
| 
460
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
461
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
462
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
463
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( $data eq '' && %LIBS_IDX ) {
  | 
| 
464
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $has_lib_idx ;
  | 
| 
465
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     foreach my $Key ( keys %{ $LIBS_IDX{lib} } ) {
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
466
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $has_lib_idx = 1 if $uri =~ /^\Q$Key\E/i ;
  | 
| 
467
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
468
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     return if $has_lib_idx && !$LIBS_IDX{$uri} ;
  | 
| 
469
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
470
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
471
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   unlink($new_file) ;
  | 
| 
472
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
473
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   ($data , $code , $fl_time) = get_url($uri) if $data eq '' ;
  | 
| 
474
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
475
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $URLS{$uri}{t} = time ;
  | 
| 
476
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( $data eq '' || $code != 200 ) {
  | 
| 
477
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $URLS{$uri}{status} = 404 ;
  | 
| 
478
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return ;
  | 
| 
479
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
480
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   else {
  | 
| 
481
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $URLS{$uri}{status} = 200 ;
  | 
| 
482
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
483
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
484
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( is_file_hidden(undef , $data) ) {
  | 
| 
485
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $data =~ s/(?:\r\n?|\n)__END__(?:\r\n?|\n).*?$//s ;
  | 
| 
486
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $data =~ s/(?:\r\n?|\n)__DATA__(?:\r\n?|\n).*?$//s ;
  | 
| 
487
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
488
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     open (my $fh,">$TMPFILE") ; binmode($fh) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
489
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print $fh $data ;
  | 
| 
490
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print $fh "\n\n use lib::http 'unlink_tmpfile' ;\n\n" ;
  | 
| 
491
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     close ($fh) ;
  | 
| 
492
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
493
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     open (TMPFILE,$TMPFILE) ; binmode(TMPFILE) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
494
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return \*TMPFILE ;
  | 
| 
495
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
496
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
497
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   open (my $fh,">$new_file") ; binmode($fh) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
498
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   print $fh $data ;
  | 
| 
499
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   close ($fh) ;
  | 
| 
500
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
501
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   utime($fl_time , $fl_time , $new_file) ;
  | 
| 
502
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
503
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return if !-s $new_file ;
  | 
| 
504
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
505
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $new_file ;
  | 
| 
506
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
507
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
508
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
509
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_HEAD #
  | 
| 
510
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ############
  | 
| 
511
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
512
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_head {
  | 
| 
513
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   return if %LIBS_IDX && $LIBS_IDX{lib}{$LIBS_IDX{libs}{$_[0]}[0]} && !$LIBS_IDX{$_[0]} ;
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
514
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return get_url($_[0],1,1) ;
  | 
| 
515
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
516
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
517
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###########
  | 
| 
518
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # GET_URL #
  | 
| 
519
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ###########
  | 
| 
520
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
521
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_url {
  | 
| 
522
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $url , $head , $force ) = @_ ;
  | 
| 
523
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
524
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   unlink_tmpfile() ;
  | 
| 
525
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
526
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   return if !$force && (time - $URLS{$url}{t}) < URI_TIMEOUT && ($URLS{$url}{status} == 404 || $url =~ /\/$/) ;
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
527
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
528
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   #print ">> $url\n" if !$head ;
  | 
| 
529
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
530
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ( $host , $port , $path ) = ( $url =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$, ) ;
  | 
| 
531
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($host !~ /\w/s) { return ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
532
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
533
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ($port eq '' || $port == 0 || $port !~ /^[\d]+$/) { $port = 80 ;}
  | 
| 
 
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
534
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($path eq '') { $path = '/' ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
535
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
536
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $socket ;
  | 
| 
537
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
538
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   for(1..3) {
  | 
| 
539
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $socket = new_socket($host , $port) ;
  | 
| 
540
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     last if $socket ;
  | 
| 
541
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
542
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
543
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $proto = $head ? 'HEAD' : 'GET' ;
  | 
| 
544
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
545
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $netloc = $host ;
  | 
| 
546
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $netloc .= ":$port" if $port != 80 ;
  | 
| 
547
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
548
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   print $socket join("\015\012",
  | 
| 
549
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   "$proto $path HTTP/1.0" ,
  | 
| 
550
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   "Host: $netloc" ,
  | 
| 
551
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ($ACCEPT_GZIP ? 'Accept-Encoding: gzip' : () ) ,
  | 
| 
552
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   "User-Agent: $AGENT" ,
  | 
| 
553
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   'Connection: close' ,
  | 
| 
554
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   '',''
  | 
| 
555
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ) ;
  | 
| 
556
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
557
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $buffer ;
  | 
| 
558
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   while( read($socket, $buffer , 1024*4 , length($buffer) ) ) {
  | 
| 
559
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     #$buffer =~ s/\r\n?/\n/gs ;
  | 
| 
560
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     #print "$buffer\n" ;
  | 
| 
561
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   } ;
  | 
| 
562
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
563
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   close($socket) ;
  | 
| 
564
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
565
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   #print "$buffer\n" ;
  | 
| 
566
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
567
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($headers , $content) = split(/(?:\015\012|\r\n){2}/ , $buffer , 2) ;
  | 
| 
568
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
569
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   ++$STATUS{loads} ;
  | 
| 
570
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $STATUS{bandwidth} += length($buffer) ;
  | 
| 
571
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
572
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( $DEBUG ) {
  | 
| 
573
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print ">> $url\n" ;
  | 
| 
574
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print ">> LOADS> $STATUS{loads}\n" ;
  | 
| 
575
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print ">> BANDWIDTH> ". ( int($STATUS{bandwidth}/1024) ) ."Kb\n" ;
  | 
| 
576
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
577
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
578
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $buffer = undef ;
  | 
| 
579
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
580
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   #print "$headers\n" ;
  | 
| 
581
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
582
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($code) = ( $headers =~ /HTTP[^\s]*[\s]+([\d]+)[\s]+[\w]+?/gsi ) ;
  | 
| 
583
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($type) = ( $headers =~ /Content-Type\:?[\s]+([^\n\r]*)[\n\r]?/gsi ) ;
  | 
| 
584
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($length) = ( $headers =~ /Content-Length\:?[\s]+([^\n\r]*)[\n\r]?/gsi ) ;
  | 
| 
585
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($modf) = ( $headers =~ /Last-Modified\:?[\s]+([^\n\r]*)[\n\r]?/gsi ) ;
  | 
| 
586
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
587
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($modf =~ /,\s+\d+[\s-]+\w+[\s-]+\d+\s+\d+[:-]\d+[:-]\d+/i) {
  | 
| 
588
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($day,$mon,$year,$hour,$min,$sec) = ($modf =~ /,\s+(\d+)[\s-]+(\w+)+[\s-]+(\d+)\s+(\d+)[:-](\d+)[:-](\d+)/i ) ;
  | 
| 
589
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $mon = $MONTHS_EG{lc($mon)} if $mon !~ /^\d+$/ ;
  | 
| 
590
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $modf = timelocal($year,$mon,$day,$hour,$min,$sec) ;
  | 
| 
591
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   } else { $modf = '' ;}
  | 
| 
592
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
593
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( $ACCEPT_GZIP && ($headers =~ /Content-Encoding:\s*gzip/si || $path =~ /\.gz$/i) ) {
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
594
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $content = Compress::Zlib::memGunzip($content) ;
  | 
| 
595
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
596
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
597
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $URLS{$url}{t} = time ;
  | 
| 
598
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $URLS{$url}{status} = $code ;
  | 
| 
599
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
600
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $content = '' if $code != 200 ;
  | 
| 
601
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
602
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return ( ($head ? () : $content) , $code , $modf , $length , $type ) if wantarray ;
  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
603
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
604
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return if $code != 200 ;
  | 
| 
605
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
606
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $code if $head ;
  | 
| 
607
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $content ;
  | 
| 
608
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
609
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
610
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##############
  | 
| 
611
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # NEW_SOCKET #
  | 
| 
612
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##############
  | 
| 
613
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
614
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub new_socket {
  | 
| 
615
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $host , $port ) = @_ ;
  | 
| 
616
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
617
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   my $iaddr = inet_aton($host) || return ;
  | 
| 
618
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   my $paddr = sockaddr_in($port, $iaddr) || return ;
  | 
| 
619
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   my $proto = getprotobyname('tcp') || return ;
  | 
| 
620
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
621
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   socket(SOCK, PF_INET, SOCK_STREAM, $proto) || return ;
  | 
| 
622
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
623
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   connect(SOCK, $paddr) || return ;
  | 
| 
624
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
625
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $sel = select(SOCK) ; $|=1 ; select($sel) ;
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
626
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
627
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return \*SOCK ;
  | 
| 
628
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
629
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
630
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #############
  | 
| 
631
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # TIMELOCAL #
  | 
| 
632
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #############
  | 
| 
633
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
634
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub timelocal {
  | 
| 
635
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $year,$mon,$day,$hour,$min,$sec ) = @_ ; 
  | 
| 
636
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
637
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $year_0 = (gmtime(1))[5] + 1900 ;
  | 
| 
638
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
639
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ($now_sec,$now_min,$now_hour,$now_mday,$now_mon,$now_year) = gmtime( time ) ;
  | 
| 
640
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
641
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if (!$year || $year eq '*' || $year < $year_0) { $year = $now_year ;}
  | 
| 
 
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
642
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
643
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $year_bisexto = 0 ;
  | 
| 
644
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( is_leap_year($year) ) { $year_bisexto = 1 ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
645
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
646
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if (!$mon || $mon eq '*') { $mon = $now_mon }
  | 
| 
 
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
647
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($mon < 1 || $mon > 12 ) { return }
  | 
| 
648
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
649
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif (!$day || $day eq '*') { $day = $now_mday }
  | 
| 
650
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($day < 1 || $day > 31 ) { return }
  | 
| 
651
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   elsif ($mon == 2 && $day > 28) {
  | 
| 
652
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $day = 28 if !check_date($year,$mon,$day) ;
  | 
| 
653
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
654
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($day > check_date($mon) ) { return }
  | 
| 
655
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
656
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if    ($hour eq '') { $hour = 0 }
  | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
657
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($hour eq '*') { $hour = $now_hour }
  | 
| 
658
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($hour == 24) { $hour = 0 }
  | 
| 
659
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($hour < 0 || $hour > 24 ) { return }
  | 
| 
660
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
661
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if    ($min eq '') { $min = 0 }
  | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
662
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($min eq '*') { $min = $now_min }
  | 
| 
663
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($min == 60) { $min = 59 }
  | 
| 
664
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($min < 0 || $min > 60 ) { return }
  | 
| 
665
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
666
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if    ($sec eq '') { $sec = 0 }
  | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
667
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($sec eq '*') { $sec = $now_sec }
  | 
| 
668
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($sec == 60) { $sec = 59 }
  | 
| 
669
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif ($sec < 0 || $sec > 60 ) { return }
  | 
| 
670
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
671
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $timelocal ;
  | 
| 
672
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
673
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $time_day = 60*60*24 ;
  | 
| 
674
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $time_year = $time_day * 365 ;
  | 
| 
675
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       
  | 
| 
676
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   for my $y ($year_0..($year-1)) {
  | 
| 
677
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $timelocal += $time_year ;
  | 
| 
678
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( is_leap_year($y) ) { $timelocal += $time_day ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
679
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
680
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
681
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   for my $m (1..($mon-1)) {
  | 
| 
682
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $month_days = &check_date($m) ;
  | 
| 
683
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $timelocal += $month_days * $time_day ;
  | 
| 
684
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
685
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
686
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ($year_bisexto == 1 && $mon > 2) { $timelocal += $time_day ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
687
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
688
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $timelocal += $time_day * ($day-1) ;
  | 
| 
689
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
690
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $timelocal += 60*60 * $hour ;
  | 
| 
691
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $timelocal += 60 * $min ;
  | 
| 
692
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   $timelocal += $sec ;
  | 
| 
693
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
694
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $timelocal ;
  | 
| 
695
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
696
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
697
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ################
  | 
| 
698
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # IS_LEAP_YEAR #
  | 
| 
699
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ################
  | 
| 
700
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
701
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub is_leap_year { 
  | 
| 
702
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $year ) = @_ ;
  | 
| 
703
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
704
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if    ($year == 0) { return 1 ;}
  | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
705
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif (($year % 4000) == 0) { return 0 ;}
  | 
| 
706
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif (($year % 400) == 0) { return 1 ;}
  | 
| 
707
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif (($year % 100) == 0) { return 0 ;}
  | 
| 
708
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   elsif (($year % 4) == 0) { return 1 ;}
  | 
| 
709
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return 0 ;
  | 
| 
710
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
711
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
712
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##############
  | 
| 
713
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # CHECK_DATE #
  | 
| 
714
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##############
  | 
| 
715
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
716
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub check_date { 
  | 
| 
717
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   shift if $_[0] !~ /^\d+$/ ;
  | 
| 
718
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
719
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my ( $year , $month , $day ) ;
  | 
| 
720
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
721
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($#_ == 2) { ( $year , $month , $day ) = @_ ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
722
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($#_ == 1) { ( $month , $day ) = @_ ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
723
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($#_ == 0) { ( $month ) = @_ ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
724
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
725
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ($#_ > 0) {
  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
726
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ($year eq '')  { $year = 1970 }
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
727
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ($month eq '') { $month = 1 }
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
728
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ($day eq '')   { $day = 1 }
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
729
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
730
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my @months_days = @MONTHS_DAYS ;
  | 
| 
731
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
732
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ( is_leap_year($year) ) { $months_days[2] = 29 ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
733
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
734
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ($day <= $months_days[$month]) { return 1 ;}
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
735
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     else { return ;}
  | 
| 
736
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
737
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   elsif ($#_ == 0) {
  | 
| 
738
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     if ($month eq '') { return ; }
  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
739
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $MONTHS_DAYS[$month] ;
  | 
| 
740
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
741
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
742
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return undef ;
  | 
| 
743
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
744
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
745
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##################
  | 
| 
746
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # IS_FILE_HIDDEN #
  | 
| 
747
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##################
  | 
| 
748
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
749
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub is_file_hidden {
  | 
| 
750
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my $file = shift ;
  | 
| 
751
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
752
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $data_ref = \$_[0] ;
  | 
| 
753
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
754
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( -e $file ) {
  | 
| 
755
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $buffer ;
  | 
| 
756
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     open (FLH,$file) ;
  | 
| 
757
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     1 while( read(FLH, $buffer , 1024*8 , length($buffer) ) ) ;
  | 
| 
758
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     close (FLH) ;
  | 
| 
759
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $data_ref = \$buffer ;
  | 
| 
760
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
761
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
762
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( $$data_ref =~ /(?:^|\r\n?|\n)[ \t]*#[ \t#]*lib:*http[ \t]*=>[ \t]*hidden_?file\s/si ) {
  | 
| 
763
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return 1 ;
  | 
| 
764
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
765
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
766
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return ;
  | 
| 
767
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
768
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
769
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##################
  | 
| 
770
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # UNLINK_TMPFILE #
  | 
| 
771
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##################
  | 
| 
772
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
773
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub unlink_tmpfile {
  | 
| 
774
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
3
 | 
   close TMPFILE ;
  | 
| 
775
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
776
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
4
 | 
   if ( $_[0] ) {
  | 
| 
777
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
8
 | 
     open (TMPFILE,">$TMPFILE") ;
  | 
| 
778
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
     print TMPFILE "\n" ;
  | 
| 
779
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
     close (TMPFILE) ;
  | 
| 
780
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
781
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
782
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
9
 | 
   unlink $TMPFILE ;
  | 
| 
783
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ##print "UNLINK TMPFILE: $TMPFILE [". $INC{'BotCore.pm'} ."]\n" ;
  | 
| 
784
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ##
  | 
| 
785
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
786
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
787
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
788
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # TMPDIR #
  | 
| 
789
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
790
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
791
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub tmpdir {
  | 
| 
792
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
793
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my @dir_list = (
  | 
| 
794
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    @ENV{qw(TMPDIR TEMP TMP)},
  | 
| 
795
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    qw(
  | 
| 
796
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     C:/temp
  | 
| 
797
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     C:/tmp
  | 
| 
798
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     SYS:/temp
  | 
| 
799
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     SYS:/tmp
  | 
| 
800
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     /tmp
  | 
| 
801
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     /
  | 
| 
802
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    ),
  | 
| 
803
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ) ;
  | 
| 
804
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
805
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $tmpdir ;
  | 
| 
806
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $dir_list_i ( @dir_list ) {
  | 
| 
807
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     next if !$dir_list_i ;
  | 
| 
808
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     if ( -d $dir_list_i && -w $dir_list_i && -r $dir_list_i ) {
  | 
| 
 
 | 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
809
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       $tmpdir = $dir_list_i ;
  | 
| 
810
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
       last ;
  | 
| 
811
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
812
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
813
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
814
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
   if ( !$tmpdir && -w '.' ) {
  | 
| 
815
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my @lyb = (a..z,0..9) ;
  | 
| 
816
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $rand ;
  | 
| 
817
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $rand .= $lyb[ rand(@lyb) ] while length($rand) < 6 ;
  | 
| 
818
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $dir = "./$rand-tmp" ;
  | 
| 
819
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     mkdir($dir , 0777) ;
  | 
| 
820
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     $tmpdir = $dir if -d $dir && -w $dir ;
  | 
| 
821
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
822
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
823
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return $tmpdir ;
  | 
| 
824
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
825
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
826
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
827
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # MKPATH #
  | 
| 
828
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
829
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
830
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub mkpath {
  | 
| 
831
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $path ) = @_ ;
  | 
| 
832
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
833
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @path = split(/[\\\/]/ , $path) ;
  | 
| 
834
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
835
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $path ;
  | 
| 
836
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
837
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   if ( $path[0] =~ /^\w+:$/ ) {
  | 
| 
838
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $path .= shift(@path) . '/' ;
  | 
| 
839
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
840
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
841
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $path_i ( @path ) {
  | 
| 
842
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $path .= $path_i . '/' ;
  | 
| 
843
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     next if -e $path ;
  | 
| 
844
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     mkdir($path , 0777) ;
  | 
| 
845
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
846
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
847
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return 1 ;
  | 
| 
848
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
849
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
850
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
851
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # RMTREE #
  | 
| 
852
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ##########
  | 
| 
853
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
854
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub rmtree {
  | 
| 
855
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
   my ( $path ) = @_ ;
  | 
| 
856
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
857
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my @subdirs = scandir($path) ;
  | 
| 
858
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
859
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   my $main = $subdirs[0] ;
  | 
| 
860
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
861
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   foreach my $subdirs_i ( reverse @subdirs ) {
  | 
| 
862
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     opendir (my $DH, $subdirs_i);
  | 
| 
863
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
864
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     while (my $filename = readdir $DH) {
  | 
| 
865
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
       if ($filename ne '.' && $filename ne '..') {
  | 
| 
866
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         my $file = "$subdirs_i/$filename" ;
  | 
| 
867
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         next if -d $file ;
  | 
| 
868
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         unlink($file) ;
  | 
| 
869
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       }
  | 
| 
870
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }
  | 
| 
871
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     
  | 
| 
872
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     closedir ($DH) ;
  | 
| 
873
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
874
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     rmdir($subdirs_i) ;
  | 
| 
875
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
876
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
877
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
   return 1 ;
  | 
| 
878
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
879
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
880
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #######
  | 
| 
881
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # END #
  | 
| 
882
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #######
  | 
| 
883
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
884
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub end {
  | 
| 
885
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
4
 | 
   unlink_tmpfile(1) ;
  | 
| 
886
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   
  | 
| 
887
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
   foreach my $TMPDIRS_i ( @TMPDIRS ) {
  | 
| 
888
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print ">> UNLINK> $TMPDIRS_i\n" if $DEBUG ;
  | 
| 
889
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     rmtree($TMPDIRS_i) ;
  | 
| 
890
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   }
  | 
| 
891
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
892
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6
 | 
   exit ;
  | 
| 
893
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }
  | 
| 
894
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
895
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
208
 | 
 sub END { &end ;}
  | 
| 
896
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
897
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #######
  | 
| 
898
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # END #
  | 
| 
899
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #######
  | 
| 
900
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
901
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;
  | 
| 
902
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
  | 
| 
903
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 __END__
  |