LLHTTPResponder Class Reference

This class. More...

Inheritance diagram for LLHTTPResponder:

Inheritance graph
[legend]
Collaboration diagram for LLHTTPResponder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLHTTPResponder (const LLHTTPNode &tree, const LLSD &ctx)
 ~LLHTTPResponder ()

Protected Types

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
U8mLastRead
std::string mVerb
std::string mAbsPathAndQuery
std::string mPath
std::string mQuery
std::string mVersion
S32 mContentLength
LLSD mHeaders
const LLHTTPNodemRootNode


Detailed Description

This class.

See also:
LLIOPipe
NOTE: You should not need to create or use one of these, the details are handled by the HTTPResponseFactory.

Definition at line 426 of file lliohttpserver.cpp.


Member Enumeration Documentation

enum LLHTTPResponder::EState [protected]

Enumerator:
STATE_NOTHING 
STATE_READING_HEADERS 
STATE_LOOKING_FOR_EOS 
STATE_DONE 
STATE_SHORT_CIRCUIT 

Definition at line 481 of file lliohttpserver.cpp.


Constructor & Destructor Documentation

LLHTTPResponder::LLHTTPResponder ( const LLHTTPNode tree,
const LLSD ctx 
)

Definition at line 505 of file lliohttpserver.cpp.

References LLMemType::MTYPE_IO_HTTP_SERVER.

LLHTTPResponder::~LLHTTPResponder (  ) 

Definition at line 516 of file lliohttpserver.cpp.

References LLMemType::MTYPE_IO_HTTP_SERVER.


Member Function Documentation

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.

Parameters:
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.
Returns:
Returns true if a line was found.

Definition at line 522 of file lliohttpserver.cpp.

References LLChannelDescriptors::in(), lldebugs, markBad(), mLastRead, LLMemType::MTYPE_IO_HTTP_SERVER, and S32.

Referenced by process_impl().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLHTTPResponder::markBad ( const LLChannelDescriptors channels,
buffer_ptr_t  buffer 
) [protected]

Mark the request as bad, and handle appropriately.

Parameters:
channels The channels to use in the buffer.
buffer The heap array of processed data.

Definition at line 549 of file lliohttpserver.cpp.

References HTTP_VERSION_STR, mState, LLMemType::MTYPE_IO_HTTP_SERVER, and STATE_SHORT_CIRCUIT.

Referenced by process_impl(), and readLine().

Here is the caller graph for this function:

LLIOPipe::EStatus LLHTTPResponder::process_impl ( const LLChannelDescriptors channels,
buffer_ptr_t buffer,
bool &  eos,
LLSD context,
LLPumpIO pump 
) [protected]


Member Data Documentation

Definition at line 490 of file lliohttpserver.cpp.

Referenced by process_impl().

Definition at line 491 of file lliohttpserver.cpp.

Referenced by markBad(), and process_impl().

Definition at line 492 of file lliohttpserver.cpp.

Referenced by process_impl(), and readLine().

std::string LLHTTPResponder::mVerb [protected]

Definition at line 493 of file lliohttpserver.cpp.

Referenced by process_impl().

std::string LLHTTPResponder::mAbsPathAndQuery [protected]

Definition at line 494 of file lliohttpserver.cpp.

Referenced by process_impl().

std::string LLHTTPResponder::mPath [protected]

Definition at line 495 of file lliohttpserver.cpp.

Referenced by process_impl().

std::string LLHTTPResponder::mQuery [protected]

Definition at line 496 of file lliohttpserver.cpp.

Referenced by process_impl().

std::string LLHTTPResponder::mVersion [protected]

Definition at line 497 of file lliohttpserver.cpp.

Referenced by process_impl().

Definition at line 498 of file lliohttpserver.cpp.

Referenced by process_impl().

Definition at line 499 of file lliohttpserver.cpp.

Referenced by process_impl().

Definition at line 502 of file lliohttpserver.cpp.

Referenced by process_impl().


The documentation for this class was generated from the following file:

Generated on Fri May 16 08:49:09 2008 for SecondLife by  doxygen 1.5.5