The reason I cannot set the content length is because I encode audio on-the-fly. It takes a minute average to encode such an audio file (assuming just one file is encoded at a time) and it would result in a timeout on the client side. In my first tests I waited for the file encoding to finish and then send the file, including content length, but ofcourse I cannot let the user wait that long.
The reason I must use http 1.0 is because apparantly winamp (or similar players, I think, too) do not handle chunked encoding correctly. I have mentioned this on the winamp forums already and hope they will work on it. Meanwhile I will try the restrictedUserAgents attribute and see if I can force http 1.0 Lukas Am 13.01.2004 21:25:43, schrieb Justin Ruthenbeck <[EMAIL PROTECTED]>: > >Alternately, you can use HTTP 1.1, but buffer the entire response in your >Servlet (create a copy of whatever you're sending in memory), then at the >end of your servlet manually set the Content-Length header, then output >the response. > >This is fine for small responses, but problematic for large responses >since data is no longer streamed. > >justin > > >At 12:13 PM 1/13/2004, you wrote: > >>>My questions: >>>- how to disable chunked encoding even when there is no content length? >>> >>>- why does tomcat not use chunked encoding when sending mp3 files (and >>>no content length is set) >>> and why does'nt it for ogg? >>> >> >>See RFC 2616. Using either the Content-Length header OR chunked encoding >>is a MUST in HTTP 1.1. >> >>Something different is using HTTP 1.0. >> >>The only (HTTP) ways of sending an unknown length file are: >>a) Using HTTP 1.0, and closing the connection at the end (but the client >>cannot know for sure that the file end has arrived, and I am not even >>sure it is standards compliant). >>b) Using HTTP 1.1, and using chunked encoding. >> >>Yours, >> >>Antonio Fiol >> >> > > >______________________________________________ >Justin Ruthenbeck >Software Engineer, NextEngine Inc. >justinr - AT - nextengine DOT com >Confidential. See: >http://www.nextengine.com/confidentiality.php >______________________________________________ > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
