User:Void Singer/Red Tea
What is it?
Red Tea is an open source file system back end custom built for Teacup in support of LSL's HTTP-in MOAP functionality. It builds on the work of Several other people including but not limited to, Kelly Linden, Torley Linden, Tali Rosca, Vegas Silverweb, and special mentions to Kate and/or Edelman Linden (whoever wrote the original align for LSL). The idea is to make it easy to serve web content from within SL, with a minimum of work or understanding, in the most standards compliant and flexible way possible.
How does it work?
When Red Tea starts, it looks for any notecards in the prim, reads them, converting and wrapping any notecards name ending with .tsp (Teacup Server Page) and storing them in memory, waiting for a request from the server. if the prim contents change, it waits 3 seconds then resets itself to start again. if the server requests a stored file, the file is sent with a 200 "success" code. if the file does not exist, a 404 "not found" code is sent.
Red Tea reads a modified html page from a notecard
- For html content, the notecard name should end with ".tsp" (Teacup server page)
- For html content, the notecard contents are limited to what's valid inside a normal html "body" tag.
- no more than 255 bytes per line in the notecard (this is an LSL limitation)
why all the tea jokes?
So why all the tea jokes? Well I happen to like steam punk stuff, and it has a sort of pseudo-victorian-era feel to it, but in all truth it was sparked by a bit of geek humor. There was an old april fool's joke passed around as an official sounding memo about creating a protocol for controlling coffee pots with http (back before they actually started making net enabled appliances) and part of that proposal was that teapots should return an error response "418 I'm a teapot" if you tried to make it brew coffee... since these servers are small, and 418 is safe to use internally because it wouldn't normally be encountered, I figured hey, Teapot --> Teacup --> Victorian Imagery --> Steam Punk --> teacup that is it's own teapot --> SIP --> many different types of tea --> Success!
... And thus was born the SIP, Teapot server, and Red Tea file system
<lsl>/*( Red Tea v0.2 )*/
//-- Master Handling lists list gLstNom; list gLstTxt;
//-- These track memory while loading integer gIntCap; integer gIntBfr;
//-- these handle the notecard loading key gKeyQry; string gStrNcd; integer gIntNcd; string gStrTmp;
} /*//-- License Text --//*/ /*// Free to copy, use, modify, distribute, or sell, with attribution. //*/ /*// (C)2011 (CC-BY) [ http://creativecommons.org/licenses/by/3.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ /*// All usages must contain a plain text copy of the previous 2 lines. //*/ /*//-- --//*/</lsl>
Compatible Servers and Extensions
Teacup - Server front end
- Extra line break inserted at the end of every file
- If the server request a file that has a notecard, before that notecard is finished loading, a 200 "Success" response will be generated and an empty file will be served.
- Loading large files before small ones may lock them out if the buffer limit is reached. Try to read small files first. (they are read in alphabetic order)
- None really, the intent is to be an example. other "flavors" can use differnt methods.
NOTE TO WIKI EDITORS
I have kept this page as a sub page of my user page to denote that it should NOT be edited except to correct errors, add confirmed bugs, or add related resources.
The intent is to ensure executive control is in one person's hands to retain a cohesive vision of it's development.
If you have an improvement suggestion, or request, please use the discussion page.