On May 30, 2012, at 1:18 AM, louis wrote: > Hello, > > I am currently working on a plugin to deal with flv seeking. > > I just want to do the same thing as the following lighttpd module : > http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd > <http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd> > > So, I added a hook at REQUEST_HDR_HOOK to: > > - read a GET parameter named start (/test.flv?start=12345) wich > contain the position in the file > - remove the parameter to have something like /test.flv > - add a Range parameter with the start value : Range: bytes=12345- so the > request should be at this point the same as a normal request with Range > parameter.
This sounds like a reasonable approach. It's best if you work against trunk or the upcoming 3.1.4 release, since there have been some significant Range handling improvements. > > But unfortunately it doesn't work: > > * Sometimes, Traffic Servers correctly uses the cache but sends a "200 > ok" after my range replacement. The video works. > * It sometimes contact my origin server and send back a "206 Partial > Content" return code. In this case, the video will not work. It > occurs when i'm already downloading the same files. (Looks to be a > race condition). > * Sometimes when i set the start value at the end of the file TS seems > to be hanged somewhere and will resume after more than 20 seconds. > > > My main problem is that it lacks some documentation on the functions on the > Doxygen and a lot of link are broken. Yeh that's unfortunate. The old V2 docs are still largely accurate; you just have to mentally rename a lot of the functions, see <http://trafficserver.apache.org/docs/v2/sdk/>. Newer APIs typically have helpful comments in ts/ts.h. > So can you help me to resolve my problem by watching my source code and > explaining me my errors. Sure, post a link to the source if you can ... > If you can't do you have some tips on the more useful functions. > > Thank you for helping!