Skip to content

Commit 331d5c1

Browse files
Theo van Hoeseloalders
authored andcommitted
Rename variables
can not remember 2-letter abreviation more than 100 lines below
1 parent 973ac49 commit 331d5c1

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

lib/HTTP/Daemon.pm

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ READ_HEADER:
192192
}
193193

194194
# Find out how much content to read
195-
my $te = $r->header('Transfer-Encoding');
196-
my $ct = $r->header('Content-Type');
197-
my $len = $r->header('Content-Length');
195+
my $tr_enc = $r->header('Transfer-Encoding');
196+
my $ct_type = $r->header('Content-Type');
197+
my $ct_len = $r->header('Content-Length');
198198

199199
# Act on the Expect header, if it's there
200200
for my $e ($r->header('Expect')) {
@@ -209,7 +209,7 @@ READ_HEADER:
209209
}
210210
}
211211

212-
if ($te && lc($te) eq 'chunked') {
212+
if ($tr_enc && lc($tr_enc) eq 'chunked') {
213213

214214
# Handle chunked transfer encoding
215215
my $body = "";
@@ -280,32 +280,32 @@ READ_HEADER:
280280
$r->push_header($key, $val) if $key;
281281

282282
}
283-
elsif ($te) {
283+
elsif ($tr_enc) {
284284
$self->send_error(501); # Unknown transfer encoding
285-
$self->reason("Unknown transfer encoding '$te'");
285+
$self->reason("Unknown transfer encoding '$tr_enc'");
286286
return;
287287

288288
}
289-
elsif ($len) {
289+
elsif ($ct_len) {
290290

291291
# Plain body specified by "Content-Length"
292-
my $missing = $len - length($buf);
292+
my $missing = $ct_len - length($buf);
293293
while ($missing > 0) {
294294
print "Need $missing more bytes of content\n" if $DEBUG;
295295
my $n = $self->_need_more($buf, $timeout, $fdset);
296296
return unless $n;
297297
$missing -= $n;
298298
}
299-
if (length($buf) > $len) {
300-
$r->content(substr($buf, 0, $len));
301-
substr($buf, 0, $len) = '';
299+
if (length($buf) > $ct_len) {
300+
$r->content(substr($buf, 0, $ct_len));
301+
substr($buf, 0, $ct_len) = '';
302302
}
303303
else {
304304
$r->content($buf);
305305
$buf = '';
306306
}
307307
}
308-
elsif ($ct && $ct =~ m/^multipart\/\w+\s*;.*boundary\s*=\s*("?)(\w+)\1/i) {
308+
elsif ($ct_type && $ct_type =~ m/^multipart\/\w+\s*;.*boundary\s*=\s*("?)(\w+)\1/i) {
309309

310310
# Handle multipart content type
311311
my $boundary = "$CRLF--$2--";
@@ -497,8 +497,8 @@ sub send_redirect {
497497
print $self "Location: $loc$CRLF";
498498

499499
if ($content) {
500-
my $ct = $content =~ /^\s*</ ? "text/html" : "text/plain";
501-
print $self "Content-Type: $ct$CRLF";
500+
my $ct_type = $content =~ /^\s*</ ? "text/html" : "text/plain";
501+
print $self "Content-Type: $ct_type$CRLF";
502502
}
503503
print $self $CRLF;
504504
print $self $content if $content && !$self->head_request;
@@ -537,12 +537,12 @@ sub send_file_response {
537537
local (*F);
538538
sysopen(F, $file, 0) or return $self->send_error(RC_FORBIDDEN);
539539
binmode(F);
540-
my ($ct, $ce) = guess_media_type($file);
540+
my ($mime_type, $file_enc) = guess_media_type($file);
541541
my ($size, $mtime) = (stat _)[7, 9];
542542
unless ($self->antique_client) {
543543
$self->send_basic_header;
544-
print $self "Content-Type: $ct$CRLF";
545-
print $self "Content-Encoding: $ce$CRLF" if $ce;
544+
print $self "Content-Type: $mime_type$CRLF";
545+
print $self "Content-Encoding: $file_enc$CRLF" if $file_enc;
546546
print $self "Content-Length: $size$CRLF" if $size;
547547
print $self "Last-Modified: ", time2str($mtime), "$CRLF" if $mtime;
548548
print $self $CRLF;

0 commit comments

Comments
 (0)