Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: ServeFile doesn't work for streaming videos anymore #5612

Closed
gopherbot opened this issue Jun 2, 2013 · 3 comments
Closed

net/http: ServeFile doesn't work for streaming videos anymore #5612

gopherbot opened this issue Jun 2, 2013 · 3 comments

Comments

@gopherbot
Copy link

by philipp.hatt:

I'm running go1.1 on linux/amd64, this used to work with go1.0

It seems that range queries are causing problems, most of the ranges don't seem to work.
Put differently, it only works if the range is the full file.

The file size is 1'503'410'669 bytes.

These ranges are working
Range: bytes=0- 
Range: bytes=0-1503410669
Range: bytes=0-1503410668

Any smaller ones are failing
Range: bytes=0-1503410667 // skips only last byte
Range: bytes=1503410614- // last 55 bytes

By not working it means that
a) the browser just won't play the file
b) wget keeps retrying:

> wget -S --header="Range: bytes=0-1503410667" debdev:9000/filehash/dedc
--2013-06-02 09:56:41--  http://debdev:9000/filehash/dedc
Resolving debdev (debdev)... 127.0.1.1
Connecting to debdev (debdev)|127.0.1.1|:9000... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 206 Partial Content
  Accept-Ranges: bytes
  Cache-Control: no-cache
  Content-Length: 1503410668
  Content-Range: bytes 0-1503410667/1503410669
  Content-Type: video/mp4
  Last-Modified: Sun, 24 Feb 2013 17:03:54 GMT
  Date: Sun, 02 Jun 2013 07:56:41 GMT
Retrying.

--2013-06-02 09:56:42--  (try: 2)  http://debdev:9000/filehash/dedc
Connecting to debdev (debdev)|127.0.1.1|:9000... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 206 Partial Content
  Accept-Ranges: bytes
  Cache-Control: no-cache
  Content-Length: 1503410668
  Content-Range: bytes 0-1503410667/1503410669
  Content-Type: video/mp4
  Last-Modified: Sun, 24 Feb 2013 17:03:54 GMT
  Date: Sun, 02 Jun 2013 07:56:42 GMT
Retrying.
@bradfitz
Copy link
Contributor

bradfitz commented Jun 3, 2013

Comment 1:

I can't think of any changes in Go 1.1 that should affect this.
Can you reply with a self-contained, minimal example of code which works differently
between Go 1.0 and Go 1.1?

Labels changed: removed priority-triage.

Owner changed to @bradfitz.

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

Comment 3 by philipp.hatt:

Looks like I've been jumping to conclusions. Using curl instead of wget seems to work,
also by creating that sample I noticed that it must be something else that's problematic.
Sorry for the false alarm.

@bradfitz
Copy link
Contributor

bradfitz commented Jun 4, 2013

Comment 4:

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants