Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

protocol.c File Reference

#include "apr.h"
#include "apr_strings.h"
#include "apr_buckets.h"
#include "apr_lib.h"
#include "apr_signal.h"
#include "apr_strmatch.h"
#include "apr_want.h"
#include "util_filter.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_main.h"
#include "http_request.h"
#include "http_vhost.h"
#include "http_log.h"
#include "mod_core.h"
#include "util_charset.h"
#include "util_ebcdic.h"
#include "scoreboard.h"

Include dependency graph for protocol.c:

Go to the source code of this file.

Defines

#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
#define APR_WANT_MEMFUNC
#define CORE_PRIVATE
#define MIN_LINE_ALLOC   80

Functions

 APR_HOOK_STRUCT ()
 AP_DECLARE (void)
 AP_DECLARE (const char *)
 AP_DECLARE (apr_time_t)
 AP_DECLARE (apr_status_t)
 AP_DECLARE (int)
 AP_CORE_DECLARE (void)
static int read_request_line (request_rec *r, apr_bucket_brigade *bb)
request_recap_read_request (conn_rec *conn)
static void end_output_stream (request_rec *r)
 AP_CORE_DECLARE_NONSTD (apr_status_t)
static apr_status_t buffer_output (request_rec *r, const char *str, apr_size_t len)
static apr_status_t r_flush (apr_vformatter_buff_t *buff)
 AP_DECLARE_NONSTD (int)

Variables

static const apr_strmatch_pattern ** needcset_patterns
static const apr_strmatch_patterncharset_pattern


Define Documentation

#define APR_WANT_MEMFUNC
 

Definition at line 33 of file protocol.c.

#define APR_WANT_STDIO
 

Definition at line 31 of file protocol.c.

#define APR_WANT_STRFUNC
 

Definition at line 32 of file protocol.c.

#define CORE_PRIVATE
 

Definition at line 36 of file protocol.c.

#define MIN_LINE_ALLOC   80
 

Definition at line 180 of file protocol.c.

Referenced by AP_DECLARE().


Function Documentation

AP_CORE_DECLARE void   ) 
 

Definition at line 479 of file protocol.c.

References AP_CORE_DECLARE, ap_http_method, APR_SUCCESS, request_rec::args, apr_uri_t::hostname, request_rec::hostname, HTTP_BAD_REQUEST, HTTP_OK, M_CONNECT, request_rec::method_number, NULL, request_rec::parsed_uri, apr_uri_t::path, request_rec::pool, apr_uri_t::query, apr_uri_t::scheme, request_rec::status, status, strcasecmp(), request_rec::unparsed_uri, request_rec::uri, and x.

Here is the call graph for this function:

AP_CORE_DECLARE_NONSTD apr_status_t   ) 
 

Definition at line 1148 of file protocol.c.

References AP_CORE_DECLARE_NONSTD, APLOG_ERR, APLOG_MARK, APR_BLOCK_READ, APR_BRIGADE_FIRST, APR_BRIGADE_INSERT_TAIL, APR_BRIGADE_SENTINEL, APR_BUCKET_IS_EOS, APR_BUCKET_NEXT, apr_bucket_read, APR_NONBLOCK_READ, APR_STATUS_IS_EAGAIN, APR_SUCCESS, conn_rec::bucket_alloc, request_rec::bytes_sent, request_rec::connection, ctx, content_length_ctx::data_sent, e, eos, flush, request_rec::pool, and split().

Here is the call graph for this function:

AP_DECLARE int   ) 
 

Get XML post data and parse it

Parameters:
r The current request
pdoc The XML post data
Returns:
HTTP status code int ap_xml_parse_input(request_rec *r, apr_xml_doc **pdoc)

Definition at line 449 of file protocol.c.

References AP_DECLARE, ap_rgetline, APR_ENOSPC, APR_SUCCESS, and len.

AP_DECLARE apr_status_t   ) 
 

convert a recent time to its human readable components in local timezone

Parameters:
tm the exploded time
t the time to explode: MUST be within the last AP_TIME_RECENT_THRESHOLD seconds
Note:
This is a faster alternative to apr_explode_localtime that uses a cache of pre-exploded time structures. It is useful for things that need to explode the current time multiple times per second, like loggers.
Returns:
APR_SUCCESS iff successful

Definition at line 203 of file protocol.c.

References AP_DECLARE, AP_MODE_GETLINE, AP_MODE_SPECULATIVE, APR_ASCII_BLANK, APR_ASCII_CR, APR_ASCII_LF, APR_ASCII_TAB, APR_BLOCK_READ, APR_BRIGADE_EMPTY, APR_BRIGADE_FIRST, APR_BRIGADE_FOREACH, APR_BUCKET_IS_EOS, apr_bucket_read, APR_EGENERAL, APR_ENOSPC, APR_SUCCESS, c, e, request_rec::input_filters, len, MIN_LINE_ALLOC, NULL, request_rec::pool, and str.

AP_DECLARE apr_time_t   ) 
 

Definition at line 162 of file protocol.c.

References AP_DECLARE, and now.

AP_DECLARE void   ) 
 

Send the minimal part of an HTTP response header.

