/Users/maurits/Documents/studie/afstuderen/biosphere/daemon/http.h File Reference

#include <biosphere.h>
#include <http_common.h>
#include <apr_network_io.h>

Include dependency graph for http.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bs_status handle_http_get (apr_socket_t *sock, apr_pool_t *mp)
bs_status handle_http_post (apr_socket_t *sock, const char *headerbuf, apr_size_t headerlen, apr_pool_t *mp)
bs_status send_http_error (apr_socket_t *sock, const char *errstring, apr_pool_t *mp)


Function Documentation

bs_status handle_http_get ( apr_socket_t *  sock,
apr_pool_t *  mp 
)

Handle a HTTP GET request by simply outputting an HTML status page. This page is the banner.html file included in the daemon directory by default.

Parameters:
sock Socket to use
mp Memory pool to allocate from
Returns:
Status code.

Definition at line 62 of file http.c.

References BIOSPHERE_VERSION_STRING, BS_ERROR, BS_OK, BS_UINT64_FMT, get_remote_endpoint(), get_services(), len(), runtestsuite::rv, send_http_error(), and xlate_definition_to_xml().

Referenced by worker_thread_main().

Here is the call graph for this function:

bs_status handle_http_post ( apr_socket_t *  sock,
const char *  headerbuf,
apr_size_t  headerlen,
apr_pool_t *  mp 
)

Handle a HTTP POST request by assuming it contains an XML request for a service. First the HTTP headers are interpreted, then the xml payload is translated into an internal data structure (

See also:
bs_service_request). This request is then serviced and the resulting response is translated to xml and send back to the caller (

bs_service_response).

Parameters:
sock Socket to use
headerbuf Buffer containing HTTP headers and (part) of the xml data
headerlen Length of the buffer
mp Memory pool to allocate from
Returns:
Status code.

Definition at line 183 of file http.c.

References BIOSPHERE_VERSION_STRING, BS_ERROR, BS_OK, BS_UINT64_FMT, check_for_http_errors(), http_header_info::content_length, http_header_info::content_offset, delete_response(), get_remaining_content(), get_remote_endpoint(), handle_service_request(), len(), parse_http_headers(), runtestsuite::rv, send_http_error(), SERVICE_REQUEST_FROM_XML, xlate_from_xml(), and xlate_response_to_xml().

Referenced by worker_thread_main().

Here is the call graph for this function:

bs_status send_http_error ( apr_socket_t *  sock,
const char *  errstring,
apr_pool_t *  mp 
)

Send an HTTP message through the socket indicating an error.

Parameters:
sock Socket to use (not closed by this function)
errstring The error string to send (ie. HTTP 404 Not Found)
mp Memory pool to allocate from
Returns:
Status code.

Definition at line 274 of file http.c.

References BIOSPHERE_VERSION_STRING, BS_ERROR, BS_OK, len(), and runtestsuite::rv.

Referenced by check_for_http_errors(), handle_http_get(), handle_http_post(), and worker_thread_main().

Here is the call graph for this function:


Generated on Tue Jul 17 09:51:07 2007 for Bio-SPHERE by  doxygen 1.5.1