Index: Slim/Web/HTTP.pm =================================================================== --- Slim/Web/HTTP.pm (revision 3094) +++ Slim/Web/HTTP.pm (working copy) @@ -1680,6 +1680,7 @@ sub closeHTTPSocket { my $httpClient = shift; + my $streaming = shift; Slim::Networking::Select::addRead($httpClient, undef); Slim::Networking::Select::addWrite($httpClient, undef); @@ -1693,6 +1694,16 @@ delete($keepAlives{$httpClient}); delete($peerclient{$httpClient}); + # Fix for bug 1289. A close on its own wasn't always actually + # sending a FIN or RST packet until significantly later for + # streaming connections. The call to shutdown seems to be a + # little more assertive about closing the socket. Windows-only + # for now, but could be considered for other platforms and + # non-streaming connections. + if ($streaming && Slim::Utils::OSDetect::OS() eq 'win') { + $httpClient->shutdown(2); + } + $httpClient->close(); undef($httpClient); $connected--; @@ -1717,7 +1728,7 @@ } } - closeHTTPSocket($httpClient); + closeHTTPSocket($httpClient, 1); return; }