Parameters:
r The current request
bb The brigade to add the header to.
Warning:
Modules should be very careful about using this, and should the default behavior. Much of the HTTP/1.1 implementation correctness depends on the full headers. void ap_basic_http_header(request_rec *r, apr_bucket_brigade *bb)

Definition at line 80 of file protocol.c.

References AP_DECLARE, and NULL.

AP_DECLARE_NONSTD int   ) 
 

Read headers strings from a script, ensuring that the output is valid. If the output is valid, then the headers are added to the headers out of the current request

Parameters:
r The current request
buffer Empty when calling the function. On output, if there was an error, the string that cause the error is stored here.
termch Pointer to the last character parsed.
termarg Pointer to an int to capture the last argument parsed.
args String arguments to parse consecutively for headers, a NULL argument terminates the list.
Returns:
HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR otherwise int ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc)(char *, int, void *), void *getsfunc_data)

Definition at line 1452 of file protocol.c.

References conn_rec::aborted, AP_DECLARE_NONSTD, and request_rec::connection.

request_rec* ap_read_request conn_rec c  ) 
 

Read a request and fill in the fields.

Parameters:
c The current connection
Returns:
The new request_rec

Definition at line 815 of file protocol.c.

References request_rec::allowed_methods, request_rec::ap_auth_type, ap_http_input_filter_handle, APLOG_ERR, APLOG_INFO, APLOG_MARK, apr_pcalloc, apr_pool_create, request_rec::assbackwards, conn_rec::base_server, conn_rec::bucket_alloc, request_rec::connection, request_rec::err_headers_out, request_rec::expecting_100, request_rec::header_only, request_rec::headers_in, request_rec::headers_out, request_rec::hostname, HTTP_BAD_REQUEST, HTTP_EXPECTATION_FAILED, HTTP_OK, HTTP_REQUEST_TIME_OUT, HTTP_REQUEST_URI_TOO_LARGE, HTTP_VERSION, request_rec::input_filters, conn_rec::input_filters, server_rec::limit_req_line, server_rec::lookup_defaults, request_rec::notes, NULL, request_rec::output_filters, conn_rec::output_filters, p, request_rec::per_dir_config, request_rec::pool, conn_rec::pool, request_rec::proto_input_filters, request_rec::proto_num, request_rec::proto_output_filters, request_rec::read_body, request_rec::read_length, read_request_line(), request_rec::request_config, REQUEST_NO_BODY, conn_rec::sbh, request_rec::sent_bodyct, request_rec::server, SERVER_BUSY_LOG, request_rec::status, strcasecmp(), request_rec::subprocess_env, request_rec::the_request, request_rec::uri, and request_rec::user.

Referenced by ap_process_http_connection().

Here is the call graph for this function:

APR_HOOK_STRUCT  ) 
 

Definition at line 61 of file protocol.c.

References AP_DECLARE_DATA, and NULL.

static apr_status_t buffer_output request_rec r,
const char *  str,
apr_size_t  len
[static]
 

Definition at line 1304 of file protocol.c.

References ap_fwrite, APR_BRIGADE_INSERT_TAIL, apr_pcalloc, APR_SUCCESS, old_write_filter_ctx::bb, conn_rec::bucket_alloc, request_rec::connection, ap_filter_t::ctx, ctx, f, ap_filter_t::frec, ap_filter_t::next, NULL, request_rec::output_filters, and request_rec::pool.

Referenced by r_flush().

static void end_output_stream request_rec r  )  [static]
 

Definition at line 1014 of file protocol.c.

References APR_BRIGADE_INSERT_TAIL, b, conn_rec::bucket_alloc, c, request_rec::connection, request_rec::output_filters, and request_rec::pool.

static apr_status_t r_flush apr_vformatter_buff_t buff  )  [static]
 

Definition at line 1396 of file protocol.c.

References conn_rec::aborted, AP_IOBUFSIZE, APR_SUCCESS, ap_vrprintf_data::buff, buffer_output(), request_rec::connection, apr_vformatter_buff_t::curpos, apr_vformatter_buff_t::endpos, ap_vrprintf_data::r, and ap_vrprintf_data::vbuff.

Here is the call graph for this function:

static int read_request_line request_rec r,
apr_bucket_brigade bb
[static]
 

Definition at line 530 of file protocol.c.

References AP_CHILD_THREAD_FROM_ID, ap_rgetline, APR_ENOSPC, apr_isdigit, APR_SUCCESS, request_rec::assbackwards, request_rec::connection, request_rec::header_only, HTTP_REQUEST_URI_TOO_LARGE, HTTP_VERSION, conn_rec::id, len, server_rec::limit_req_fields, server_rec::limit_req_line, M_GET, request_rec::method, request_rec::method_number, NULL, request_rec::pool, request_rec::proto_num, request_rec::protocol, request_rec::request_time, request_rec::server, request_rec::status, strcasecmp(), request_rec::the_request, and uri.

Referenced by ap_read_request().

Here is the call graph for this function:


Variable Documentation

const apr_strmatch_pattern* charset_pattern [static]
 

Definition at line 78 of file protocol.c.

const apr_strmatch_pattern** needcset_patterns [static]
 

Definition at line 76 of file protocol.c.