Bugzilla – Bug 9869
HTTP GET with request method-body causes error from Squid proxy
Last modified: 2009-07-31 10:31:28 UTC
I get many messages like this in my SqueezeCenter server log: [08-11-02 01:30:27.0130] Slim::Networking::Discovery::Players::_players_error (140) Unable to get players: 411 Length Required There are two SqueezeCenter instances running in my network, one on a Windows PC and another on a gateway machine that also runs the Squid Web proxy. The messages appear in log files on the PC. The "411 Length Required" error is being generated by Squid. What's happening is, SqueezeCenter on the PC tries to send an HTTP GET request to SqueezeCenter on the gateway (probably to get a list of available players), and since the PC is configured to use a proxy, the request goes to Squid. However, the HTTP request contains a non-zero Content-Length header, which is not strictly correct HTTP. Squid denies such requests by default. From Squid's manual: > Squid defaults to deny GET and HEAD requests with request entities, > as the meaning of such requests are undefined in the HTTP standard > even if not explicitly forbidden. I suspect the error can be fixed by simply changing line 101 of Slim/Networking/Discovery/Players.pm, and replacing $http->get() with $http->post().
> I suspect the error can be fixed by simply changing line 101 of > Slim/Networking/Discovery/Players.pm, and replacing $http->get() with > $http->post(). Could you please give this a try?
> Could you please give this a try? At first I didn't know how, because this was on Windows. After some unsuccessful attempts trying to use Cygwin's perl interpreter, I have installed ActivePerl and can now run scripts modified by myself. I tried the change I suggested, and it appears to work correctly. Before I changed the script, when I ran slimsever.pl, it was printing "411 Length Required" in the log file. After I changed the script to use http->get() instead of http->post(), I no longer see any new error messages in the log file. There are now two items I can select in the "Choose player" drop down menu on the SqueezeCenter Web interface: the name of the other machine (gateway box) running SqueezeCenter, and the name of the player (SqueezeBox Receiver) that is currently connected to the other machine. I suppose this means that communication between the two SqueezeCenter instances is working properly. (However, this may be another issue, but in the gateway machines's drop down menu, I only see the name of the SqueezeBox Receiver, and I do not see and never have seen the name of the Windows PC there. The gateway box does not report any "411 Length Required" errors, even though it is configured to use the same Squid proxy.) Windows PC: SqueezeCenter 7.2.1 ActivePerl 5.8.8 Build 824 Windows 2000 SP4 gateway: SqueezeCenter 7.2.1 perl v5.8.8 built for i486-linux-gnu-thread-multi Debian GNU/Linux 4.0
> After I changed the script to use http->get() instead of http->post(), I no > longer see any new error messages in the log file. Sorry, this was the other way around. I had changed the script to use http->post(), where it was using http->get().
> (However, this may be another issue, but in the gateway machines's drop down > menu, I only see the name of the SqueezeBox Receiver, and I do not see and > never have seen the name of the Windows PC there. > The gateway box does not report any "411 Length Required" errors, even though > it is configured to use the same Squid proxy.) I should also note that, I have not applied the suggested fix to the SqueezeCenter scripts running on the gateway machine. However, I have added a "request_entities on" line to the Squid configuration file, that should have the same effect. (I temporarily removed the "request_entities on" line when I tested the program on Windows.)
Andy thinks this is a bug, it's sending a post request using 'get'
change 23896 - use POST instead of GET method. Please re-open if this didn't fix your issue. Thanks!
This bug has been fixed in the 7.3.0 release version of SqueezeCenter! Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already. If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Reduce number of active targets for SC