Bug 4376 - accessing log.txt causes a crash
: accessing log.txt causes a crash
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 6.5.1
: All Other
: P2 major (vote)
: ---
Assigned To: Chris Owens
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-15 14:05 UTC by KDF
Modified: 2008-12-18 11:11 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KDF 2006-10-15 14:05:14 UTC
From the forum: 

2006-10-15 21:31:01.5853 Generating response for (txt, text/plain) log.txt
2006-10-15 21:31:01.5862 generating from include.html
Can't use an undefined value as an ARRAY reference at /usr/local/slimserver/Slim/Web/HTTP.pm line 2137.
061015 21:31:01 [Note] /usr/local/slimserver/Bin/i386-linux/mysqld: Normal shutdown

Why are we trying to create a status headers for log.txt?


This is due to the recent change 10299 to fix salling clicker.
I propose not bothering to call buildStatusHeaders for log.txt. thus, this patch:


Index: Slim/Web/HTTP.pm
===================================================================
--- Slim/Web/HTTP.pm    (revision 10341)
+++ Slim/Web/HTTP.pm    (working copy)
@@ -940,7 +940,7 @@
                ($body, $mtime, $inode, $size) = getStaticContent($path, $params);
           }
 
-       } elsif ($path =~ /status\.txt/ || $path =~ /log\.txt/) {
+       } elsif ($path =~ /(status)\.txt/ || $path =~ /(log)\.txt/) {
 
           # if the HTTP client has asked for a text file, then always return the text on the display
           $contentType = "text/plain";
@@ -950,7 +950,7 @@
 
           # This code is deprecated. Jonas Salling is the only user
           # anymore, and we're trying to move him to use the CLI.
-          buildStatusHeaders($client, $response, $p);
+          buildStatusHeaders($client, $response, $p) if $1 eq 'status';
 
           if ($path =~ /status/) {
Comment 1 KDF 2006-10-15 14:07:11 UTC
affects 6.5.1 builds, so probably should be corected in some way by 6.5.1 release.
Comment 2 KDF 2006-10-15 14:31:26 UTC
fixed at change 10347 in 6.5.1 and change 10346 in trunk