Inheritance diagram for LLHTTPResponder:


Public Member Functions | |
| LLHTTPResponder (const LLHTTPNode &tree, const LLSD &ctx) | |
| ~LLHTTPResponder () | |
Protected Types | |
| STATE_NOTHING | |
| STATE_READING_HEADERS | |
| STATE_LOOKING_FOR_EOS | |
| STATE_DONE | |
| STATE_SHORT_CIRCUIT | |
| enum | EState { STATE_NOTHING, STATE_READING_HEADERS, STATE_LOOKING_FOR_EOS, STATE_DONE, STATE_SHORT_CIRCUIT } |
Protected Member Functions | |
| bool | readLine (const LLChannelDescriptors &channels, buffer_ptr_t buffer, U8 *dest, S32 &len) |
| Read data off of CHANNEL_IN keeping track of last read position. | |
| void | markBad (const LLChannelDescriptors &channels, buffer_ptr_t buffer) |
| Mark the request as bad, and handle appropriately. | |
| EStatus | process_impl (const LLChannelDescriptors &channels, buffer_ptr_t &buffer, bool &eos, LLSD &context, LLPumpIO *pump) |
| Process the data in buffer. | |
Protected Attributes | |
| LLSD | mBuildContext |
| EState | mState |
| U8 * | mLastRead |
| std::string | mVerb |
| std::string | mAbsPathAndQuery |
| std::string | mPath |
| std::string | mQuery |
| std::string | mVersion |
| S32 | mContentLength |
| LLSD | mHeaders |
| const LLHTTPNode & | mRootNode |
Definition at line 424 of file lliohttpserver.cpp.
enum LLHTTPResponder::EState [protected] |
| STATE_NOTHING | |
| STATE_READING_HEADERS | |
| STATE_LOOKING_FOR_EOS | |
| STATE_DONE | |
| STATE_SHORT_CIRCUIT |
Definition at line 479 of file lliohttpserver.cpp.
| LLHTTPResponder::LLHTTPResponder | ( | const LLHTTPNode & | tree, | |
| const LLSD & | ctx | |||
| ) |
| LLHTTPResponder::~LLHTTPResponder | ( | ) |
| void LLHTTPResponder::markBad | ( | const LLChannelDescriptors & | channels, | |
| buffer_ptr_t | buffer | |||
| ) | [protected] |
Mark the request as bad, and handle appropriately.
| channels | The channels to use in the buffer. | |
| buffer | The heap array of processed data. |
Definition at line 547 of file lliohttpserver.cpp.
References HTTP_VERSION_STR, mState, LLMemType::MTYPE_IO_HTTP_SERVER, and STATE_SHORT_CIRCUIT.
Referenced by process_impl(), and readLine().
| LLIOPipe::EStatus LLHTTPResponder::process_impl | ( | const LLChannelDescriptors & | channels, | |
| buffer_ptr_t & | buffer, | |||
| bool & | eos, | |||
| LLSD & | context, | |||
| LLPumpIO * | pump | |||
| ) | [protected] |
Process the data in buffer.
Definition at line 560 of file lliohttpserver.cpp.
References LLPumpIO::addChain(), LLChainIOFactory::build(), CONTEXT_REQUEST(), LLPumpIO::copyCurrentLinkInfo(), DEFAULT_CHAIN_EXPIRY_SECS, end, LLHTTPNode::getProtocolHandler(), HTTP_VERB_DELETE(), HTTP_VERB_GET(), HTTP_VERB_POST(), HTTP_VERB_PUT(), HTTP_VERSION_STR, LLChannelDescriptors::in(), lldebugs, llinfos, mAbsPathAndQuery, LLBufferArray::makeChannelConsumer(), markBad(), mBuildContext, LLPumpIO::LLLinkInfo::mChannels, mContentLength, mHeaders, mLastRead, mPath, LLPumpIO::LLLinkInfo::mPipe, mQuery, mRootNode, mState, LLMemType::MTYPE_IO_HTTP_SERVER, mVerb, mVersion, NULL, LLChannelDescriptors::out(), PUMP_DEBUG, readLine(), S32, STATE_DONE, STATE_LOOKING_FOR_EOS, STATE_NOTHING, STATE_READING_HEADERS, STATE_SHORT_CIRCUIT, LLIOPipe::STATUS_BREAK, LLIOPipe::STATUS_DONE, LLIOPipe::STATUS_OK, LLIOPipe::STATUS_STOP, LLStringBase< char >::toLower(), LLHTTPNode::traverse(), and LLStringBase< char >::trimTail().
| bool LLHTTPResponder::readLine | ( | const LLChannelDescriptors & | channels, | |
| buffer_ptr_t | buffer, | |||
| U8 * | dest, | |||
| S32 & | len | |||
| ) | [protected] |
Read data off of CHANNEL_IN keeping track of last read position.
This is a quick little hack to read headers. It is not IO optimal, but it makes it easier for me to implement the header parsing. Plus, there should never be more than a few headers. This method will tend to read more than necessary, find the newline, make the front part of dest look like a c string, and move the read head back to where the newline was found. Thus, the next read will pick up on the next line.
| channel | The channel to read in the buffer | |
| buffer | The heap array of processed data | |
| dest | Destination for the data to be read | |
| [in,out] | len | in The size of the buffer. out how much was read. This value is not useful for determining where to seek orfor string assignment. |
Definition at line 520 of file lliohttpserver.cpp.
References LLChannelDescriptors::in(), lldebugs, markBad(), mLastRead, LLMemType::MTYPE_IO_HTTP_SERVER, and S32.
Referenced by process_impl().
std::string LLHTTPResponder::mAbsPathAndQuery [protected] |
LLSD LLHTTPResponder::mBuildContext [protected] |
S32 LLHTTPResponder::mContentLength [protected] |
LLSD LLHTTPResponder::mHeaders [protected] |
U8* LLHTTPResponder::mLastRead [protected] |
std::string LLHTTPResponder::mPath [protected] |
std::string LLHTTPResponder::mQuery [protected] |
const LLHTTPNode& LLHTTPResponder::mRootNode [protected] |
EState LLHTTPResponder::mState [protected] |
std::string LLHTTPResponder::mVerb [protected] |
std::string LLHTTPResponder::mVersion [protected] |
1.4.7