#include "common.h"
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "logger.h"
#include "http.h"
#include "buffer.h"
#include "bufplist.h"
#include "conftable.h"
#include "conn_handler.h"
#include "misc.h"
#include "reqhandler_file.h"
#include "xmalloc.h"
Include dependency graph for http.c:
Go to the source code of this file.
Data Structures | |
struct | HttpProtHandler |
the struct containing all necessary information (on http-level) for a connection. More... | |
struct | HttpRequestHdr |
the struct containing the request information. More... | |
struct | Uri |
struct to contain a whole URI. More... | |
Defines | |
#define | MKHTTPRESPONSE_TIME_BUF_LEN 30 |
the length of our time representation string incl '\0' (ie. "Thu, 20 Dec 2001 10:18:31 GMT"). | |
Enumerations | |
enum | Method { MUNKNOWN, GET, HEAD, POST } |
the request method. | |
enum | HttpVer { VUNKNOWN, V09, V10, V11 } |
the http version. | |
enum | Encoding { EUNKNOWN, IDENTITY, GZIP, COMPRESS } |
the encoding type. | |
enum | Connection { CUNKNOWN, CLOSE, KEEPALIVE } |
the connection kind. | |
Functions | |
int | htRecvLine (HttpProtHandler this, const char *str) |
receive a line of data. | |
int | copyRequestLine (HttpProtHandler this, struct Buffer *buf) |
int | htMthdParse (HttpProtHandler this, const char *str) |
parses the first line of the http header. | |
int | htAddData (struct HttpRequestHdr *hdr, const char *str) |
parse header fields into hdr. | |
Uri | resolvURI (const char *str) |
converts the URI string to struct URI. | |
const char * | getStatusAsText (HttpProtHandler this) |
return a verbose description for a http status code. | |
int | buildBasicHeader (HttpProtHandler this) |
builds the standard headerfields. More... | |
int | buildEntityHeader (HttpProtHandler this) |
builds the three entity header lines used for files. More... | |
int | appendHdrField (BufpList hdr_list, char *prefix, char *data) |
add a field. More... | |
int | err2Status (int err) |
convert errorcode to http-status. | |
int | htModulePreInit () |
pre-initialise module. | |
int | htModuleTerminate () |
clean up rssources allocated by module. | |
HttpProtHandler | htInit (ConnHandler parent) |
creates, initializes and returns a Http Protokoll Handler. More... | |
int | htReceive (HttpProtHandler this, struct Buffer buf) |
orders a ProtHandler to Recieve data. More... | |
int | htSend (HttpProtHandler this, struct Buffer **buf) |
orders a ProtHandler to send buffered data. More... | |
int | htProcess (HttpProtHandler this) |
gives the chance to do some internal job. More... | |
int | htIsDataPending (HttpProtHandler this) |
checks if data is pending. More... | |
int | htTerminate (HttpProtHandler this) |
terminates this . More... | |
int | htGetError (HttpProtHandler this) |
returns the error of this . More... | |
char * | timetToStr (time_t t, struct Buffer *time_buf) |
convert a time_t to a string (reentrant). | |
time_t | strToTimet (const char *str) |
convert an rfc1123 or rfc850 conformant textual time representation to an time_t. | |
Variables | |
int | reply_server_name |
boolean: if the server should indentify itself in each reply. |
Definition in file http.c.
|
add a field.
Definition at line 679 of file http.c. Referenced by buildEntityHeader(), and htRecvLine().
|
|
builds the standard headerfields.
Definition at line 598 of file http.c. Referenced by htRecvLine().
|
|
builds the three entity header lines used for files.
Definition at line 649 of file http.c. Referenced by htRecvLine().
|
|
copies a logical line from the connection handlers receive buffer to its line buffer as a single null terminated string line breaks are replaced by spaces
Definition at line 474 of file http.c. Referenced by htReceive().
|
|
returns the error of
|
|
creates, initializes and returns a Http Protokoll Handler.
|
|
checks if data is pending.
|
|
gives the chance to do some internal job.
|
|
orders a ProtHandler to Recieve data.
|
|
orders a ProtHandler to send buffered data.
|
|
terminates
this and frees all allocated memory used by this . Also calls underlying terminate functions
|