0

How a streaming (e.g. a sound or video) HTTP server should report failure in the DB from which it streams (when it already streams, 503 header cannot be generated).

The client should be able to differentiate if it received complete file or its beginning only.

I am especially interested how to return such errors in Rust frameworks.

2
  • Which protocols are you using for this? If you know the size in advance, what prevents you from sending Content-Length to the client and comparing with the actual data received size? Commented Jan 22, 2022 at 21:23
  • JavaScript .fetch() method. Commented Jan 23, 2022 at 13:31

1 Answer 1

0

The HTTP server library you are using should be taking care of this for you.

If you are writing your own server for some reason, you should use the chunked encoding method, which has a clear way to specify that the stream is over (a zero-lengthed chunk).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.