File: apache_mp3_7.diff

package info (click to toggle)
libapache2-mod-perl2 2.0.9~1624218-2%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 11,912 kB
  • ctags: 4,588
  • sloc: perl: 95,064; ansic: 14,527; makefile: 49; sh: 18
file content (174 lines) | stat: -rw-r--r-- 4,932 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
--- Apache/MP3.pm.7	2003-06-06 17:04:27.000000000 +1000
+++ Apache/MP3.pm	2003-06-06 17:13:26.000000000 +1000
@@ -129,7 +129,7 @@
   my $self = shift;
 
   $self->r->send_http_header( $self->html_content_type );
-  return OK if $self->r->header_only;
+  return Apache::OK if $self->r->header_only;
 
   print start_html(
 		   -lang => $self->lh->language_tag,
@@ -246,20 +246,20 @@
       $self->send_playlist(\@matches);
     }
 
-    return OK;
+    return Apache::OK;
   }
 
   # this is called to generate a playlist for selected files
   if (param('Play Selected')) {
-    return HTTP_NO_CONTENT unless my @files = param('file');
+    return Apache::HTTP_NO_CONTENT unless my @files = param('file');
     my $uri = dirname($r->uri);
     $self->send_playlist([map { "$uri/$_" } @files]);
-    return OK;
+    return Apache::OK;
   }
 
   # otherwise don't know how to deal with this
   $self->r->log_reason('Invalid parameters -- possible attempt to circumvent checks.');
-  return FORBIDDEN;
+  return Apache::FORBIDDEN;
 }
 
 # this generates the top-level directory listing
@@ -273,7 +273,7 @@
     my $query = $self->r->args;
     $query = "?" . $query if defined $query;
     $self->r->header_out(Location => "$uri/$query");
-    return REDIRECT;
+    return Apache::REDIRECT;
   }
 
   return $self->list_directory($dir);
@@ -289,9 +289,9 @@
 
   if ($is_audio && !$self->download_ok) {
     $self->r->log_reason('File downloading is forbidden');
-    return FORBIDDEN;
+    return Apache::FORBIDDEN;
   } else {
-    return DECLINED;  # allow Apache to do its standard thing
+    return Apache::DECLINED;  # allow Apache to do its standard thing
   }
 
 }
@@ -302,17 +302,17 @@
   my $self = shift;
   my $r = $self->r;
 
-  return DECLINED unless -e $r->filename;  # should be $r->finfo
+  return Apache::DECLINED unless -e $r->filename;  # should be $r->finfo
 
   unless ($self->stream_ok) {
     $r->log_reason('AllowStream forbidden');
-    return FORBIDDEN;
+    return Apache::FORBIDDEN;
   }
 
   if ($self->check_stream_client and !$self->is_stream_client) {
     my $useragent = $r->header_in('User-Agent');
     $r->log_reason("CheckStreamClient is true and $useragent is not a streaming client");
-    return FORBIDDEN;
+    return Apache::FORBIDDEN;
   }
 
   return $self->send_stream($r->filename,$r->uri);
@@ -322,12 +322,12 @@
 sub send_playlist {
   my $self = shift;
   my ($urls,$shuffle) = @_;
-  return HTTP_NO_CONTENT unless @$urls;
+  return Apache::HTTP_NO_CONTENT unless @$urls;
   my $r = $self->r;
   my $base = $self->stream_base;
 
   $r->send_http_header('audio/mpegurl');
-  return OK if $r->header_only;
+  return Apache::OK if $r->header_only;
 
   # local user
   my $local = $self->playlocal_ok && $self->is_local;
@@ -377,7 +377,7 @@
       $r->print ("$base$_?$stream_parms$CRLF");
     }
   }
-  return OK;
+  return Apache::OK;
 }
 
 sub stream_parms {
@@ -468,7 +468,7 @@
   my $self = shift;
   my $dir  = shift;
 
-  return DECLINED unless -d $dir;
+  return Apache::DECLINED unless -d $dir;
 
   my $last_modified = (stat(_))[9];
 
@@ -478,15 +478,15 @@
     my ($time, $ver) = $check =~ /^([a-f0-9]+)-([0-9.]+)$/;
 
     if ($check eq '*' or (hex($time) == $last_modified and $ver == $VERSION)) {
-      return HTTP_NOT_MODIFIED;
+      return Apache::HTTP_NOT_MODIFIED;
     }
   }
 
-  return DECLINED unless my ($directories,$mp3s,$playlists,$txtfiles)
+  return Apache::DECLINED unless my ($directories,$mp3s,$playlists,$txtfiles)
     = $self->read_directory($dir);
 
   $self->r->send_http_header( $self->html_content_type );
-  return OK if $self->r->header_only;
+  return Apache::OK if $self->r->header_only;
 
   $self->page_top($dir);
   $self->directory_top($dir);
@@ -514,7 +514,7 @@
   print hr                         unless %$mp3s;
   print "\n<!-- end main -->\n";
   $self->directory_bottom($dir);
-  return OK;
+  return Apache::OK;
 }
 
 # print the HTML at the top of the page
@@ -1268,8 +1268,8 @@
 
   my $mime = $r->content_type;
   my $info = $self->fetch_info($file,$mime);
-  return DECLINED unless $info;  # not a legit mp3 file?
-  my $fh = $self->open_file($file) || return DECLINED;
+  return Apache::DECLINED unless $info;  # not a legit mp3 file?
+  my $fh = $self->open_file($file) || return Apache::DECLINED;
   binmode($fh);  # to prevent DOS text-mode foolishness
 
   my $size = -s $file;
@@ -1317,7 +1317,7 @@
   $r->print("Content-Length: $size$CRLF");
   $r->print("Content-Type: $mime$CRLF");
   $r->print("$CRLF");
-  return OK if $r->header_only;
+  return Apache::OK if $r->header_only;
 
   if (my $timeout = $self->stream_timeout) {
     my $seconds  = $info->{seconds};
@@ -1330,12 +1330,12 @@
       $bytes -= $b;
       $r->print($data);
     }
-    return OK;
+    return Apache::OK;
   }
 
   # we get here for untimed transmits
   $r->send_fd($fh);
-  return OK;
+  return Apache::OK;
 }
 
 # called to open the MP3 file