Bug 1818 - add sanity check version check
: add sanity check version check
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 6.1.0
: PC All
: P2 minor (vote)
: Future
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-14 03:52 UTC by Michael Herger
Modified: 2008-12-15 13:06 UTC (History)
0 users

See Also:
Category: ---


Attachments
check for correct download URL (520 bytes, patch)
2005-07-14 03:58 UTC, Michael Herger
Details | Diff
check http error code (814 bytes, patch)
2005-07-14 14:05 UTC, Michael Herger
Details | Diff
only accept status code 2xx/3xx (2.02 KB, patch)
2005-07-14 23:11 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Herger 2005-07-14 03:52:06 UTC
checkVersionCB does accept any non zero value from the update check and displays it on home.html. 
Under certain circumstances this can be anything but a regular link to the update (see eg. http://forums.
slimdevices.com/showthread.php?p=44358). A simple sanity check should be added to prevent output of 
wrong contents.
Comment 1 Michael Herger 2005-07-14 03:58:55 UTC
Created attachment 635 [details]
check for correct download URL
Comment 2 Blackketter Dean 2005-07-14 05:35:40 UTC
Don't do that.  It means that the web site organization is hard coded in some versions of slimserver.  
Instead, we should check for an error from the HTTP request and not display content, just a warning 
message:

There was a problem checking for a SlimServer update.  (Error code 407)

Patches anyone?
Comment 3 Michael Herger 2005-07-14 05:54:54 UTC
That's why I started the thread about SimpleAsyncHTTP and what's throwing errors. It's in there that http 
responses could/should be checked. In case of a 40x or 50x it should imho not call the success callback.
Comment 4 Michael Herger 2005-07-14 14:05:47 UTC
Created attachment 637 [details]
check http error code

A slightly more intelligent sanity check.
Comment 5 Blackketter Dean 2005-07-14 14:18:07 UTC
Closer.  That string needs to be in the strings.txt file so it can be localized. 

Also, let's catch any  non-200 error (if it's sending back garbage, it may not be 4xx or 5xx, or if it can't 
connect at all...)
Comment 6 Michael Herger 2005-07-14 22:38:34 UTC
I'll try Robert's code:

>  Try wrapping the setting and chomping of $::newVersion in this:
> if ($http->{'code'} ~= /^2\d\d/) { ... }

What about 3xx errors?
Comment 7 Michael Herger 2005-07-14 23:11:31 UTC
Created attachment 640 [details]
only accept status code 2xx/3xx

Added l10n as well. But the server's answer is english only  - and this seems
more important to me than a string that gets lost in the log file ;-)
Comment 8 Michael Herger 2005-07-15 16:09:52 UTC
Committed change 3716.
Comment 9 James Richardson 2008-12-15 13:06:52 UTC
This bug appears to have been fixed in the latest release!

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.

Make sure to include the version number of the software you are seeing the error with.