#include <ctype.h>#include <assert.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <time.h>#include <xmlrpc-c/config.h>#include "abyss_mallocvar.h"#include "abyss_xmlrpc_int.h"#include <xmlrpc-c/abyss.h>#include "abyss_server.h"#include "abyss_session.h"#include "abyss_conn.h"#include "abyss_token.h"#include "abyss_date.h"#include "abyss_data.h"#include "abyss_info.h"#include "abyss_http.h"

Go to the source code of this file.
Functions | |
| static void | freeRequestInfo (TRequestInfo *const requestInfoP) |
| static void | getFieldNameToken (char **const pP, char **const fieldNameP, uint16_t *const httpErrorCodeP) |
| abyss_bool | HTTPKeepalive (TSession *const sessionP) |
| int32_t | HTTPRead (TSession *const s ATTR_UNUSED, const char *const buffer ATTR_UNUSED, uint32_t const len ATTR_UNUSED) |
| const char * | HTTPReasonByStatus (uint16_t const code) |
| abyss_bool | HTTPWriteBodyChunk (TSession *const sessionP, const char *const buffer, uint32_t const len) |
| abyss_bool | HTTPWriteEndChunk (TSession *const sessionP) |
| static void | initRequestInfo (TRequestInfo *const requestInfoP, httpVersion const httpVersion, const char *const requestLine, TMethod const httpMethod, const char *const host, unsigned int const port, const char *const path, const char *const query) |
| static void | parseHostPort (char *const hostport, const char **const hostP, unsigned short *const portP, uint16_t *const httpErrorCodeP) |
| static void | parseRequestLine (char *const requestLine, TMethod *const httpMethodP, httpVersion *const httpVersionP, const char **const hostP, unsigned short *const portP, const char **const pathP, const char **const queryP, abyss_bool *const moreLinesP, uint16_t *const httpErrorCodeP) |
| static void | parseRequestUri (char *const requestUri, const char **const hostP, const char **const pathP, const char **const queryP, unsigned short *const portP, uint16_t *const httpErrorCodeP) |
| static void | processHeader (const char *const fieldName, char *const fieldValue, TSession *const sessionP, uint16_t *const httpErrorCodeP) |
| abyss_bool | RangeDecode (char *str, uint64_t filesize, uint64_t *start, uint64_t *end) |
| static void | readRequestLine (TSession *const sessionP, char **const requestLineP, uint16_t *const httpErrorCodeP) |
| abyss_bool | RequestAuth (TSession *r, char *credential, char *user, char *pass) |
| void | RequestFree (TSession *const sessionP) |
| char * | RequestHeaderValue (TSession *r, char *name) |
| void | RequestInit (TSession *const sessionP, TConn *const connectionP) |
| abyss_bool | RequestRead (TSession *const sessionP) |
| abyss_bool | RequestValidURI (TSession *const sessionP) |
| abyss_bool | RequestValidURIPath (TSession *const sessionP) |
| static void | strtolower (char *const s) |
| static void | unescapeUri (char *const uri, abyss_bool *const errorP) |
| static void freeRequestInfo | ( | TRequestInfo *const | requestInfoP | ) | [static] |
Definition at line 69 of file abyss_http.c.
References xmlrpc_strfree().
Referenced by RequestFree().
| static void getFieldNameToken | ( | char **const | pP, | |
| char **const | fieldNameP, | |||
| uint16_t *const | httpErrorCodeP | |||
| ) | [static] |
Definition at line 412 of file abyss_http.c.
References GetToken(), NextToken(), and strtolower().
Referenced by RequestRead().
| abyss_bool HTTPKeepalive | ( | TSession *const | sessionP | ) |
Definition at line 799 of file abyss_http.c.
References TSession::keepalive, and TSession::status.
Referenced by processDataFromClient(), and ResponseWriteStart().
| int32_t HTTPRead | ( | TSession *const s | ATTR_UNUSED, | |
| const char *const buffer | ATTR_UNUSED, | |||
| uint32_t const len | ATTR_UNUSED | |||
| ) |
Definition at line 745 of file abyss_http.c.
| const char* HTTPReasonByStatus | ( | uint16_t const | code | ) |
| abyss_bool HTTPWriteBodyChunk | ( | TSession *const | sessionP, | |
| const char *const | buffer, | |||
| uint32_t const | len | |||
| ) |
Definition at line 755 of file abyss_http.c.
References TSession::chunkedwrite, TSession::chunkedwritemode, TSession::conn, and ConnWrite().
Referenced by ResponseWriteBody(), and sendDirectoryDocument().
| abyss_bool HTTPWriteEndChunk | ( | TSession *const | sessionP | ) |
Definition at line 782 of file abyss_http.c.
References TSession::chunkedwrite, TSession::chunkedwritemode, TSession::conn, ConnWrite(), FALSE, and TRUE.
Referenced by processDataFromClient(), ResponseWriteEnd(), and ServerDirectoryHandler().
| static void initRequestInfo | ( | TRequestInfo *const | requestInfoP, | |
| httpVersion const | httpVersion, | |||
| const char *const | requestLine, | |||
| TMethod const | httpMethod, | |||
| const char *const | host, | |||
| unsigned int const | port, | |||
| const char *const | path, | |||
| const char *const | query | |||
| ) | [static] |
Definition at line 35 of file abyss_http.c.
References FALSE, httpVersion::major, httpVersion::minor, NULL, and TRUE.
Referenced by RequestRead().
| static void parseHostPort | ( | char *const | hostport, | |
| const char **const | hostP, | |||
| unsigned short *const | portP, | |||
| uint16_t *const | httpErrorCodeP | |||
| ) | [static] |
Definition at line 193 of file abyss_http.c.
References port.
Referenced by parseRequestUri(), and processHeader().
| static void parseRequestLine | ( | char *const | requestLine, | |
| TMethod *const | httpMethodP, | |||
| httpVersion *const | httpVersionP, | |||
| const char **const | hostP, | |||
| unsigned short *const | portP, | |||
| const char **const | pathP, | |||
| const char **const | queryP, | |||
| abyss_bool *const | moreLinesP, | |||
| uint16_t *const | httpErrorCodeP | |||
| ) | [static] |
Definition at line 311 of file abyss_http.c.
References FALSE, GetToken(), m_delete, m_get, m_head, m_options, m_post, m_put, m_trace, m_unknown, httpVersion::major, httpVersion::minor, NextToken(), parseRequestUri(), TRUE, and xmlrpc_streq().
Referenced by RequestRead().
| static void parseRequestUri | ( | char *const | requestUri, | |
| const char **const | hostP, | |||
| const char **const | pathP, | |||
| const char **const | queryP, | |||
| unsigned short *const | portP, | |||
| uint16_t *const | httpErrorCodeP | |||
| ) | [static] |
Definition at line 229 of file abyss_http.c.
References NULL, parseHostPort(), unescapeUri(), and xmlrpc_strneq().
Referenced by parseRequestLine().
| static void processHeader | ( | const char *const | fieldName, | |
| char *const | fieldValue, | |||
| TSession *const | sessionP, | |||
| uint16_t *const | httpErrorCodeP | |||
| ) | [static] |
Definition at line 441 of file abyss_http.c.
References TSession::cookies, FALSE, TSession::from, TSession::host, TSession::keepalive, ListAddFromString(), parseHostPort(), TSession::port, TSession::ranges, TSession::referer, TRUE, TSession::useragent, xmlrpc_strcaseeq(), xmlrpc_streq(), and xmlrpc_strneq().
Referenced by RequestRead().
| abyss_bool RangeDecode | ( | char * | str, | |
| uint64_t | filesize, | |||
| uint64_t * | start, | |||
| uint64_t * | end | |||
| ) |
| static void readRequestLine | ( | TSession *const | sessionP, | |
| char **const | requestLineP, | |||
| uint16_t *const | httpErrorCodeP | |||
| ) | [static] |
Definition at line 126 of file abyss_http.c.
References TSession::conn, and ConnReadHeader().
Referenced by RequestRead().
| abyss_bool RequestAuth | ( | TSession * | r, | |
| char * | credential, | |||
| char * | user, | |||
| char * | pass | |||
| ) |
Definition at line 611 of file abyss_http.c.
References Base64Encode(), FALSE, GetToken(), NextToken(), RequestHeaderValue(), ResponseAddField(), ResponseStatus(), TRUE, and TSession::user.
| void RequestFree | ( | TSession *const | sessionP | ) |
Definition at line 111 of file abyss_http.c.
References TSession::cookies, freeRequestInfo(), TSession::header, ListFree(), TSession::ranges, TSession::request_headers, TSession::response_headers, StringFree(), and TableFree().
Referenced by processDataFromClient().
| char* RequestHeaderValue | ( | TSession * | r, | |
| char * | name | |||
| ) |
Definition at line 548 of file abyss_http.c.
References TSession::request_headers, and TableFind().
Referenced by processContentLength(), RequestAuth(), ServerDirectoryHandler(), ServerFileHandler(), storeCookies(), and validateContentType().
Definition at line 81 of file abyss_http.c.
References TSession::chunkedwrite, TSession::chunkedwritemode, TSession::conn, TSession::cookies, TSession::date, FALSE, TSession::header, ListInit(), TSession::ranges, TSession::request_headers, TSession::response_headers, TSession::status, StringAlloc(), and TableInit().
Referenced by processDataFromClient().
| abyss_bool RequestRead | ( | TSession *const | sessionP | ) |
Definition at line 484 of file abyss_http.c.
References TSession::conn, ConnReadHeader(), FALSE, getFieldNameToken(), initRequestInfo(), NextToken(), parseRequestLine(), port, processHeader(), query, readRequestLine(), TSession::request_headers, ResponseStatus(), and TableAdd().
Referenced by processDataFromClient().
| abyss_bool RequestValidURI | ( | TSession *const | sessionP | ) |
Definition at line 556 of file abyss_http.c.
References FALSE, m_options, TSession::method, TRUE, TSession::uri, and xmlrpc_streq().
Referenced by processDataFromClient().
| abyss_bool RequestValidURIPath | ( | TSession *const | sessionP | ) |
Definition at line 573 of file abyss_http.c.
References FALSE, and TSession::uri.
Referenced by ServerDefaultHandlerFunc().
| static void strtolower | ( | char *const | s | ) | [static] |
| static void unescapeUri | ( | char *const | uri, | |
| abyss_bool *const | errorP | |||
| ) | [static] |
1.5.6