Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Http looping on 416
23-11-2016, 03:28 PM
Post: #4
RE: Http looping on 416
(23-11-2016 03:14 PM)medoc92 Wrote:  
(23-11-2016 01:52 PM)simonc Wrote:  What HTTP headers does your server return? I'm particularly interested in the HTTP version it uses (1.0 or 1.1) and whether it reports a content length, uses chunked transfer encoding or just writes unspecified amounts of data then closes the connection.

If your server does report a length, are that many bytes transferred?

Here is the initial request from the player:
Code:
GET /stream1.mp3?player=00:24:1d:de:68:68 HTTP/1.1
Host: 192.168.4.4:9010
Connection: close
Icy-MetaData: 1
Range: bytes=0-
The response from the server:
Code:
HTTP/1.1 200 OK
Connection: close
Content-Type:  audio/mpeg
Date: Wed, 23 Nov 2016 14:33:39 GMT

(data follows)

I don't think that's a valid response. Shouldn't a HTTP 1.1 server supply either a Content-Length header or set Transfer-Encoding: chunked? It looks like your server's response is using the old HTTP 1.0 approach of just closing the connection to indicate end of stream; this isn't valid in HTTP 1.1.

That said, from a quick look at the code, I don't think ProtocolHttp will cope properly with HTTP 1.0 servers that don't specify Content-Length. I'll log this as a bug but I'm afraid it won't be a high priority to address.

Any of the following should get your server working with ohPipeline:
  • Include Content-Length in your response.
  • If you don't always know the length in advance, use chunking in your response. When you reach the end of the resource you're serving, just send a 0 length chunk to indicate end-of-stream
  • If neither of the above suit, you could recognise a range request beyond the end of the resource and return a Content-Length: 0 header to indicate no data remains
Find all posts by this user


Messages In This Thread
Http looping on 416 - medoc92 - 23-11-2016, 07:47 AM
RE: Http looping on 416 - simonc - 23-11-2016, 01:52 PM
RE: Http looping on 416 - medoc92 - 23-11-2016, 03:14 PM
RE: Http looping on 416 - simonc - 23-11-2016 03:28 PM
RE: Http looping on 416 - simoncn - 23-11-2016, 03:47 PM
RE: Http looping on 416 - simonc - 23-11-2016, 03:52 PM
RE: Http looping on 416 - medoc92 - 23-11-2016, 04:13 PM
RE: Http looping on 416 - simonc - 23-11-2016, 03:30 PM
RE: Http looping on 416 - medoc92 - 24-11-2016, 05:31 PM
RE: Http looping on 416 - simoncn - 24-11-2016, 06:21 PM

Forum Jump: