The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

HTTPDocument Class Reference

You must return a HTTPDocument to the httpd module by using the Request class. More...

#include <httpd.h>

Inheritance diagram for HTTPDocument:

Inheritance graph
[legend]
Collaboration diagram for HTTPDocument:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HTTPDocument (void *opaque, std::stringstream *doc, int response)
 Initialize a HTTPRequest ready for sending to m_httpd.so.
std::stringstream * GetDocument ()
 Get the document text.
unsigned long GetDocumentSize ()
 Get the document size.
int GetResponseCode ()
 Get the response code.

Public Attributes

HTTPHeaders headers
void * sock
 The socket pointer from an earlier HTTPRequest.

Protected Attributes

std::stringstream * document
int responsecode

Detailed Description

You must return a HTTPDocument to the httpd module by using the Request class.

When you initialize this class you may initialize it with all components required to form a valid HTTP response, including document data, headers, and a response code.

Definition at line 174 of file httpd.h.


Constructor & Destructor Documentation

HTTPDocument::HTTPDocument void *  opaque,
std::stringstream *  doc,
int  response
[inline]
 

Initialize a HTTPRequest ready for sending to m_httpd.so.

Parameters:
opaque The socket pointer you obtained from the HTTPRequest at an earlier time
doc A stringstream containing the document body
response A valid HTTP/1.0 or HTTP/1.1 response code. The response text will be determined for you based upon the response code.
extra Any extra headers to include with the defaults, seperated by carriage return and linefeed.

Definition at line 196 of file httpd.h.


Member Function Documentation

std::stringstream* HTTPDocument::GetDocument  )  [inline]
 

Get the document text.

Returns:
The document text

Definition at line 203 of file httpd.h.

References document.

Referenced by ModuleHttpServer::OnRequest().

unsigned long HTTPDocument::GetDocumentSize  )  [inline]
 

Get the document size.

Returns:
the size of the document text in bytes

Definition at line 211 of file httpd.h.

References document.

int HTTPDocument::GetResponseCode  )  [inline]
 

Get the response code.

Returns:
The response code

Definition at line 219 of file httpd.h.

References responsecode.

Referenced by ModuleHttpServer::OnRequest().


Member Data Documentation

std::stringstream* HTTPDocument::document [protected]
 

Definition at line 178 of file httpd.h.

Referenced by GetDocument(), and GetDocumentSize().

HTTPHeaders HTTPDocument::headers
 

Definition at line 183 of file httpd.h.

Referenced by ModuleHTTPAccessList::BlockAccess(), ModuleRpcJson::OnEvent(), ModuleHttpStats::OnEvent(), and ModuleHttpServer::OnRequest().

int HTTPDocument::responsecode [protected]
 

Definition at line 179 of file httpd.h.

Referenced by GetResponseCode().

void* HTTPDocument::sock
 

The socket pointer from an earlier HTTPRequest.

Definition at line 187 of file httpd.h.

Referenced by ModuleHttpServer::OnRequest().


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