Projet

Général

Profil

Révision 17f78427

ID17f784270ae966ee9a13e9f5104a5b8f925b639e
Parent ef851f0c
Enfant d4320aea, 5b2396a9

Ajouté par Lars Kruse il y a plus de 7 ans

Whitespace cleanup

  • remove trailing whitespace
  • remove empty lines at the end of files

Voir les différences:

plugins/ftp/pureftpd_traffic
54 54
  open LOG, "<$logfile" or print "Can't open logfile!\n";
55 55
  my $last_line;
56 56
  while(<LOG>) {
57
   $last_line = $_ if eof; 
57
   $last_line = $_ if eof;
58 58
  }
59 59
  close LOG;
60 60
  @em = split(/ /,$last_line);
......
77 77
    $put=0,
78 78
    $mti=0,
79 79
    $dsm=0;
80
       
80

  
81 81
 open LOG, "<$logfile";
82 82
 @log=<LOG>;
83 83
 foreach $row (@log) {
84 84
   @parts=split(/ /,$row);
85 85
   $curr_ts = "$parts[3] $parts[4]";
86 86
   $curr_ts =~ s/\[//g;
87
   $curr_ts =~ s/\]//g; 
87
   $curr_ts =~ s/\]//g;
88 88

  
89 89
   if ( Date_Cmp($curr_ts,$last_ts) > 0 ) {
90 90
      if ( $parts[5]=~ /GET/ ) {
91 91
          $get+=int($parts[8]);
92 92
          if ($parts[2] eq "mti") {
93 93
	      $mti+=int($parts[8]);
94
	     }	 
94
	     }
95 95
          if ($parts[2] eq "dsm") {
96 96
	      $dsm+=int($parts[8]);
97
	     }	 
97
	     }
98 98
         }
99 99
      if ( $parts[5]=~ /PUT/ ) {
100 100
          $put-=int($parts[8]);
101 101
          if ($parts[2] eq "mti") {
102 102
	      $mti-=int($parts[8]);
103
	     }	 
103
	     }
104 104
          if ($parts[2] eq "dsm") {
105 105
	      $dsm-=int($parts[8]);
106
	     }	 
106
	     }
107 107
         }
108 108
     }
109 109
 }

Formats disponibles : Unified diff