Revert "Chunk videoplayback response to avoid throttling"

This reverts commit 818cd2454d.
This commit is contained in:
Omar Roth
2019-07-01 10:45:09 -05:00
parent 0632a2d3c8
commit 041debcd93
3 changed files with 30 additions and 65 deletions

View File

@@ -656,7 +656,7 @@ def proxy_file(response, env)
end
# https://stackoverflow.com/a/44802810 <3
def copy_in_chunks(input, output, chunk_size = 8192)
def copy_in_chunks(input, output, chunk_size = 4096)
size = 1
while size > 0
size = IO.copy(input, output, chunk_size)

View File

@@ -347,21 +347,3 @@ def subscribe_pubsub(topic, key, config)
return client.post("/subscribe", form: body)
end
def parse_range(range)
if !range
return 0, nil
end
ranges = range.lchop("bytes=").split(',')
ranges.each do |range|
start_range, end_range = range.split('-')
start_range = start_range.to_i? || 0
end_range = end_range.to_i?.try &.+ 1
return start_range, end_range
end
return 0, nil
end