Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59273 - in sandbox/SOC/2007/cgi/branches/pickmeup: boost/cgi boost/cgi/common boost/cgi/detail boost/cgi/fcgi boost/cgi/impl boost/cgi/utility libs/cgi/build/msvc/9.0/Boost.CGI libs/cgi/doc libs/cgi/doc/src libs/cgi/example/cgi libs/cgi/example/cgi/echo libs/cgi/example/cgi/stencil libs/cgi/example/cgi/upload libs/cgi/example/fcgi libs/cgi/example/fcgi/amortization libs/cgi/example/fcgi/async_echo libs/cgi/example/fcgi/echo libs/cgi/example/fcgi/stencil libs/cgi/example/fcgi/upload
From: lists.drrngrvy_at_[hidden]
Date: 2010-01-26 20:02:59


Author: drrngrvy
Date: 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
New Revision: 59273
URL: http://svn.boost.org/trac/boost/changeset/59273

Log:
* Add file uploads as basic_request<>::uploads member variable. Gives information about where the file is stored on the hard drive.
* Cleaned up basic_request<> now that form_parts are accessible through basic_request<>::uploads.
* No longer store all form_parts
* Add accept() overloads to basic_request_acceptor<> that take a function<int (request&)>. These can manage multiplexing connections.
* Better error reporting when trying to use an uninitialised data map on a basic_request<>
* Cosmetic cleanup of request_base.
* Extra bits to stencil class (requires cTemplate).
* Added a few examples.
Added:
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/doc.qbk (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/main.cpp (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/stencil.html (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/stencil.include.html (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/main.cpp (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/upload.html (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/async_echo/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/async_echo/main.cpp
      - copied, changed from r58566, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/Jamfile.v2 (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/doc.qbk (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/main.cpp (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/stencil.html (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/stencil.include.html (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/main.cpp (contents, props changed)
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/upload.html (contents, props changed)
Binary files modified:
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.suo
Text files modified:
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_client.hpp | 9
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp | 67
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request_acceptor.hpp | 52
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/basic_protocol_service.hpp | 16
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp | 92
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_parser.hpp | 2
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_part.hpp | 37
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp | 7
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/parse_options.hpp | 3
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp | 91
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_status.hpp | 11
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp | 8
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp | 13
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/config.hpp | 40
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/protocol_traits.hpp | 6
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor.hpp | 4
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp | 185
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/client.hpp | 78
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_acceptor_service.hpp | 27
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_service.hpp | 49
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/fcgi_request_service.ipp | 174
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp | 19
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp | 1
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/utility/stencil.hpp | 100
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln | 42
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/Jamfile.v2 | 10
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/cgi.qbk | 24
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/reference.qbk | 25537 ++++++++++-----------------------------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/doc.qbk | 2
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp | 26
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/amortization/main.cpp | 31
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/async_echo/main.cpp | 104
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/doc.qbk | 8
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp | 69
   34 files changed, 7414 insertions(+), 19530 deletions(-)

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_client.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_client.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_client.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -233,6 +233,15 @@
     }
 
   private:
+
+ template<typename ConstBufferSequence>
+ void prepare_buffer(const ConstBufferSequence& buf)
+ { /* NOOP */ }
+
+ void handle_write(
+ std::size_t bytes_transferred, boost::system::error_code& ec)
+ { /* NOOP */ }
+
     //io_service& io_service_;
     connection_ptr connection_;
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -104,6 +104,7 @@
     common::data_map_proxy<get_map> get;
     common::data_map_proxy<form_map> form;
     common::data_map_proxy<cookie_map> cookies;
+ common::data_map_proxy<upload_map> uploads;
 
     basic_request(
         int opts
@@ -171,7 +172,6 @@
       set_protocol_service(*impl.service_);
       this->service.begin_request_helper(this->implementation
                                         , impl.header_buf_, ec);
- construct();
     }
       
     ~basic_request()
@@ -180,17 +180,6 @@
       // close(http::internal_server_error, 0);
     }
     
- void construct()
- {
- this->env.set(env_vars(this->implementation.vars_));
- // By default, set the form map to the environment.
- //if (!this->form)
- // this->form.set(env_vars(this->implementation.vars_));
- this->post.set(post_vars(this->implementation.vars_));
- this->get.set(get_vars(this->implementation.vars_));
- this->cookies.set(cookie_vars(this->implementation.vars_));
- }
-
     static pointer create(protocol_service_type& ps)
     {
       return pointer(new self_type(ps));
@@ -243,7 +232,6 @@
       load(parse_options parse_opts, boost::system::error_code& ec
           , char** base_environment = NULL, bool is_command_line = true)
     {
- construct();
       // Parse just the environment first, then check the user
       // isn't trying to upload more data than we want to let them.
       // Define `BOOST_CGI_POST_MAX` to set the maximum content-length
@@ -262,8 +250,18 @@
           this->service.load_environment(
               this->implementation, base_environment
             , is_command_line);
-
- if (parse_opts > parse_env && parse_opts & parse_form)
+
+ if (parse_opts & parse_env)
+ env.set(env_vars(this->implementation.vars_));
+ if (parse_opts & parse_get_only)
+ get.set(get_vars(this->implementation.vars_));
+ if (parse_opts & parse_post_only)
+ post.set(post_vars(this->implementation.vars_));
+ if (parse_opts & parse_get_only || parse_opts & parse_get_only)
+ uploads.set(upload_vars(this->implementation.vars_));
+ if (parse_opts & parse_cookies)
+ cookies.set(cookie_vars(this->implementation.vars_));
+ if (parse_opts & parse_form_only)
         {
           common::name rm(request_method().c_str());
           form.set(
@@ -312,6 +310,8 @@
      * read functions) it will be necessary to call end, rather than
      * just returning from the sub_main function.
      *
+ * @param http_status The HTTP status of the request.
+ *
      * @param program_status This value is returned to the server
      * indicating the state of the request after it was finished
      * handling. It is implementation defined how the server deals with
@@ -354,34 +354,6 @@
       this->service.set_status(this->implementation, aborted);
     }
 
- /// Check if a POST variable references a file upload.
- /**
- * File uploads, which originate from a form POSTed using the
- * multipart/form-data encoding type are saved to disk.
- *
- * Only the filename is stored in the POST map for the request.
- * If you expect a field to be a file upload, check if it is using
- * this function.
- */
- bool is_file(common::name const& key)
- {
- return this->service.is_file(this->implementation, key.c_str());
- }
-
- /// Check if a POST variable references a file upload.
- /**
- * File uploads, which originate from a form POSTed using the
- * multipart/form-data encoding type are saved to disk.
- *
- * Only the filename is stored in the POST map for the request.
- * If you expect a field to be a file upload, check if it is using
- * this function.
- */
- bool is_file(string_type& key)
- {
- return this->service.is_file(this->implementation, key);
- }
-
     /// Clear the data for the request, for reusing this object.
     // I'd imagine clearing and re-loading a request is quicker than
     // destroying/re-creating one. **Unverified claims** **FIXME**
@@ -662,14 +634,7 @@
     {
       this->service.status(this->implementation, status);
     }
-
- /// Get the form_part for the passed key, which may not exist.
- boost::optional<common::form_part&> get_form_part(string_type const& key)
- {
- return this->service.get_form_part(this->implementation, key);
- }
-
- };
+ };
 
    template<typename P>
    std::size_t hash_value(basic_request<P> const& req)

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request_acceptor.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request_acceptor.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request_acceptor.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -35,25 +35,15 @@
     typedef
         typename service_type::implementation_type::port_number_type
     port_number_type;
- typedef
- typename service_type::implementation_type::acceptor_service_type
- next_layer_type;
- typedef
- typename service_type::endpoint_type
- endpoint_type;
- typedef typename service_type::native_type native_type;
- typedef
- typename service_type::service_impl_type::protocol_service_type
- protocol_service_type;
-
-
- //template<typename IoServiceProvider>
- //explicit basic_request_acceptor(
- // basic_protocol_service<protocol_type, IoServiceProvider>& ps)
- // : boost::asio::basic_io_object<RequestAcceptorService>(ps.io_service())
- //{
- // this->service.set_protocol_service(this->implementation, ps);
- //}
+ typedef typename
+ service_type::acceptor_service_type next_layer_type;
+ typedef typename
+ service_type::endpoint_type endpoint_type;
+ typedef typename service_type::native_type native_type;
+ typedef typename
+ service_type::protocol_service_type protocol_service_type;
+ typedef typename
+ service_type::accept_handler_type accept_handler_type;
 
     template<typename IoServiceProvider>
     explicit basic_request_acceptor(
@@ -223,7 +213,25 @@
                                  , native_acceptor, ec);
     }
 
- /// Accept one request
+ /// Accept one request and handle it with `handler`.
+ int accept(accept_handler_type handler)
+ {
+ boost::system::error_code ec;
+ int status = this->service.accept(this->implementation, handler, 0, ec);
+ detail::throw_error(ec);
+ return status;
+ }
+
+ int accept(accept_handler_type handler, boost::system::error_code& ec)
+ {
+ return this->service.accept(this->implementation, handler, 0, ec);
+ }
+
+ void async_accept(accept_handler_type handler)
+ {
+ this->service.async_accept(this->implementation, handler);
+ }
+
     template<typename CommonGatewayRequest>
     void accept(CommonGatewayRequest& request)
     {
@@ -237,7 +245,6 @@
     boost::system::error_code
       accept(CommonGatewayRequest& request, boost::system::error_code& ec)
     {
- //std::cerr<< "mine:::: endpoint.port := " << this->implementation.endpoint_.port() << std::endl;
       return this->service.accept(this->implementation, request, 0, ec);
     }
 
@@ -249,9 +256,6 @@
       return this->service.accept(this->implementation, request, &ep, ec);
     }
 
- //template<typename CommonGatewayRequest, typename Endpoint>
- //boost::system::error_code
-
     /// Asynchronously accept one request
     template<typename CommonGatewayRequest, typename Handler>
     void async_accept(CommonGatewayRequest& request, Handler handler)

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/basic_protocol_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/basic_protocol_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/basic_protocol_service.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -42,31 +42,20 @@
     typedef typename traits::request_type request_type;
     typedef typename boost::shared_ptr<request_type> request_ptr;
     typedef std::set<request_ptr> set_type;
- //typename boost::mpl::if_<
- // boost::is_same<protocol_type, tags::acgi>::value
- // , request_type::pointer
- // , std::set<request_type::pointer>
- // >::type
-
     typedef std::queue<request_ptr> queue_type;
 
     basic_protocol_service(int pool_size_hint = 1)
       : ios_provider_(pool_size_hint)
- //, strand_(ios_provider_.io_service())
- //, gateway_(*this)
     {
     }
 
     basic_protocol_service(boost::asio::io_service& ios)
       : ios_provider_(ios)
- //, strand_(ios)
- //, gateway_(*this)
     {
     }
 
     ~basic_protocol_service()
     {
- //gateway_.stop();
     }
 
     /// Run all the io_services contained by this service
@@ -99,8 +88,6 @@
     void reset()
     {
       request_queue_.clear();
- //std::for_each(request_set_.begin(), request_set_.end()
- // , boost::bind(&request_type::abort, boost::arg<1>()));
       request_set_.clear();
       ios_provider_.reset();
     }
@@ -137,9 +124,6 @@
   private:
     ios_provider_type ios_provider_;
 
- /// A strand is used for guaranteeing handlers are dispatched sequentially
- //boost::asio::strand strand_;
-
     /// A std::set of all the requests.
     set_type request_set_;
     /// A std::queue of the waiting (ie. not-being-handled) requests.

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -7,9 +7,30 @@
 ///////////////////////////////////////////////////////////
 #include "boost/cgi/config.hpp"
 
+/// Throws an exception if you try to use some request data without
+/// loading the request first. This checking is only done in debug
+/// builds and is a noop in release builds.
+#ifndef BOOST_CGI_MAP_ASSERT
+# ifndef NDEBUG
+# define BOOST_CGI_MAP_ASSERT(x) if (!x) throw map_read_error<map_type>()
+# else
+# define BOOST_CGI_MAP_ASSERT(x) void
+# endif // NDEBUG
+#endif // BOOST_CGI_MAP_ASSERT
+
 BOOST_CGI_NAMESPACE_BEGIN
 
  namespace common {
+
+ template<typename T>
+ struct map_read_error
+ : std::runtime_error
+ {
+ map_read_error()
+ : std::runtime_error("Attempt to access uninitialised data map. Did you forget to call request::load()?")
+ {
+ }
+ };
 
   /// A proxy class to provide access to the data maps as member variables.
   /**
@@ -17,12 +38,13 @@
    * interface for the different data maps.
    *
    * It also includes an as<> member function which casts the found data
- * into any type the user specifies.
+ * into a type the user specifies.
    */
   template<typename MapType>
   struct data_map_proxy
   {
     typedef MapType map_type;
+ typedef data_map_proxy<map_type> self_type;
     typedef typename map_type::key_type key_type;
     typedef typename map_type::value_type value_type;
     typedef typename map_type::mapped_type mapped_type;
@@ -33,41 +55,49 @@
     typedef typename map_type::const_reverse_iterator const_reverse_iterator;
     typedef typename map_type::allocator_type allocator_type;
     
- void set(map_type& data) { impl = &data; }
+ self_type()
+ : impl(NULL)
+ {
+ }
+
+ /// Map iterators.
     
- iterator begin() {
- BOOST_ASSERT(impl); return impl->begin(); }
+ iterator begin() {
+ BOOST_CGI_MAP_ASSERT(impl); return impl->begin(); }
     iterator end() {
- BOOST_ASSERT(impl); return impl->end(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->end(); }
     const_iterator begin() const {
- BOOST_ASSERT(impl); return impl->begin(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->begin(); }
     const_iterator end() const {
- BOOST_ASSERT(impl); return impl->end(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->end(); }
     reverse_iterator rbegin() {
- BOOST_ASSERT(impl); return impl->rbegin(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->rbegin(); }
     reverse_iterator rend() {
- BOOST_ASSERT(impl); return impl->rend(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->rend(); }
     const_reverse_iterator rbegin() const {
- BOOST_ASSERT(impl); return impl->rbegin(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->rbegin(); }
     const_reverse_iterator rend() const {
- BOOST_ASSERT(impl); return impl->rend(); }
+ BOOST_CGI_MAP_ASSERT(impl); return impl->rend(); }
+
+
+ void set(map_type& data) { impl = &data; }
+
+ bool empty() { BOOST_CGI_MAP_ASSERT(impl); return impl->empty(); }
+
+ void clear() { BOOST_CGI_MAP_ASSERT(impl); return impl->clear(); }
+
+ size_type size() const { BOOST_CGI_MAP_ASSERT(impl); return impl->size(); }
 
- bool empty() { BOOST_ASSERT(impl); return impl->empty(); }
-
- void clear() { BOOST_ASSERT(impl); return impl->clear(); }
-
- size_type size() const { BOOST_ASSERT(impl); return impl->size(); }
-
     size_type count(const key_type& key) {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
        return impl->count(key);
     }
-
+
     /// Get a value for the key, with fallback.
     mapped_type const&
       pick(key_type const& key, mapped_type const& default_value) const
     {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
       const_iterator iter = impl->find(key);
       return iter == impl->end() ? default_value : iter->second;
     }
@@ -90,7 +120,7 @@
     template<typename T>
     T as(key_type const& key, T const& default_value = T()) const
     {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
       const_iterator iter = impl->find(key);
 
       T val (default_value);
@@ -104,28 +134,28 @@
       }
       return val;
     }
-
+
     mapped_type& operator[](const char* varname) {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
       return (*impl)[varname];
     }
-
+
     mapped_type& operator[](const char* varname) const {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
       return (*impl)[varname];
     }
-
+
     mapped_type& operator[](key_type const& varname) {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
       return (*impl)[varname.c_str()];
     }
-
+
     mapped_type const& operator[](key_type const& varname) const {
- BOOST_ASSERT(impl);
+ BOOST_CGI_MAP_ASSERT(impl);
       return (*impl)[varname.c_str()];
     }
-
- operator map_type&() { BOOST_ASSERT(impl); return *impl; }
+
+ operator map_type&() { BOOST_CGI_MAP_ASSERT(impl); return *impl; }
     bool operator!() const { return !impl; }
 
   private:

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_parser.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_parser.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_parser.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -85,9 +85,9 @@
     {
       string_type& content_type;
       buffer_type& buffer;
- std::vector<common::form_part>& form_parts;
       std::size_t& bytes_left;
       common::post_map& data_map;
+ common::upload_map& uploads_map;
       const callback_type callback;
       bool& stdin_parsed;
       // A random string, used for marking uploaded files.

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_part.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_part.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/form_part.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -5,6 +5,7 @@
 #include <vector>
 #include <string>
 #include <boost/range.hpp>
+#include <boost/filesystem.hpp>
 #include "boost/cgi/config.hpp"
 #include "boost/cgi/common/name.hpp"
 
@@ -27,13 +28,23 @@
      typedef std::map<
        string_type, pair_t
> meta_data_map_type;
-
- form_part()
+
+ ~form_part()
      {
- }
-
- bool operator==(form_part& other) {
- return this->name == other.name;
+ /*
+ try {
+ // Delete any file saved in uploading this.
+ namespace fs = boost::filesystem;
+ if (!path.empty() && fs::exists(path)) {
+#ifndef NDEBUG
+ std::cerr<< "Removing file: " << path << std::endl;
+#endif // NDEBUG
+ fs::remove(path);
+ }
+ } catch(...) {
+ // pass
+ }
+ */
      }
 
      meta_data_map_type meta_data_;
@@ -48,10 +59,10 @@
      string_type content_type; // must exist
      string_type content_disposition; // must exist
      string_type name; // must exist
- string_type value; // Either the data itself, or the filename for
- string_type filename;
+ string_type value; // Either the data itself, or the filename for file uploads.
+ boost::filesystem::path filename;
      // Where the actual uploaded file is stored.
- string_type path;
+ boost::filesystem::path path;
 
    public:
      /// TODO: Check that the uploaded file isn't empty too.
@@ -65,14 +76,6 @@
      operator std::basic_string<T> () { return value; }
     
      friend std::ostream& operator<<(std::ostream& os, form_part const& part);
-
- // Using a simple map while everything is changing. This will not copy the
- // values when it is properly implemented (it'll hold a pair of iterators
- // to the data).
- //std::map<string_type, string_type> meta_data_;
-
- // Boolean to show if the form part has been completely read/parsed
- //bool finished_;
    };
 
   inline

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -4,6 +4,7 @@
 #include <map>
 #include "boost/cgi/common/name.hpp"
 #include "boost/cgi/common/cookie.hpp"
+#include "boost/cgi/common/form_part.hpp"
 
 /// You can define your
 #ifndef BOOST_CGI_SESSION_MAP_TYPE
@@ -23,8 +24,6 @@
     * > Update this file
     * > Update source_enums.hpp
     * > Update `data_map_type` in the `request_base` class
- * > Use the `BOOST_CGI_DETAIL_MAP_ACCESS` macro in `basic_request<>`,
- * next to the other uses of it.
     */
   typedef map env_map;
   typedef map get_map;
@@ -34,6 +33,10 @@
       ::BOOST_CGI_NAMESPACE::common::name,
       ::BOOST_CGI_NAMESPACE::common::cookie
> cookie_map;
+ typedef std::map<
+ ::BOOST_CGI_NAMESPACE::common::name,
+ ::BOOST_CGI_NAMESPACE::common::form_part
+ > upload_map;
   typedef map session_map;
 
  } // namespace common

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/parse_options.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/parse_options.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/parse_options.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -18,9 +18,10 @@
      , parse_post_only = 4
      , parse_post = parse_post_only | parse_env
      , parse_form = parse_env | parse_get | parse_post
+ , parse_form_only = parse_get_only | parse_post_only
      , parse_cookie_only = 8
      , parse_cookie = parse_cookie_only | parse_env
- , parse_cookies_only = 8
+ , parse_cookies_only = parse_cookie_only
      , parse_cookies = parse_cookies_only | parse_env
      , parse_all = parse_env | parse_form | parse_cookie
    };

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -43,13 +43,7 @@
   public:
     typedef common::request_base<Protocol> base_type;
 
- /// Get the request ID of a FastCGI request, or 1.
- template<typename ImplType>
- boost::uint16_t const& request_id(ImplType& impl) const
- {
- return impl.client_.request_id();
- }
-
+ protected:
     // impl_base is the common base class for all request types'
     // implementation_type and should be inherited by it.
     struct impl_base
@@ -82,7 +76,7 @@
       typedef boost::fusion::vector<
           common::env_map, common::get_map
         , common::post_map, common::cookie_map
- , common::session_map
+ , common::upload_map, common::session_map
> var_map_type;
       
       /// Construct.
@@ -103,6 +97,15 @@
       common::request_status status() const { return request_status_; }
       void status(common::request_status& st) { request_status_ = st; }
 
+ mutable_buffers_type prepare(std::size_t size)
+ {
+ // Make sure we're not trying to make a zero-sized buffer.
+ BOOST_ASSERT(size && "Attempting to allocate a zero-sized buffer.");
+ std::size_t bufsz(post_buffer_.size());
+ post_buffer_.resize(bufsz + size);
+ return boost::asio::buffer(&post_buffer_[bufsz], size);
+ }
+
       protocol_service_type* service_;
       
       var_map_type vars_;
@@ -117,21 +120,12 @@
 
       common::http::status_code http_status_;
       common::request_status request_status_;
-
+
       client_type client_;
       
       boost::scoped_ptr<form_parser_type> fp_;
 
       std::vector<common::form_part> form_parts_;
-
- mutable_buffers_type prepare(std::size_t size)
- {
- // Make sure we're not trying to make a zero-sized buffer.
- BOOST_ASSERT(size && "Attempting to allocate a zero-sized buffer.");
- std::size_t bufsz(post_buffer_.size());
- post_buffer_.resize(bufsz + size);
- return boost::asio::buffer(&post_buffer_[bufsz], size);
- }
     };
     
     template<typename ImplType, typename Service>
@@ -152,7 +146,16 @@
       ImplType& impl_;
       Service* service_;
     };
-
+
+ public:
+
+ /// Get the request ID of a FastCGI request, or 1.
+ template<typename ImplType>
+ boost::uint16_t const& request_id(ImplType& impl) const
+ {
+ return impl.client_.request_id();
+ }
+
     /// Load the base_environment into the current environment.
     /**
      * Parsed the base_environment and add it to the current request's
@@ -237,33 +240,6 @@
           && impl.client_.is_open();
     }
 
- /// Check if a given POST variable represents a file upload.
- template<typename ImplType>
- bool is_file(ImplType& impl
- , typename ImplType::string_type const& key)
- {
- boost::optional<common::form_part&>
- part = get_form_part(impl, key);
- return part && !part->filename.empty();
- }
-
- /// Get the form_part for the passed key, which may not exist.
- template<typename ImplType>
- boost::optional<common::form_part&>
- get_form_part(ImplType& impl, typename ImplType::string_type const& key)
- {
- typedef std::vector<common::form_part>::iterator
- iter_t;
-
- for(iter_t iter (impl.form_parts_.begin())
- , end (impl.form_parts_.end()); iter != end; ++iter)
- {
- if (iter->name == key.c_str())
- return boost::optional<common::form_part&>(*iter);
- }
- return boost::optional<common::form_part&>();
- }
-
     /// Synchronously read/parse the request meta-data
     template<typename ImplType>
     boost::system::error_code
@@ -283,23 +259,22 @@
          = cl.empty() ? 0 : boost::lexical_cast<std::size_t>(cl);
       impl.client_.bytes_left() = impl.bytes_left_;
 
- std::string const& request_method
- = env_vars(impl.vars_)["REQUEST_METHOD"];
-
- if ((request_method == "GET" || request_method == "HEAD")
- && (parse_opts & common::parse_get_only))
+ // We could check the request method to determine if the query string
+ // should be parsed, but it is useful to always parse it. AFAIK this is
+ // portable.
+ if (parse_opts & common::parse_get_only)
       {
- parse_get_vars(impl, ec);
+ if (!parse_get_vars(impl, ec))
+ return ec;
       }
- else
- if (request_method == "POST"
+
+ if (env_vars(impl.vars_)["REQUEST_METHOD"] == "POST"
           && parse_opts & common::parse_post_only)
       {
- parse_post_vars(impl, ec);
+ if (!parse_post_vars(impl, ec))
+ return ec;
       }
 
- if (ec) return ec;
-
       if (parse_opts & common::parse_cookies_only)
       {
         if (!parse_cookie_vars(impl, ec)) // returns an error_code
@@ -367,9 +342,9 @@
             context
                 = { env_vars(impl.vars_)["CONTENT_TYPE"]
                   , impl.post_buffer_
- , impl.form_parts_
                   , impl.client_.bytes_left_
                   , post_vars(impl.vars_)
+ , upload_vars(impl.vars_)
                   , callback
                   , impl.stdin_parsed_
                   , env_vars(impl.vars_)["REMOTE_ADDR"]

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_status.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_status.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_status.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -18,11 +18,12 @@
      , unloaded = null
      , activated = 1
      , accepted = activated
- , env_read = 2
- , get_read = 4
- , post_read = 8
- , cookies_read = 16
- , loaded = 32
+ , begin_request_found = 2
+ , env_read = 4
+ , get_read = 8
+ , post_read = 16
+ , cookies_read = 32
+ , loaded = 64
      , ok = loaded
      , aborted
      , closed

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -155,6 +155,10 @@
     basic_response<char_type>&
       set_header(const string_type& value);
       
+ /// Format and add a header given name and value, appending CRLF.
+ basic_response<char_type>&
+ set_header(string_type const& name, string_type const& value);
+
     /// Get the contents of the response as a string.
     /**
      * This copies the contents of the response into a string.
@@ -162,10 +166,6 @@
      */
     string_type str(bool include_header = false) const;
 
- /// Format and add a header given name and value, appending CRLF.
- basic_response<char_type>&
- set_header(string_type const& name, string_type const& value);
-
     string_type header_value(string_type const& name);
 
     void clear_headers();

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -20,15 +20,7 @@
     * > Update this file
     * > Update map.hpp with a new map type
     * > Update `data_map_type` in the `request_base` class
- * > Use the `BOOST_CGI_DETAIL_MAP_ACCESS` macro in `basic_request<>`,
- * next to the other uses of it.
     */
- enum env_data_type { env, env_data };
- enum get_data_type { get, get_data };
- enum post_data_type { post, post_data };
- enum cookie_data_type { cookies, cookie_data };
- enum form_data_type { form, form_data };
- enum session_data_type { session, session_data };
 
    template<typename Impl>
      env_map&
@@ -43,8 +35,11 @@
      cookie_map&
        cookie_vars(Impl& impl) { return boost::fusion::at_c<3>(impl); }
    template<typename Impl>
+ upload_map&
+ upload_vars(Impl& impl) { return boost::fusion::at_c<4>(impl); }
+ template<typename Impl>
      session_map&
- session_vars(Impl& impl) { return boost::fusion::at_c<4>(impl); }
+ session_vars(Impl& impl) { return boost::fusion::at_c<5>(impl); }
 
  } // namespace common
 BOOST_CGI_NAMESPACE_END

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/config.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/config.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/config.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -13,16 +13,56 @@
  namespace cgi {}
 } // namespace boost
 
+#ifndef NDEBUG
+# include <iostream>
+#endif // NDEBUG
+
+/// The namespace of the library.
+/**
+ * Default value:
+ * boost::cgi
+ * which puts the library in the boost::cgi namespace.
+ */
 #ifndef BOOST_CGI_NAMESPACE
 # define BOOST_CGI_NAMESPACE boost::cgi
 #endif // BOOST_CGI_NAMESPACE
 
+/// The opening namespace tag.
+/**
+ * Default value:
+ * namespace boost { namespace cgi {
+ * which puts the library in the boost::cgi namespace.
+ */
 #ifndef BOOST_CGI_NAMESPACE_BEGIN
 # define BOOST_CGI_NAMESPACE_BEGIN namespace boost { namespace cgi {
 #endif // BOOST_CGI_NAMESPACE_BEGIN
 
+/// The closing namespace tag.
+/**
+ * Default value:
+ * } } // namespace BOOST_CGI_NAMESPACE
+ * which ends the boost::cgi namespaces.
+ */
 #ifndef BOOST_CGI_NAMESPACE_END
 # define BOOST_CGI_NAMESPACE_END } } // namespace BOOST_CGI_NAMESPACE
 #endif // BOOST_CGI_NAMESPACE_END
 
+/// Library assertions, only in debug mode.
+#ifndef BOOST_CGI_DEBUG_ASSERT
+# ifdef NDEBUG
+# define BOOST_CGI_DEBUG_ASSERT(x) void
+# else
+# define BOOST_CGI_DEBUG_ASSERT(x) assert(x)
+# endif // NDEBUG
+#endif // BOOST_CGI_DEBUG_ASSERT
+
+/// Library assertions.
+#ifndef BOOST_CGI_ASSERT
+# ifdef NDEBUG
+# define BOOST_CGI_ASSERT(x) BOOST_ASSERT(x)
+# else
+# define BOOST_CGI_ASSERT(x) BOOST_CGI_DEBUG_ASSERT(x)
+# endif // NDEBUG
+#endif // BOOST_CGI_ASSERT
+
 #endif // BOOST_CGI_CONFIG_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/protocol_traits.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/protocol_traits.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/protocol_traits.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -117,6 +117,12 @@
                   tags::shareable_tcp_socket
> connection_type;
       typedef boost::asio::ip::tcp native_protocol_type;
+ typedef boost::asio::socket_acceptor_service<
+ native_protocol_type
+ > acceptor_service_type;
+ typedef
+ acceptor_service_type::implementation_type acceptor_impl_type;
+ typedef acceptor_service_type::native_type native_type;
       typedef unsigned short port_number_type;
       typedef boost::asio::ip::tcp::endpoint endpoint_type;
       typedef common::basic_client<

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -18,8 +18,8 @@
    /// Typedef for common usage (FCGI)
    typedef
      ::BOOST_CGI_NAMESPACE::common::basic_request_acceptor<
- fcgi_request_acceptor_service<>
- >
+ fcgi_request_acceptor_service<>
+ >
    acceptor;
 
  } // namespace fcgi

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -15,6 +15,7 @@
 #include <boost/bind.hpp>
 #include <boost/asio.hpp>
 #include <boost/thread.hpp>
+#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/static_assert.hpp>
 #include <boost/utility/enable_if.hpp>
@@ -82,9 +83,22 @@
>
    {
    public:
-
- /// The unique service identifier
- //static boost::asio::io_service::id id;
+
+ typedef acceptor_service_impl<Protocol> self_type;
+ typedef Protocol protocol_type;
+ typedef detail::protocol_traits<Protocol> traits;
+ typedef typename traits::protocol_service_type protocol_service_type;
+ typedef typename traits::native_protocol_type native_protocol_type;
+ typedef typename traits::native_type native_type;
+ typedef typename traits::request_type request_type;
+ typedef typename traits::pointer request_ptr;
+ typedef typename traits::acceptor_service_type acceptor_service_type;
+ typedef typename traits::acceptor_impl_type acceptor_impl_type;
+ typedef typename traits::port_number_type port_number_type;
+ typedef typename traits::endpoint_type endpoint_type;
+ typedef std::pair<
+ typename std::set<request_ptr>::iterator, bool> request_iter;
+ typedef boost::function<int (request_type&)> accept_handler_type;
 
      struct implementation_type
      {
@@ -104,32 +118,17 @@
        acceptor_impl_type acceptor_;
        boost::mutex mutex_;
        std::queue<boost::shared_ptr<request_type> > waiting_requests_;
+ std::set<request_ptr> running_requests_;
        protocol_service_type* service_;
        port_number_type port_num_;
        endpoint_type endpoint_;
+
      };
 
- typedef acceptor_service_impl<Protocol> type;
- typedef Protocol protocol_type;
- typedef typename
- type::implementation_type::protocol_service_type
- protocol_service_type;
- typedef typename
- type::implementation_type::acceptor_service_type
- acceptor_service_type;
- typedef typename
- type::implementation_type::native_protocol_type
- native_protocol_type;
- typedef typename
- acceptor_service_type::native_type native_type;
-
- typedef typename
- type::implementation_type::endpoint_type endpoint_type;
-
-
      explicit acceptor_service_impl(::BOOST_CGI_NAMESPACE::common::io_service& ios)
        : detail::service_base< ::BOOST_CGI_NAMESPACE::fcgi::acceptor_service_impl<Protocol> >(ios)
        , acceptor_service_(boost::asio::use_service<acceptor_service_type>(ios))
+ , strand_(ios)
      {
      }
 
@@ -219,34 +218,133 @@
      {
        return acceptor_service_.listen(impl.acceptor_, backlog, ec);
      }
+
+ void do_accept(implementation_type& impl
+ , accept_handler_type handler)
+ {
+ request_ptr new_request;
+
+ if (impl.waiting_requests_.empty())
+ {
+ // Accepting on new request.
+ new_request = request_type::create(*impl.service_);
+ }
+ else
+ {
+ // Accepting on existing request.
+ new_request = impl.waiting_requests_.front();
+ impl.waiting_requests_.pop();
+ }
+
+ impl.running_requests_.insert(new_request);
+
+ // The waiting request may be open if it is a multiplexed request.
+ // If we can reuse this request's connection, return.
+ if (!new_request->is_open() && !new_request->client().keep_connection())
+ {
+ // ...otherwise accept a new connection.
+ //std::cerr<< "Accepting a new connection." << std::endl;
+ acceptor_service_.async_accept(impl.acceptor_,
+ new_request->client().connection()->next_layer(), 0,
+ strand_.wrap(
+ boost::bind(&self_type::handle_accept
+ , this, boost::ref(impl), new_request, handler, _1
+ )
+ )
+ );
+ }
+ else
+ {
+ //std::cerr<< "Reusing existing connection." << std::endl;
+ impl.service_->post(
+ strand_.wrap(
+ boost::bind(&self_type::handle_accept
+ , this, boost::ref(impl), new_request, handler, boost::system::error_code()
+ )
+ )
+ );
+ }
+ }
 
- /// Accepts one request.
- template<typename CommonGatewayRequest>
- boost::system::error_code
- accept(implementation_type& impl, CommonGatewayRequest& request
+ void handle_accept(
+ implementation_type& impl, request_ptr new_request,
+ accept_handler_type handler, const boost::system::error_code& ec
+ )
+ {
+ new_request->status(common::accepted);
+ int status = handler(*new_request);
+ impl.running_requests_.erase(impl.running_requests_.find(new_request));
+ if (new_request->is_open()) {
+ new_request->close(http::ok, status);
+ }
+ new_request->clear();
+ impl.waiting_requests_.push(new_request);
+ }
+
+ /// Accepts a request and runs the passed handler.
+ void async_accept(implementation_type& impl
+ , accept_handler_type handler)
+ {
+ //impl.service_->post(
+ strand_.post(
+ boost::bind(&self_type::do_accept,
+ this, boost::ref(impl), handler)
+ );
+ //);
+ }
+
+ int accept(implementation_type& impl, accept_handler_type handler
              , endpoint_type* endpoint, boost::system::error_code& ec)
      {
- /* THIS BIT IS BROKEN:
- *-- The noncopyable semantics of a basic_request<> don't allow the
- assignment. There are a couple of ways around this; the one that
- seems sensible is to keep the basic_request<>s noncopyable, but
- allow the actual data be copied. At the moment the actual data is
- held in a vector<string> headers container and a BOOST_CGI_NAMESPACE::streambuf.
- These two bits should really be factored out into a message type.
- IOW, the message type will be copyable (but should probably have
- unique-ownership semantics).
- --*
+ typedef std::pair<std::set<request_type::pointer>::iterator, bool> pair_t;
+
+ request_ptr new_request;
+ pair_t insert_result;
+
+ if (impl.waiting_requests_.empty())
+ {
+ // Accepting on new request.
+ new_request = request_type::create(*impl.service_);
+ }
+ else
+ {
+ // Accepting on existing request.
+ new_request = impl.waiting_requests_.front();
+ impl.waiting_requests_.pop();
+ }
+
+ insert_result = impl.running_requests_.insert(new_request);
+
+ // The waiting request may be open if it is a multiplexed request.
+ if (!new_request->is_open())
        {
- boost::mutex::scoped_lock lk(impl.mutex_);
- if (!impl.waiting_requests_.empty())
+ // If we can reuse this request's connection, return.
+ if (!new_request->client().keep_connection())
          {
- request = *(impl.waiting_requests_.front());
- impl.waiting_requests_.pop();
- return ec;
+ // ...otherwise accept a new connection.
+ ec = acceptor_service_.accept(impl.acceptor_,
+ new_request->client().connection()->next_layer(), endpoint, ec);
          }
        }
- */
+ new_request->status(common::accepted);
+ int status = handler(*new_request);
+
+ impl.running_requests_.erase(insert_result.first);
+ if (new_request->is_open()) {
+ new_request->close(http::ok, status);
+ }
+ new_request->clear();
+ impl.waiting_requests_.push(new_request);
+
+ return status;
+ }
 
+ /// Accepts one request.
+ template<typename CommonGatewayRequest>
+ boost::system::error_code
+ accept(implementation_type& impl, CommonGatewayRequest& request
+ , endpoint_type* endpoint, boost::system::error_code& ec)
+ {
        BOOST_ASSERT
        ( ! request.is_open()
         && "Error: Calling accept on open request (close it first?)."
@@ -278,7 +376,7 @@
                       , Handler handler)
      {
        this->io_service().post(
- detail::accept_handler<type, Handler>(*this, impl, request, handler)
+ detail::accept_handler<self_type, Handler>(*this, impl, request, handler)
        );
      }
 
@@ -349,7 +447,8 @@
 
    public:
      /// The underlying socket acceptor service.
- acceptor_service_type& acceptor_service_;
+ acceptor_service_type& acceptor_service_;
+ boost::asio::io_service::strand strand_;
    };
 
  } // namespace fcgi

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/client.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/client.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/client.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -116,17 +116,14 @@
     return ec;
   }
 
- /// Write some data to the client.
+
   template<>
   template<typename ConstBufferSequence>
- std::size_t
+ void
   basic_client<
       connections::shareable_tcp
     , ::BOOST_CGI_NAMESPACE::common::tags::fcgi
- >::write_some(
- const ConstBufferSequence& buf
- , boost::system::error_code& ec
- )
+ >::prepare_buffer(const ConstBufferSequence& buf)
   {
     typename ConstBufferSequence::const_iterator iter = buf.begin();
     typename ConstBufferSequence::const_iterator end = buf.end();
@@ -167,35 +164,86 @@
       }
     }
     header_.reset(fcgi::spec_detail::STDOUT, request_id_, total_buffer_size);
-
- std::size_t bytes_transferred
- = boost::asio::write(*connection_, outbuf_
- , boost::asio::transfer_all(), ec);
-
+ }
+
+ template<>
+ void
+ basic_client<
+ connections::shareable_tcp
+ , ::BOOST_CGI_NAMESPACE::common::tags::fcgi
+ >::handle_write(std::size_t bytes_transferred, boost::system::error_code& ec)
+ {
     total_sent_bytes_ += bytes_transferred;
     total_sent_packets_ += 1;
     
+ std::size_t total_buffer_size = static_cast<std::size_t>(header_.content_length());
+
 #ifndef NDEBUG
     if (ec)
       std::cerr<< "Error " << ec << ": " << ec.message() << '\n';
     else
       std::cerr
- << "Transferred " << bytes_transferred
- << " / " << total_buffer_size << " bytes (running total: "
+ << "Transferred " << total_buffer_size
+ << " (+" << (bytes_transferred - total_buffer_size)
+ << " protocol) bytes (running total: "
         << total_sent_bytes_ << " bytes; "
         << total_sent_packets_ << " packets).\n";
 #endif // NDEBUG
 
     // Now remove the protocol overhead for the caller, who
- // doesn't care about them.
+ // doesn't want to know about them.
     bytes_transferred -= fcgi::spec::header_length::value;
     // Check everything was written ok.
- if (!ec && bytes_transferred != static_cast<std::size_t>(total_buffer_size))
+ if (!ec && bytes_transferred != total_buffer_size)
       ec = ::BOOST_CGI_NAMESPACE::fcgi::error::couldnt_write_complete_packet;
+ }
+
+
+ /// Write some data to the client.
+ template<>
+ template<typename ConstBufferSequence>
+ std::size_t
+ basic_client<
+ connections::shareable_tcp
+ , ::BOOST_CGI_NAMESPACE::common::tags::fcgi
+ >::write_some(
+ const ConstBufferSequence& buf
+ , boost::system::error_code& ec
+ )
+ {
+ prepare_buffer(buf);
+
+ std::size_t bytes_transferred
+ = boost::asio::write(*connection_, outbuf_
+ , boost::asio::transfer_all(), ec);
 
+ handle_write(bytes_transferred, ec);
+
     return bytes_transferred;
   }
 
+
+ /// Write some data to the client.
+ template<>
+ template<typename ConstBufferSequence, typename Handler>
+ void
+ basic_client<
+ connections::shareable_tcp
+ , ::BOOST_CGI_NAMESPACE::common::tags::fcgi
+ >::async_write_some(
+ const ConstBufferSequence& buf
+ , Handler handler
+ )
+ {
+ prepare_buffer(buf);
+
+ std::size_t bytes_transferred
+ = boost::asio::write(*connection_, outbuf_
+ , boost::asio::transfer_all(), ec);
+
+ handle_write(bytes_transferred, ec);
+ }
+
  } // namespace common
 
 namespace fcgi {

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_acceptor_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_acceptor_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_acceptor_service.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -39,11 +39,12 @@
 
     typedef fcgi::acceptor_service_impl<> service_impl_type;
     typedef service_impl_type::implementation_type implementation_type;
- typedef
- typename implementation_type::protocol_type protocol_type;
+ typedef service_impl_type::native_type native_type;
+ typedef service_impl_type::protocol_service_type protocol_service_type;
+ typedef service_impl_type::accept_handler_type accept_handler_type;
+ typedef implementation_type::protocol_type protocol_type;
     typedef implementation_type::endpoint_type endpoint_type;
- typedef typename service_impl_type::native_type native_type;
- //typedef basic_protocol_service<protocol_type> protocol_service_type;
+ typedef implementation_type::acceptor_service_type acceptor_service_type;
 
     /// The unique service identifier
     //static boost::asio::io_service::id id;
@@ -121,13 +122,17 @@
       return service_impl_.listen(impl, backlog, ec);
     }
 
-// template<typename CommonGatewayRequest>
-// boost::system::error_code
-// accept(implementation_type& impl, CommonGatewayRequest& request
-// , boost::system::error_code& ec)
-// {
-// return service_impl_.accept(impl, request, NULL, ec);
-// }
+ int accept(implementation_type& impl, accept_handler_type handler
+ , endpoint_type * ep, boost::system::error_code& ec)
+ {
+ return service_impl_.accept(impl, handler, ep, ec);
+ }
+
+ void async_accept(implementation_type& impl
+ , accept_handler_type handler)
+ {
+ return service_impl_.async_accept(impl, handler);
+ }
 
     template<typename CommonGatewayRequest>
     boost::system::error_code

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/request_service.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -45,8 +45,7 @@
       typedef spec_detail::Header header_type;
 
       implementation_type()
- : base_type::impl_base()
- , id_(0)
+ : id_(0)
         , request_role_(spec_detail::ANY)
       {
       }
@@ -79,6 +78,7 @@
 
     fcgi_request_service(::BOOST_CGI_NAMESPACE::common::io_service& ios)
       : detail::service_base<fcgi_request_service>(ios)
+ , strand_(ios)
     {
     }
 
@@ -125,7 +125,7 @@
 
     // **FIXME**
     template<typename Handler>
- void async_load(implementation_type& impl, bool parse_stdin, Handler handler);
+ void async_load(implementation_type& impl, common::parse_options opts, Handler handler);
 
     /// Returns true if the request environment params have been read.
     bool params_read(implementation_type& impl);
@@ -140,6 +140,35 @@
     {
       return impl.client_;
     }
+
+ private:
+
+ template<typename Handler>
+ void do_load(
+ implementation_type& impl, common::parse_options opts,
+ Handler handler, boost::system::error_code const& ec
+ );
+
+ template<typename Handler>
+ void handle_read_header(
+ implementation_type& impl,
+ Handler handler,
+ boost::system::error_code const& ec,
+ const std::size_t bytes_transferred
+ );
+
+ template<typename Handler>
+ void handle_begin_request_header(
+ implementation_type& impl,
+ Handler handler,
+ boost::system::error_code const& ec
+ );
+
+ template<typename Handler>
+ void async_read_header(
+ implementation_type& impl
+ , Handler handler
+ , boost::system::error_code& ec);
 
   protected:
     /// Read and parse the cgi POST meta variables (greedily)
@@ -172,6 +201,18 @@
     boost::system::error_code
       read_header(implementation_type& impl, boost::system::error_code& ec);
 
+ /// Asynchronously read a single header, but do nothing with it.
+ template<typename Handler>
+ void async_read_header(implementation_type& impl, Handler handler)
+ {
+ // clear the header first (might be unneccesary).
+ impl.header_buf_ = implementation_type::header_buffer_type();
+
+ async_read(*impl.client_.connection(), buffer(impl.header_buf_)
+ , boost::asio::transfer_all(), handler);
+ }
+
+
     /*** Various handlers go below here; they might find a
      * better place to live ***/
 
@@ -237,6 +278,8 @@
                           , implementation_type::header_buffer_type& header
                           , boost::system::error_code& ec);
                           
+ private:
+ boost::asio::io_service::strand strand_;
   };
 
  } // namespace fcgi

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/fcgi_request_service.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/fcgi_request_service.ipp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/fcgi_request_service.ipp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -10,6 +10,7 @@
 #define CGI_FCGI_REQUEST_SERVICE_IPP_INCLUDED__
 
 #include <boost/fusion/support.hpp>
+#include <boost/fusion/include/algorithm.hpp>
 #include <boost/system/error_code.hpp>
 #include <boost/fusion/include/vector.hpp>
 ////////////////////////////////////////////////////////////////
@@ -64,6 +65,14 @@
        bool parse_stdin_;
        Handler handler_;
      };
+
+ struct clear_data
+ {
+ template<typename T>
+ void operator()(T& x) const {
+ x.clear();
+ }
+ };
 
   } // namespace detail
 
@@ -110,20 +119,10 @@
     BOOST_CGI_INLINE void
     fcgi_request_service::clear(implementation_type& impl)
     {
- /*
- BOOST_ASSERT
- ( impl.request_status_ < common::activated
- && impl.request_status_ > common::ok
- && "Are you trying to clear() a request without closing it?"
- );
- */
-
       impl.post_buffer_.clear();
       impl.param_buffer_.clear();
- common::get_vars(impl.vars_).clear();
- common::post_vars(impl.vars_).clear();
- common::cookie_vars(impl.vars_).clear();
- common::env_vars(impl.vars_).clear();
+ // Clear all request data.
+ boost::fusion::for_each(impl.vars_, detail::clear_data());
       impl.stdin_parsed_ = false;
       impl.http_status_ = common::http::no_content;
       impl.request_status_ = common::null;
@@ -148,9 +147,6 @@
         implementation_type& impl, common::parse_options opts
       , boost::system::error_code& ec)
     {
- BOOST_ASSERT(!ec &&
- "Can't load request due to previous errors.");
-
       impl.client_.construct(impl, ec);
       // Bomb out if the client isn't open here.
       if (!impl.client_.connection()->is_open())
@@ -210,7 +206,7 @@
       if (request_method == "POST"
           && opts & common::parse_post_only)
       {
- std::cerr<< "Parsing post vars now.\n";
+ //std::cerr<< "Parsing post vars now.\n";
 
         if (opts & common::parse_post_only)
         {
@@ -238,14 +234,131 @@
 
       return ec;
     }
+
+ template<typename Handler>
+ BOOST_CGI_INLINE
+ void fcgi_request_service::do_load(
+ implementation_type& impl, common::parse_options opts,
+ Handler handler, boost::system::error_code const& ec
+ )
+ {
+ impl.client_.construct(impl, ec);
+ // Bomb out if the client isn't open here.
+ if (!impl.client_.connection()->is_open())
+ ec = error::client_not_open;
+
+ }
+
+ template<typename Handler>
+ BOOST_CGI_INLINE
+ void fcgi_request_service::handle_read_header(
+ implementation_type& impl,
+ Handler handler,
+ boost::system::error_code const& ec,
+ const std::size_t bytes_transferred
+ )
+ {
+ if(ec)
+ handler(ec);
+ else
+ {
+ int id(spec::get_request_id(impl.header_buf_));
+ if (id == spec::null_request_id::value)
+ handle_admin_request(impl);
+ else
+ if (impl.id_ && impl.id_ != id)
+ {
+ // The library doesn't "officially" support multiplexed
+ // connections yet, because I've never had access to a server
+ // that supports it.
+ //
+ // If you have one, can I use it?
+ handler(error::multiplexing_not_supported);
+ }
+ else
+ if (spec::get_type(impl.header_buf_)
+ == spec::begin_request::value)
+ {
+ impl.id_ = id;
+ impl.client_.request_id_ = id;
+ if (!read_header(impl, ec))
+ {
+ spec::begin_request packet(impl.header_buf_);
+ impl.request_role_ = packet.role();
+ impl.client_.keep_connection_
+ = packet.flags() & spec::keep_connection;
+ strand_.post(&self_type::handle_begin_request_header,
+ this, boost::ref(impl), handler, _1
+ );
+ }
+ }else
+ handle_other_request_header(impl);
+ }
+ }
+
+ template<typename Handler>
+ BOOST_CGI_INLINE
+ void fcgi_request_service::handle_begin_request_header(
+ implementation_type& impl,
+ Handler handler,
+ boost::system::error_code const& ec
+ )
+ {
+ if (//impl.request_status_ < common::env_read &&
+ opts & common::parse_env)
+ {
+ read_env_vars(impl, ec);
+ //impl.request_status_ = common::env_read;
+ }
+
+ string_type const&
+ request_method (env_vars(impl.vars_)["REQUEST_METHOD"]);
+
+ if (request_method == "GET")
+ {
+ if (parse_get_vars(impl, ec))
+ return ec;
+ }
+ else
+ if (request_method == "POST"
+ && opts & common::parse_post_only)
+ {
+ //std::cerr<< "Parsing post vars now.\n";
+
+ if (opts & common::parse_post_only)
+ {
+ while(!ec
+ && impl.client_.status() < common::stdin_read
+ && impl.request_status_ != common::loaded)
+ {
+ parse_packet(impl, ec);
+ }
+ }
+
+ if (parse_post_vars(impl, ec))
+ return ec;
+ }
+ if (opts & common::parse_cookies_only)
+ parse_cookie_vars(impl, ec);
+
+ if (ec == error::eof) {
+ ec = boost::system::error_code();
+ }
+ }
 
     // **FIXME**
     template<typename Handler> BOOST_CGI_INLINE
     void fcgi_request_service::async_load(
- implementation_type& impl, bool parse_stdin, Handler handler)
+ implementation_type& impl, common::parse_options opts, Handler handler)
     {
+ strand_.post(
+ boost::bind(&self_type::do_load<Handler>,
+ this, boost::ref(impl), opts, handler
+ )
+ );
+
       this->io_service().post(
- detail::async_load_helper<self_type, Handler>(this, parse_stdin, handler)
+ detail::async_load_helper<self_type, Handler>(this, opts & common::parse_post_only, handler)
       );
     }
 
@@ -346,7 +459,7 @@
             ec = error::couldnt_write_complete_packet;
         }
 
- } // while(!ec && !params_read(impl))
+ } // while(!ec && !(status(impl) & common::env_read))
       return ec;
     }
 
@@ -366,6 +479,29 @@
       return ec;
     }
 
+ template<typename Handler>
+ BOOST_CGI_INLINE void
+ fcgi_request_service::async_read_header(
+ implementation_type& impl
+ , Handler handler
+ , boost::system::error_code& ec)
+ {
+ // clear the header first (might be unneccesary).
+ impl.header_buf_ = implementation_type::header_buffer_type();
+
+ boost::asio::async_read(
+ *impl.client_.connection(), buffer(impl.header_buf_)
+ , boost::asio::transfer_all()
+ , strand_.wrap(
+ boost::bind(&self_type::handle_read_header,
+ this, boost::ref(impl), handler,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ )
+ )
+ }
+
     /*** Various handlers go below here; they might find a
      * better place to live ***/
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -21,6 +21,16 @@
 #include <boost/algorithm/string/trim.hpp>
 #include <boost/random/mersenne_twister.hpp>
 
+/// Characters that should be removed from any file uploads.
+/**
+ * The filename of any file uploads is a stripped version of
+ * the provided file's name. As such, we need to clean the uploaded
+ * file's name.
+ */
+#ifndef BOOST_CGI_UNSAFE_FILENAME_CHARS
+# define BOOST_CGI_UNSAFE_FILENAME_CHARS ":~.|"
+#endif // BOOST_CGI_UNSAFE_FILENAME_CHARS
+
 BOOST_CGI_NAMESPACE_BEGIN
 
  namespace common {
@@ -148,11 +158,9 @@
       string_type field_name (meta.substr(pos3+5, pos4-pos3-5));
       algo::trim_if(field_name, algo::is_any_of("\" "));
       
- string_type content_disposition (meta.substr(pos1+11, pos2-pos1-11));
-
       common::form_part part;
       part.name = field_name;
- part.content_disposition = content_disposition;
+ part.content_disposition = meta.substr(pos1+11, pos2-pos1-11);
 
       std::size_t next_pos = buffer.find(string_type("\r\n") + marker, end);
       
@@ -169,6 +177,7 @@
         string_type filename (meta.substr(pos6+9, pos5-pos6-9));
         algo::trim_if(filename, algo::is_any_of("\" "));
         // Load the filename as the value on the request's post map.
+ //part.value = "<FileUpload: '" + filename + "'>";
         part.value = filename;
         // Empty parameters could probably be left out, but setting even
         // an empty variable is consistent with the rest of the library.
@@ -184,6 +193,8 @@
           string_type randomatter (
             boost::lexical_cast<string_type>(time(NULL)));
           string_type user_ip (context_->random_string);
+ // Clean dangerous characters.
+ algo::trim_if(filename, algo::is_any_of(BOOST_CGI_UNSAFE_FILENAME_CHARS));
           string_type internal_filename(
             BOOST_CGI_UPLOAD_DIRECTORY+filename+"."+user_ip+"."+randomatter);
           part.path = internal_filename;
@@ -192,11 +203,11 @@
             , std::ios::out | std::ios::binary);
           file<< content;
           //file.flush();
+ context_->uploads_map[part.name.c_str()] = part;
         }
       }
       // Load the data to the request's post map.
       context_->data_map[part.name.c_str()] = part.value;
- context_->form_parts.push_back(part);
       
       buffer.erase(0, next_pos+marker.length()+2);
       if (buffer.length() >= 2

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -50,7 +50,6 @@
  * Usage:
  * ------
  * // Default to a HTML content-type.
- * #define BOOST_CGI_DEFAULT_CONTENT_TYPE "text/html"
  */
 #if defined(BOOST_CGI_NO_DEFAULT_CONTENT_TYPE)
 //{

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/utility/stencil.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/utility/stencil.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/utility/stencil.hpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -18,6 +18,8 @@
 #include <boost/cgi/common/response.hpp>
 #include <ctemplate/template.h>
 
+#define BOOST_CGI_HAS_STENCIL 1
+
 namespace stencils {
 
 class include_error
@@ -33,6 +35,16 @@
   {}
 };
 
+class template_error
+ : public std::logic_error
+{
+public:
+ template<typename Str>
+ template_error(Str const& filename)
+ : std::logic_error(
+ "Unable to find <Template: " + filename + ">")
+ {}
+};
 
 /// A class used to represent a section in the stencil.
 class section
@@ -143,7 +155,7 @@
    * @return dictionary The returned sub-dictionary is used to set fields in
    * an included stencil.
    *
- * @param section The section to include. Be sure to set *both* the
+ * @param sec The section to include. Be sure to set *both* the
    * section name and filename first.
    */
   dictionary include(section const& sec)
@@ -169,7 +181,8 @@
 
   /// Set the varible `name` to `value` in the stencil.
   template<>
- dictionary& dictionary::set(string_type const& name, string_type const& value)
+ inline dictionary&
+ dictionary::set(string_type const& name, string_type const& value)
   {
     impl->SetValue(name, value);
     return *this;
@@ -177,7 +190,8 @@
   
   /// Set a variable and show a section in one go.
   template<>
- dictionary& dictionary::set(
+ inline dictionary&
+ dictionary::set(
       string_type const& name,
       string_type const& value,
       section const& sec
@@ -204,30 +218,66 @@
   typedef stencils::section section;
   typedef stencils::dictionary dictionary;
   
+ enum reload_option
+ {
+ cached,
+ reload,
+ reload_all
+ };
+
   enum strip
   {
     do_not_strip = ctemplate::DO_NOT_STRIP,
     strip_blank_lines = ctemplate::STRIP_BLANK_LINES,
     strip_whitespace = ctemplate::STRIP_WHITESPACE
   };
-
+
+ enum parse_state
+ {
+ unused = ctemplate::TS_UNUSED,
+ empty = ctemplate::TS_EMPTY,
+ error = ctemplate::TS_ERROR,
+ ready = ctemplate::TS_READY,
+ should_reload = ctemplate::TS_SHOULD_RELOAD
+ };
+
   stencil(impl_type* parent_dict)
- : impl(parent_dict->MakeCopy("response"))
+ : tmpl(NULL)
+ , impl(parent_dict->MakeCopy("response"))
+ , expanded(false)
+ , per_expand_data()
   {
   }
   
   stencil(string_type const& root_dir = "")
- : impl(new impl_type("response"))
+ : tmpl(NULL)
+ , impl(new impl_type("response"))
+ , expanded(false)
+ , per_expand_data()
   {
     if (!root_dir.empty())
       ctemplate::Template::SetTemplateRootDirectory(root_dir);
   }
   
+ /// Clear the response buffer.
+ void reset(impl_type* use_dict = NULL)
+ {
+ impl.reset(use_dict ? use_dict : new impl_type("response"));
+ tmpl = NULL;
+ base_type::reset();
+ }
+
   /// Get the implementation type of the template.
   impl_type& native() { return *impl; }
+
+ parse_state state()
+ {
+ return tmpl ? (parse_state)tmpl->state() : unused;
+ }
 
   bool expand(
       string_type const& template_name,
+ enum reload_option reload_if_changed = cached,
       enum strip strip_option = strip_blank_lines
     )
   {
@@ -236,21 +286,29 @@
     // Clear the response body (but not headers).
     clear(false);
 
+ if (reload_if_changed == reload_all)
+ ctemplate::Template::ReloadAllIfChanged();
+
     // Get hold of the template to output.
     tmpl = ctemplate::Template::GetTemplate(
               template_name,
               (ctemplate::Strip)strip_option
            );
-
- if (!tmpl)
- return false;
-
+
+ if (!tmpl || state() == error)
+ throw template_error(template_name);
+ else
+ if (reload_if_changed == reload)
+ tmpl->ReloadIfChanged();
+
     // Add the response content back into the template.
     set("content", content);
     
     // Expand the template and write it to the response.
     string_type body;
- tmpl->Expand(&body, impl.get());
+ bool success = tmpl->ExpandWithData(&body, impl.get(), &per_expand_data);
+ if (!success)
+ return false;
     write(body);
 
     // All ok.
@@ -320,15 +378,23 @@
     }
     return *this;
   }
+
+ self_type& annotate_output(bool annotate = true) {
+ if (annotate)
+ per_expand_data.SetAnnotateOutput("");
+ return *this;
+ }
 
   stencil_type* tmpl;
   boost::scoped_ptr<impl_type> impl;
   bool expanded;
+ ctemplate::PerExpandData per_expand_data;
 };
 
   /// Set the varible `name` to `value` in the stencil.
   template<>
- stencil& stencil::set(string_type const& name, string_type const& value)
+ inline stencil&
+ stencil::set(string_type const& name, string_type const& value)
   {
     impl->SetValue(name, value);
     return *this;
@@ -336,7 +402,8 @@
 
   /// Set a variable and show a section in one go.
   template<>
- stencil& stencil::set(
+ inline stencil&
+ stencil::set(
       string_type const& name,
       string_type const& value,
       section const& sec
@@ -348,10 +415,11 @@
 
 } } } // namespace boost::cgi::common
 
-namespace boost { namespace cgi {
+namespace boost {
 
- using common::stencil;
+ namespace cgi { using common::stencil; }
+ namespace fcgi { using cgi::common::stencil; }
   
-} } // namespace boost::cgi
+} // namespace boost
 
 #endif // BOOST_CGI_UTILITY_STENCIL_HPP_INCLUDED_20091222_

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -33,6 +33,20 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_stencil", "cgi_stencil\cgi_stencil.vcproj", "{B08A2E6D-9973-42F3-9621-90F3BD4A1721}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_run_all", "fcgi_run_all\fcgi_run_all.vcproj", "{2BE173AB-B577-4413-9CD0-1CEA022F0DEE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_upload", "cgi_upload\cgi_upload.vcproj", "{DF63E5DB-97C8-465D-98FB-5FA64CEDBA62}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_upload", "fcgi_upload\fcgi_upload.vcproj", "{234A7010-1CA1-4E76-8B2C-55167902DB7F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_wiki", "cgi_wiki\cgi_wiki.vcproj", "{FFF275FA-323A-4699-9D04-A5C9BDD6048B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_async_echo", "fcgi_async_echo\fcgi_async_echo.vcproj", "{C34170B1-6404-463E-8081-7582B140A8C3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_stencil", "fcgi_stencil\fcgi_stencil.vcproj", "{6B94FB20-A187-4225-938E-A005352FDD12}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_images", "cgi_images\cgi_images.vcproj", "{B59C59FA-E4A0-498D-A8CF-9FAD68B4315C}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -102,6 +116,34 @@
                 {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Debug|Win32.Build.0 = Debug|Win32
                 {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Release|Win32.ActiveCfg = Release|Win32
                 {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Release|Win32.Build.0 = Release|Win32
+ {2BE173AB-B577-4413-9CD0-1CEA022F0DEE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2BE173AB-B577-4413-9CD0-1CEA022F0DEE}.Debug|Win32.Build.0 = Debug|Win32
+ {2BE173AB-B577-4413-9CD0-1CEA022F0DEE}.Release|Win32.ActiveCfg = Release|Win32
+ {2BE173AB-B577-4413-9CD0-1CEA022F0DEE}.Release|Win32.Build.0 = Release|Win32
+ {DF63E5DB-97C8-465D-98FB-5FA64CEDBA62}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DF63E5DB-97C8-465D-98FB-5FA64CEDBA62}.Debug|Win32.Build.0 = Debug|Win32
+ {DF63E5DB-97C8-465D-98FB-5FA64CEDBA62}.Release|Win32.ActiveCfg = Release|Win32
+ {DF63E5DB-97C8-465D-98FB-5FA64CEDBA62}.Release|Win32.Build.0 = Release|Win32
+ {234A7010-1CA1-4E76-8B2C-55167902DB7F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {234A7010-1CA1-4E76-8B2C-55167902DB7F}.Debug|Win32.Build.0 = Debug|Win32
+ {234A7010-1CA1-4E76-8B2C-55167902DB7F}.Release|Win32.ActiveCfg = Release|Win32
+ {234A7010-1CA1-4E76-8B2C-55167902DB7F}.Release|Win32.Build.0 = Release|Win32
+ {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Debug|Win32.Build.0 = Debug|Win32
+ {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Release|Win32.ActiveCfg = Release|Win32
+ {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Release|Win32.Build.0 = Release|Win32
+ {C34170B1-6404-463E-8081-7582B140A8C3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C34170B1-6404-463E-8081-7582B140A8C3}.Debug|Win32.Build.0 = Debug|Win32
+ {C34170B1-6404-463E-8081-7582B140A8C3}.Release|Win32.ActiveCfg = Release|Win32
+ {C34170B1-6404-463E-8081-7582B140A8C3}.Release|Win32.Build.0 = Release|Win32
+ {6B94FB20-A187-4225-938E-A005352FDD12}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6B94FB20-A187-4225-938E-A005352FDD12}.Debug|Win32.Build.0 = Debug|Win32
+ {6B94FB20-A187-4225-938E-A005352FDD12}.Release|Win32.ActiveCfg = Release|Win32
+ {6B94FB20-A187-4225-938E-A005352FDD12}.Release|Win32.Build.0 = Release|Win32
+ {B59C59FA-E4A0-498D-A8CF-9FAD68B4315C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B59C59FA-E4A0-498D-A8CF-9FAD68B4315C}.Debug|Win32.Build.0 = Debug|Win32
+ {B59C59FA-E4A0-498D-A8CF-9FAD68B4315C}.Release|Win32.ActiveCfg = Release|Win32
+ {B59C59FA-E4A0-498D-A8CF-9FAD68B4315C}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.suo
==============================================================================
Binary files. No diff available.

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/Jamfile.v2 (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/Jamfile.v2 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -40,7 +40,6 @@
     [ glob $(top)/boost/cgi/util/*.hpp ]
     [ glob $(top)/boost/cgi/connections/*.hpp ]
     [ glob $(top)/boost/cgi/cgi/*.hpp ]
- [ glob $(top)/boost/cgi/acgi/*.hpp ]
     [ glob $(top)/boost/cgi/fcgi/*.hpp ]
     $(top)/boost/cgi/fcgi/client.hpp
     $(top)/boost/cgi/fcgi/service.hpp
@@ -52,7 +51,7 @@
   :
     <doxygen:param>TAB_SIZE=2
     # <doxygen:param>EXTRACT_ALL=YES
- <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+ <doxygen:param>HIDE_UNDOC_MEMBERS=NO
     # Show all inherited members of a class in the documentation of that class
     # as if those members were ordinary class members.
     <doxygen:param>INLINE_INHERITED_MEMB=YES
@@ -104,7 +103,7 @@
 boostbook standalone
   :
     cgi_xml
- autodoc
+ #autodoc
     #cgi_dox
   :
     # This one turns on indexing:
@@ -132,8 +131,11 @@
     # Max depth in each TOC:
     <xsl:param>toc.max.depth=4
     # How far down we go with TOC's
- <xsl:param>generate.section.toc.level=10
+ <xsl:param>generate.section.toc.level=1
+ #<xsl:param>generate.toc="chapter nop section nop"
+
     #<xsl:param>root.filename="svg_plot"
+ #<xsl:param>root.filename=cgi
     <xsl:param>boost.image.src="../../../../boost/boostified/release/doc/html/images"
 
     # <xsl:param>project.root=http://beta.boost.org/development

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/cgi.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/cgi.qbk (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/cgi.qbk 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -10,7 +10,7 @@
     [version 0.01]
     [dirname the_document_dir]
     [copyright 2007 2008 Darren Garvey]
- [purpose Thoughts about CGI implementation]
+ [purpose Documentation for CGI / FastCGI Library]
     [authors [Garvey, Darren]]
     [license
         Distributed under the Boost Software License, Version 1.0.
@@ -19,8 +19,12 @@
     ]
 ]
 
-[def __this__ ["FSCGI"]] [/ name of the library]
+[template mdash[] '''&mdash; ''']
+[template indexterm1[term1] '''<indexterm><primary>'''[term1]'''</primary></indexterm>''']
+[template indexterm2[term1 term2] '''<indexterm><primary>'''[term1]'''</primary><secondary>'''[term2]'''</secondary></indexterm>''']
+
 
+[def __this__ ["FSCGI"]] [/ name of the library]
 [def __cgi__ [@http://en.wikipedia.org/wiki/Common_Gateway_Interface CGI]]
 [def __scgi__ [@http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface SCGI]]
 [def __fcgi__ [@http://en.wikipedia.org/wiki/FastCGI FastCGI]]
@@ -82,13 +86,13 @@
 These documents are either hosted at [@http://sourceforge.net/projects/cgi/ sourceforge], or at [@http://svn.boost.org/svn/boost/browser/sandbox/SOC/2007/cgi svn.boost.org]. For free!
 ]
 
-[include preface.qbk]
+[/include preface.qbk]
 
-[include:intro introduction.qbk]
+[/include:intro introduction.qbk]
 
-[include quickstart.qbk]
+[/include quickstart.qbk]
 
-[include user_guide.qbk]
+[/include user_guide.qbk]
 
 [/include:tutorial user_guide/tutorial.qbk]
 
@@ -100,7 +104,7 @@
 
 [/xinclude ../cgi_dox.xml]
 
-[include:examples examples.qbk]
+[/include:examples examples.qbk]
 
 [/include:reference reference.qbk]
 
@@ -110,8 +114,10 @@
 
 [/include troubleshooting.qbk]
 
-[include acknowledgements.qbk]
+[/include acknowledgements.qbk]
 
 [/xinclude index.xml]
 
-[/include reference.qbk]
+[/xinclude quickref.xml]
+
+[include reference.qbk]

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/reference.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/reference.qbk (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/doc/src/reference.qbk 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -1,5 +1,8 @@
 [/
- / Copyright (c) 2009 Darren Garvey (darren at omnisplat dot com)
+ / Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ /
+ / Copyright (c) 2009 Darren Garvey (darren dot garvey at gmail dot com)
+ / -> Modification to work with the CGI library.
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -10,135 +13,76 @@
 [xinclude quickref.xml]
 
 
-[section:common__error__cgi_errors__gt_ common::error::cgi_errors >]
+[section:cgi__common__stencil cgi__common::stencil]
 
 
 
- template<>
- struct is_error_code_enum< ::cgi::common::error::cgi_errors >
+ class stencil
 
 
-[heading Member Functions]
+[heading Types]
 [table
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__error__cgi_errors__gt_.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
+
+ [[link cgi.reference.cgi__common__stencil.base_type [*base_type]]]
     []
- ]
   
-]
-
-
-[section:BOOST_STATIC_CONSTANT common::error::cgi_errors >::BOOST_STATIC_CONSTANT]
-
-[indexterm2 BOOST_STATIC_CONSTANT..common::error::cgi_errors >]
-
- BOOST_STATIC_CONSTANT(
- bool ,
- value = true);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:error__fcgi_errors__gt_ error::fcgi_errors >]
-
-
-
- template<>
- struct is_error_code_enum< ::cgi::error::fcgi_errors >
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
+ ]
 
   [
- [[link cgi.reference.error__fcgi_errors__gt_.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
+
+ [[link cgi.reference.cgi__common__stencil.dictionary [*dictionary]]]
     []
- ]
   
-]
-
-
-[section:BOOST_STATIC_CONSTANT error::fcgi_errors >::BOOST_STATIC_CONSTANT]
-
-[indexterm2 BOOST_STATIC_CONSTANT..error::fcgi_errors >]
-
- BOOST_STATIC_CONSTANT(
- bool ,
- value = true);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:acgi__acceptor acgi::acceptor]
-
-[indexterm1 acgi::acceptor] Typedef for common usage (ACGI).
-
- typedef ::cgi::common::basic_request_acceptor< acgi_request_acceptor_service<> > acceptor;
-
-
-[heading Types]
-[table
- [[Name][Description]]
+ ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.endpoint_type [*endpoint_type]]]
+ [[link cgi.reference.cgi__common__stencil.impl_type [*impl_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.native_type [*native_type]]]
+ [[link cgi.reference.cgi__common__stencil.parse_state [*parse_state]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.next_layer_type [*next_layer_type]]]
+ [[link cgi.reference.cgi__common__stencil.reload_option [*reload_option]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.port_number_type [*port_number_type]]]
+ [[link cgi.reference.cgi__common__stencil.section [*section]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.protocol_service_type [*protocol_service_type]]]
+ [[link cgi.reference.cgi__common__stencil.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.protocol_type [*protocol_type]]]
+ [[link cgi.reference.cgi__common__stencil.stencil_type [*stencil_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_request_acceptor.service_type [*service_type]]]
+ [[link cgi.reference.cgi__common__stencil.strip [*strip]]]
     []
   
   ]
@@ -150,137 +94,151 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_request_acceptor.accept [*accept]]]
+ [[link cgi.reference.cgi__common__stencil.add [*add]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.assign [*assign]]]
+ [[link cgi.reference.cgi__common__stencil.annotate_output [*annotate_output]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.async_accept [*async_accept]]]
- [Asynchronously accept one request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor [*basic_request_acceptor]]]
+ [[link cgi.reference.cgi__common__stencil.expand [*expand]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.bind [*bind]]]
+ [[link cgi.reference.cgi__common__stencil.include [*include]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
+ [[link cgi.reference.cgi__common__stencil.native [*native]]]
+ [Get the implementation type of the template. ]
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.close [*close]]]
- [Close the acceptor. ]
+ [[link cgi.reference.cgi__common__stencil.reset [*reset]]]
+ [Clear the response buffer. ]
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.is_cgi [*is_cgi]]]
- []
+ [[link cgi.reference.cgi__common__stencil.set [*set]]]
+ [Set the varible `name` to `value` in the stencil. ]
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.is_open [*is_open]]]
- [Check if the acceptor is open. ]
+ [[link cgi.reference.cgi__common__stencil.show [*show]]]
+ [Show a section. ]
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.listen [*listen]]]
- [Set the acceptor to listen. ]
+ [[link cgi.reference.cgi__common__stencil.state [*state]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_request_acceptor.local_endpoint [*local_endpoint]]]
+ [[link cgi.reference.cgi__common__stencil.stencil [*stencil]]]
     []
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.common__basic_request_acceptor.native [*native]]]
+ [[link cgi.reference.cgi__common__stencil.expanded [*expanded]]]
     []
   ]
-
+
   [
- [[link cgi.reference.common__basic_request_acceptor.open [*open]]]
- [Open the acceptor. ]
+ [[link cgi.reference.cgi__common__stencil.impl [*impl]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.common__basic_request_acceptor.protocol_service [*protocol_service]]]
+ [[link cgi.reference.cgi__common__stencil.per_expand_data [*per_expand_data]]]
     []
   ]
-
+
   [
- [[link cgi.reference.common__basic_request_acceptor._basic_request_acceptor [*~basic_request_acceptor]]]
+ [[link cgi.reference.cgi__common__stencil.tmpl [*tmpl]]]
     []
   ]
-
+
 ]
 
 
+[section:add cgi__common::stencil::add]
+
+[indexterm2 add..cgi__common::stencil]
+
+ dictionary add(
+ section const & sec);
+
+
 
 [endsect]
 
 
 
-[section:acgi__request acgi::request]
+[section:annotate_output cgi__common::stencil::annotate_output]
 
-[indexterm1 acgi::request]
+[indexterm2 annotate_output..cgi__common::stencil]
 
- typedef common::basic_request< acgi::request_service, acgi::service > request;
+ self_type & annotate_output(
+ bool annotate = true);
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link cgi.reference.acgi__request_service.base_type [*base_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.acgi__request_service.map_type [*map_type]]]
- []
-
- ]
+[section:base_type cgi__common::stencil::base_type]
 
- [
+[indexterm2 base_type..cgi__common::stencil]
 
- [[link cgi.reference.acgi__request_service.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
+ typedef boost::cgi::common::response base_type;
+
+
+
+
+[endsect]
+
+
+
+[section:dictionary cgi__common::stencil::dictionary]
+
+[indexterm2 dictionary..cgi__common::stencil]
+
+ typedef stencils::dictionary dictionary;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link cgi.reference.acgi__request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.stencils__dictionary.impl_type [*impl_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.self_type [*self_type]]]
+ [[link cgi.reference.stencils__dictionary.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.type [*type]]]
+ [[link cgi.reference.stencils__dictionary.string_type [*string_type]]]
     []
   
   ]
@@ -292,109 +250,28 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.acgi__request_service.clear [*clear]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_service.client [*client]]]
- [Return the connection associated with the request. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_service.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.is_open [*is_open]]]
- [Return if the request is still open. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.request_service [*request_service]]]
- []
+ [[link cgi.reference.stencils__dictionary.add [*add]]]
+ [Add a section into the stencil. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.set_service [*set_service]]]
+ [[link cgi.reference.stencils__dictionary.dictionary [*dictionary]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.set_status [*set_status]]]
- [Set the request status. ]
- ]
-
- [
- [[link cgi.reference.acgi__request_service.shutdown_service [*shutdown_service]]]
- []
+ [[link cgi.reference.stencils__dictionary.include [*include]]]
+ [Include a file into the stencil. ]
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.acgi__request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.stencils__dictionary.set [*set]]]
+ [Set the varible `name` to `value` in the stencil. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
+ [[link cgi.reference.stencils__dictionary.show [*show]]]
+ [Show a section. ]
   ]
   
 ]
@@ -404,7 +281,7 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.acgi__request_service.id [*id]]]
+ [[link cgi.reference.stencils__dictionary.impl [*impl]]]
     []
   ]
 
@@ -415,260 +292,158 @@
 [endsect]
 
 
-[section:acgi__request_impl acgi::request_impl]
 
+[section:expand cgi__common::stencil::expand]
 
+[indexterm2 expand..cgi__common::stencil]
 
- class request_impl
+ bool expand(
+ string_type const & template_name,
+ enum reload_option reload_if_changed = cached,
+ enum strip strip_option = strip_blank_lines);
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link cgi.reference.acgi__request_impl.client_type [*client_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.acgi__request_impl.conn_ptr [*conn_ptr]]]
- []
-
- ]
+[section:expanded cgi__common::stencil::expanded]
 
- [
+[indexterm2 expanded..cgi__common::stencil]
 
- [[link cgi.reference.acgi__request_impl.connection_type [*connection_type]]]
- []
-
- ]
+ bool expanded;
 
- [
 
- [[link cgi.reference.acgi__request_impl.map_type [*map_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.acgi__request_impl.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.acgi__request_impl.protocol_type [*protocol_type]]]
- []
-
- ]
+[section:impl cgi__common::stencil::impl]
 
-]
+[indexterm2 impl..cgi__common::stencil]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ boost::scoped_ptr< impl_type > impl;
 
- [
- [[link cgi.reference.acgi__request_impl.connection [*connection]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_impl.http_status [*http_status]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_impl.request_impl [*request_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_impl.status [*status]]]
- []
- ]
-
- [
- [[link cgi.reference.acgi__request_impl.stdin_parsed [*stdin_parsed]]]
- []
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.acgi__request_impl.service_ [*service_]]]
- []
- ]
+[endsect]
 
- [
- [[link cgi.reference.acgi__request_impl.stdin_bytes_left_ [*stdin_bytes_left_]]]
- []
- ]
 
- [
- [[link cgi.reference.acgi__request_impl.stdin_data_read_ [*stdin_data_read_]]]
- []
- ]
 
- [
- [[link cgi.reference.acgi__request_impl.stdin_parsed_ [*stdin_parsed_]]]
- []
- ]
+[section:impl_type cgi__common::stencil::impl_type]
 
-]
+[indexterm2 impl_type..cgi__common::stencil]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+ typedef ctemplate::TemplateDictionary impl_type;
 
- [
- [[link cgi.reference.acgi__request_impl.connection_ [*connection_]]]
- []
- ]
 
- [
- [[link cgi.reference.acgi__request_impl.http_status_ [*http_status_]]]
- []
- ]
 
- [
- [[link cgi.reference.acgi__request_impl.request_status_ [*request_status_]]]
- []
- ]
 
-]
+[endsect]
 
 
-[section:client_type acgi::request_impl::client_type]
+[section:include cgi__common::stencil::include]
 
-[indexterm2 client_type..acgi::request_impl]
+[indexterm2 include..cgi__common::stencil]
 
- typedef ::cgi::common::basic_client< connection_type, common::tags::acgi > client_type;
+ dictionary ``[link cgi.reference.cgi__common__stencil.include.overload1 include]``(
+ string_type const & section_name,
+ string_type const & filename);
 
+ dictionary ``[link cgi.reference.cgi__common__stencil.include.overload2 include]``(
+ section const & sec);
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[section:overload1 cgi__common::stencil::include (1 of 2 overloads)]
 
- [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
- []
-
- ]
+ dictionary include(
+ string_type const & section_name,
+ string_type const & filename);
 
- [
 
- [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
- []
-
- ]
 
-]
+[endsect]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+
+
+[section:overload2 cgi__common::stencil::include (2 of 2 overloads)]
+
+
+
+ dictionary include(
+ section const & sec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:native cgi__common::stencil::native]
+
+[indexterm2 native..cgi__common::stencil] Get the implementation type of the template.
+
+ impl_type & native();
+
+
+
+[endsect]
+
+
+
+[section:parse_state cgi__common::stencil::parse_state]
+
+[indexterm2 parse_state..cgi__common::stencil]
+
+ enum parse_state
+
+[heading Values]
+[variablelist
 
   [
- [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
- [Asynchronously read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
- [Asynchronously write some data to the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
+ [unused]
     []
   ]
-
+
   [
- [[link cgi.reference.common__basic_client.close [*close]]]
+ [empty]
     []
   ]
-
- [
- [[link cgi.reference.common__basic_client.connection [*connection]]]
- [Get a shared_ptr of the connection associated with the client. ]
- ]
-
+
   [
- [[link cgi.reference.common__basic_client.is_open [*is_open]]]
+ [error]
     []
   ]
-
- [
- [[link cgi.reference.common__basic_client.read_some [*read_some]]]
- [Read some data from the client. ]
- ]
-
+
   [
- [[link cgi.reference.common__basic_client.request_id [*request_id]]]
+ [ready]
     []
   ]
-
- [
- [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
- [Associate a connection with this client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.write_some [*write_some]]]
- [Write some data to the client. ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
+ [should_reload]
     []
   ]
 
 ]
 
-A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
-
 
 
 [endsect]
 
 
 
-[section:conn_ptr acgi::request_impl::conn_ptr]
-
-[indexterm2 conn_ptr..acgi::request_impl]
+[section:per_expand_data cgi__common::stencil::per_expand_data]
 
- typedef connection_type::pointer conn_ptr;
+[indexterm2 per_expand_data..cgi__common::stencil]
 
+ ctemplate::PerExpandData per_expand_data;
 
 
 
@@ -676,23 +451,31 @@
 
 
 
-[section:connection acgi::request_impl::connection]
-
-[indexterm2 connection..acgi::request_impl]
+[section:reload_option cgi__common::stencil::reload_option]
 
- conn_ptr & connection();
+[indexterm2 reload_option..cgi__common::stencil]
 
+ enum reload_option
 
+[heading Values]
+[variablelist
 
-[endsect]
-
-
+ [
+ [cached]
+ []
+ ]
 
-[section:connection_ acgi::request_impl::connection_]
+ [
+ [reload]
+ []
+ ]
 
-[indexterm2 connection_..acgi::request_impl]
+ [
+ [reload_all]
+ []
+ ]
 
- conn_ptr connection_;
+]
 
 
 
@@ -700,12 +483,12 @@
 
 
 
-[section:connection_type acgi::request_impl::connection_type]
-
-[indexterm2 connection_type..acgi::request_impl]
+[section:reset cgi__common::stencil::reset]
 
- typedef connections::async_stdio connection_type;
+[indexterm2 reset..cgi__common::stencil] Clear the response buffer.
 
+ void reset(
+ impl_type * use_dict = NULL);
 
 
 
@@ -713,36 +496,59 @@
 
 
 
-[section:http_status acgi::request_impl::http_status]
-
-[indexterm2 http_status..acgi::request_impl]
-
- common::http::status_code & http_status();
-
-
+[section:section cgi__common::stencil::section]
 
-[endsect]
+[indexterm2 section..cgi__common::stencil]
 
+ typedef stencils::section section;
 
 
-[section:http_status_ acgi::request_impl::http_status_]
+[heading Types]
+[table
+ [[Name][Description]]
 
-[indexterm2 http_status_..acgi::request_impl]
+ [
 
- common::http::status_code http_status_;
+ [[link cgi.reference.stencils__section.char_type [*char_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.stencils__section.string_type [*string_type]]]
+ []
+
+ ]
 
-[endsect]
+]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.stencils__section.section [*section]]]
+ []
+ ]
+
+]
 
-[section:map_type acgi::request_impl::map_type]
+[heading Data Members]
+[table
+ [[Name][Description]]
 
-[indexterm2 map_type..acgi::request_impl]
+ [
+ [[link cgi.reference.stencils__section.filename [*filename]]]
+ []
+ ]
 
- typedef ::cgi::common::map map_type;
+ [
+ [[link cgi.reference.stencils__section.name [*name]]]
+ []
+ ]
 
+]
 
 
 
@@ -750,11 +556,11 @@
 
 
 
-[section:protocol_service_type acgi::request_impl::protocol_service_type]
+[section:self_type cgi__common::stencil::self_type]
 
-[indexterm2 protocol_service_type..acgi::request_impl]
+[indexterm2 self_type..cgi__common::stencil]
 
- typedef ::cgi::acgi::service protocol_service_type;
+ typedef stencil self_type;
 
 
 [heading Types]
@@ -763,49 +569,63 @@
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
+ [[link cgi.reference.cgi__common__stencil.base_type [*base_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.cgi__common__stencil.dictionary [*dictionary]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
+ [[link cgi.reference.cgi__common__stencil.impl_type [*impl_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
+ [[link cgi.reference.cgi__common__stencil.parse_state [*parse_state]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
+ [[link cgi.reference.cgi__common__stencil.reload_option [*reload_option]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
+ [[link cgi.reference.cgi__common__stencil.section [*section]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
+ [[link cgi.reference.cgi__common__stencil.self_type [*self_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.cgi__common__stencil.stencil_type [*stencil_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.cgi__common__stencil.strip [*strip]]]
     []
   
   ]
@@ -817,66 +637,139 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
+ [[link cgi.reference.cgi__common__stencil.add [*add]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
+ [[link cgi.reference.cgi__common__stencil.annotate_output [*annotate_output]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
+ [[link cgi.reference.cgi__common__stencil.expand [*expand]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
+ [[link cgi.reference.cgi__common__stencil.include [*include]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
+ [[link cgi.reference.cgi__common__stencil.native [*native]]]
+ [Get the implementation type of the template. ]
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
+ [[link cgi.reference.cgi__common__stencil.reset [*reset]]]
+ [Clear the response buffer. ]
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
+ [[link cgi.reference.cgi__common__stencil.set [*set]]]
+ [Set the varible `name` to `value` in the stencil. ]
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
+ [[link cgi.reference.cgi__common__stencil.show [*show]]]
+ [Show a section. ]
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
+ [[link cgi.reference.cgi__common__stencil.state [*state]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.cgi__common__stencil.stencil [*stencil]]]
     []
   ]
   
 ]
 
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
-
-
+[heading Data Members]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
+ [[link cgi.reference.cgi__common__stencil.expanded [*expanded]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.cgi__common__stencil.impl [*impl]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.cgi__common__stencil.per_expand_data [*per_expand_data]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.cgi__common__stencil.tmpl [*tmpl]]]
+ []
+ ]
+
+]
+
+
+
+[endsect]
+
+
+[section:set cgi__common::stencil::set]
+
+[indexterm2 set..cgi__common::stencil] Set the varible `name` to `value` in the stencil.
+
+ template<
+ typename T >
+ self_type & ``[link cgi.reference.cgi__common__stencil.set.overload1 set]``(
+ string_type const & name,
+ T value);
+
+ template<
+ typename T >
+ self_type & ``[link cgi.reference.cgi__common__stencil.set.overload2 set]``(
+ string_type const & name,
+ T value,
+ section const & sec);
+
+ template<>
+ stencil & ``[link cgi.reference.cgi__common__stencil.set.overload3 set]``(
+ string_type const & name,
+ string_type const & value);
+
+ template<>
+ stencil & ``[link cgi.reference.cgi__common__stencil.set.overload4 set]``(
+ string_type const & name,
+ string_type const & value,
+ section const & sec);
+
+
+[section:overload1 cgi__common::stencil::set (1 of 4 overloads)]
+
+Set the varible `name` to `value` in the stencil.
+
+ template<
+ typename T >
+ self_type & set(
+ string_type const & name,
+ T value);
 
 
-[section:protocol_type acgi::request_impl::protocol_type]
 
-[indexterm2 protocol_type..acgi::request_impl]
+[heading Parameters]
+
+
+[variablelist
+
+[[name][The name of the variable. Use {{name}} in the stencil. ]]
 
- typedef protocol_service_type::protocol_type protocol_type;
+[[value][The value, can be any type that is supported by boost::lexical\_cast. See the docs for lexical\_cast: http://www.boost.org/libs/lexical\_cast]]
 
+]
 
 
 
@@ -884,11 +777,16 @@
 
 
 
-[section:request_impl acgi::request_impl::request_impl]
+[section:overload2 cgi__common::stencil::set (2 of 4 overloads)]
 
-[indexterm2 request_impl..acgi::request_impl]
+Set a variable and show a section in one go.
 
- request_impl();
+ template<
+ typename T >
+ self_type & set(
+ string_type const & name,
+ T value,
+ section const & sec);
 
 
 
@@ -896,11 +794,14 @@
 
 
 
-[section:request_status_ acgi::request_impl::request_status_]
+[section:overload3 cgi__common::stencil::set (3 of 4 overloads)]
 
-[indexterm2 request_status_..acgi::request_impl]
+Set the varible `name` to `value` in the stencil.
 
- common::request_status request_status_;
+ template<>
+ stencil & set(
+ string_type const & name,
+ string_type const & value);
 
 
 
@@ -908,23 +809,30 @@
 
 
 
-[section:service_ acgi::request_impl::service_]
+[section:overload4 cgi__common::stencil::set (4 of 4 overloads)]
 
-[indexterm2 service_..acgi::request_impl]
+Set a variable and show a section in one go.
 
- protocol_service_type * service_;
+ template<>
+ stencil & set(
+ string_type const & name,
+ string_type const & value,
+ section const & sec);
 
 
 
 [endsect]
 
 
+[endsect]
+
 
-[section:status acgi::request_impl::status]
+[section:show cgi__common::stencil::show]
 
-[indexterm2 status..acgi::request_impl]
+[indexterm2 show..cgi__common::stencil] Show a section.
 
- common::request_status & status();
+ self_type & show(
+ section const & sec);
 
 
 
@@ -932,23 +840,34 @@
 
 
 
-[section:stdin_bytes_left_ acgi::request_impl::stdin_bytes_left_]
+[section:state cgi__common::stencil::state]
 
-[indexterm2 stdin_bytes_left_..acgi::request_impl]
+[indexterm2 state..cgi__common::stencil]
 
- std::size_t stdin_bytes_left_;
+ parse_state state();
 
 
 
 [endsect]
 
 
+[section:stencil cgi__common::stencil::stencil]
+
+[indexterm2 stencil..cgi__common::stencil]
+
+ ``[link cgi.reference.cgi__common__stencil.stencil.overload1 stencil]``(
+ impl_type * parent_dict);
 
-[section:stdin_data_read_ acgi::request_impl::stdin_data_read_]
+ ``[link cgi.reference.cgi__common__stencil.stencil.overload2 stencil]``(
+ string_type const & root_dir = "");
 
-[indexterm2 stdin_data_read_..acgi::request_impl]
 
- bool stdin_data_read_;
+[section:overload1 cgi__common::stencil::stencil (1 of 2 overloads)]
+
+
+
+ stencil(
+ impl_type * parent_dict);
 
 
 
@@ -956,38 +875,137 @@
 
 
 
-[section:stdin_parsed acgi::request_impl::stdin_parsed]
+[section:overload2 cgi__common::stencil::stencil (2 of 2 overloads)]
 
-[indexterm2 stdin_parsed..acgi::request_impl]
 
- bool stdin_parsed();
+
+ stencil(
+ string_type const & root_dir = "");
 
 
 
 [endsect]
 
 
+[endsect]
+
 
-[section:stdin_parsed_ acgi::request_impl::stdin_parsed_]
+[section:stencil_type cgi__common::stencil::stencil_type]
 
-[indexterm2 stdin_parsed_..acgi::request_impl]
+[indexterm2 stencil_type..cgi__common::stencil]
+
+ typedef ctemplate::Template stencil_type;
+
+
+
+
+[endsect]
+
+
+
+[section:strip cgi__common::stencil::strip]
+
+[indexterm2 strip..cgi__common::stencil]
+
+ enum strip
+
+[heading Values]
+[variablelist
+
+ [
+ [do_not_strip]
+ []
+ ]
+
+ [
+ [strip_blank_lines]
+ []
+ ]
+
+ [
+ [strip_whitespace]
+ []
+ ]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:tmpl cgi__common::stencil::tmpl]
+
+[indexterm2 tmpl..cgi__common::stencil]
+
+ stencil_type * tmpl;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:is_error_code_enum_lt____BOOST_CGI_NAMESPACE__common__error__cgi_errors__gt_ boost::system::is_error_code_enum< ::BOOST_CGI_NAMESPACE::common::error::cgi_errors >]
+
+
+
+ template<>
+ struct boost::system::is_error_code_enum< ::BOOST_CGI_NAMESPACE::common::error::cgi_errors >
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link cgi.reference.is_error_code_enum_lt____BOOST_CGI_NAMESPACE__common__error__cgi_errors__gt_.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
+ []
+ ]
+
+]
+
+
+[section:BOOST_STATIC_CONSTANT boost::system::is_error_code_enum< ::BOOST_CGI_NAMESPACE::common::error::cgi_errors >::BOOST_STATIC_CONSTANT]
+
+[indexterm2 BOOST_STATIC_CONSTANT..boost::system::is_error_code_enum< ::BOOST_CGI_NAMESPACE::common::error::cgi_errors >]
+
+ BOOST_STATIC_CONSTANT(
+ bool ,
+ value = true);
 
- bool stdin_parsed_;
+
+
+[endsect]
 
 
 
 [endsect]
 
 
+[section: cgi__service]
+
+
+
+ typedef cgi_service service;
+
+
+
 
 [endsect]
 
-[section:acgi__request_service acgi::request_service]
 
+[section:common__basic_client common::basic_client]
 
+A client.
 
- class request_service :
- public cgi_service_impl_base< acgi::request_impl >
+ template<
+ typename Connection ,
+ typename Protocol >
+ class basic_client
 
 
 [heading Types]
@@ -996,42 +1014,56 @@
 
   [
 
- [[link cgi.reference.acgi__request_service.base_type [*base_type]]]
+ [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_client.header_buffer_type [*header_buffer_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_client.io_service_type [*io_service_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.protocol_service_type [*protocol_service_type]]]
+ [[link cgi.reference.common__basic_client.map_type [*map_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_client.mutable_buffers_type [*mutable_buffers_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.self_type [*self_type]]]
+ [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.type [*type]]]
+ [[link cgi.reference.common__basic_client.role_type [*role_type]]]
     []
   
   ]
@@ -1043,190 +1075,184 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.acgi__request_service.clear [*clear]]]
- []
+ [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
+ [Asynchronously read some data from the client. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.client [*client]]]
- [Return the connection associated with the request. ]
+ [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
+ [Asynchronously write some data to the client. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.close [*close]]]
+ [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.construct [*construct]]]
+ [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.destroy [*destroy]]]
+ [[link cgi.reference.common__basic_client.close [*close]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.get_role [*get_role]]]
- []
+ [[link cgi.reference.common__basic_client.connection [*connection]]]
+ [Get a shared_ptr of the connection associated with the client. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
+ [[link cgi.reference.common__basic_client.construct [*construct]]]
+ [Construct the client by claiming a request id. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.is_open [*is_open]]]
- [Return if the request is still open. ]
+ [[link cgi.reference.common__basic_client.handle_write [*handle_write]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
+ [[link cgi.reference.common__basic_client.is_open [*is_open]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
+ [[link cgi.reference.common__basic_client.keep_connection [*keep_connection]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
+ [[link cgi.reference.common__basic_client.prepare_buffer [*prepare_buffer]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_client.read_some [*read_some]]]
+ [Read data into the supplied buffer. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
+ [[link cgi.reference.common__basic_client.request_id [*request_id]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
+ [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
+ [Associate a connection with this client. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.request_service [*request_service]]]
- []
+ [[link cgi.reference.common__basic_client.status [*status]]]
+ [Get the status of the client. ]
   ]
   
   [
- [[link cgi.reference.acgi__request_service.set_service [*set_service]]]
- []
+ [[link cgi.reference.common__basic_client.write_some [*write_some]]]
+ [Write some data to the client. ]
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.acgi__request_service.set_status [*set_status]]]
- [Set the request status. ]
+ [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
+ []
   ]
-
+
+ [
+ [[link cgi.reference.common__basic_client.header_ [*header_]]]
+ [Buffer used to check the header of each packet. ]
+ ]
+
   [
- [[link cgi.reference.acgi__request_service.shutdown_service [*shutdown_service]]]
+ [[link cgi.reference.common__basic_client.keep_connection_ [*keep_connection_]]]
     []
   ]
-
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+ [
+ [[link cgi.reference.common__basic_client.outbuf_ [*outbuf_]]]
+ [Output buffer. ]
+ ]
 
   [
- [[link cgi.reference.acgi__request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.common__basic_client.request_id_ [*request_id_]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
+ [[link cgi.reference.common__basic_client.role_ [*role_]]]
+ []
   ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+ [
+ [[link cgi.reference.common__basic_client.status_ [*status_]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_client.total_sent_bytes_ [*total_sent_bytes_]]]
+ []
+ ]
 
   [
- [[link cgi.reference.acgi__request_service.id [*id]]]
+ [[link cgi.reference.common__basic_client.total_sent_packets_ [*total_sent_packets_]]]
     []
   ]
 
 ]
 
+A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
 
-[section:base_type acgi::request_service::base_type]
 
+[section:async_read_some common::basic_client::async_read_some]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 async_read_some..common::basic_client] Asynchronously read some data from the client.
 
-[indexterm2 base_type..acgi::request_service]
+ template<
+ typename MutableBufferSequence ,
+ typename Handler >
+ void async_read_some(
+ const MutableBufferSequence & buf,
+ Handler handler);
 
- typedef common::request_base< self_type > base_type;
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.common__request_base__impl_base [*impl_base]]]
- []
-
- ]
+[section:async_write_some common::basic_client::async_write_some]
 
-]
+[indexterm2 async_write_some..common::basic_client] Asynchronously write some data to the client.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ template<
+ typename ConstBufferSequence ,
+ typename Handler >
+ void ``[link cgi.reference.common__basic_client.async_write_some.overload1 async_write_some]``(
+ const ConstBufferSequence & buf,
+ Handler handler);
 
- [
- [[link cgi.reference.common__request_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
-]
+ template<>
+ void ``[link cgi.reference.common__basic_client.async_write_some.overload2 async_write_some]``(
+ const ConstBufferSequence & buf,
+ Handler handler);
 
-This class provides generic member functions that can be used by any request type.
+
+[section:overload1 common::basic_client::async_write_some (1 of 2 overloads)]
+
+Asynchronously write some data to the client.
+
+ template<
+ typename ConstBufferSequence ,
+ typename Handler >
+ void async_write_some(
+ const ConstBufferSequence & buf,
+ Handler handler);
 
 
 
@@ -1234,31 +1260,44 @@
 
 
 
-[section:clear acgi::request_service::clear]
+[section:overload2 common::basic_client::async_write_some (2 of 2 overloads)]
 
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 clear..acgi::request_service]
+ template<>
+ void async_write_some(
+ const ConstBufferSequence & buf,
+ Handler handler);
+
 
- void clear(
- implementation_type & impl);
 
+[endsect]
 
 
 [endsect]
 
+[section:basic_client common::basic_client::basic_client]
+
+[indexterm2 basic_client..common::basic_client]
+
+ ``[link cgi.reference.common__basic_client.basic_client.overload1 basic_client]``();
+
+ ``[link cgi.reference.common__basic_client.basic_client.overload2 basic_client]``(
+ io_service & ios);
+
+ template<>
+ ``[link cgi.reference.common__basic_client.basic_client.overload3 basic_client]``();
 
+ template<>
+ ``[link cgi.reference.common__basic_client.basic_client.overload4 basic_client]``(
+ io_service_type & ios);
 
-[section:client acgi::request_service::client]
 
+[section:overload1 common::basic_client::basic_client (1 of 4 overloads)]
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 client..acgi::request_service] Return the connection associated with the request.
 
- implementation_type::client_type & client(
- implementation_type & impl);
+ basic_client();
 
 
 
@@ -1266,18 +1305,12 @@
 
 
 
-[section:close acgi::request_service::close]
-
+[section:overload2 common::basic_client::basic_client (2 of 4 overloads)]
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 close..acgi::request_service]
 
- int close(
- implementation_type & impl,
- common::http::status_code & http_s,
- int status,
- boost::system::error_code & ec);
+ basic_client(
+ io_service & ios);
 
 
 
@@ -1285,12 +1318,12 @@
 
 
 
-[section:construct acgi::request_service::construct]
+[section:overload3 common::basic_client::basic_client (3 of 4 overloads)]
 
-[indexterm2 construct..acgi::request_service]
 
- void construct(
- implementation_type & impl);
+
+ template<>
+ basic_client();
 
 
 
@@ -1298,28 +1331,27 @@
 
 
 
-[section:destroy acgi::request_service::destroy]
+[section:overload4 common::basic_client::basic_client (4 of 4 overloads)]
 
-[indexterm2 destroy..acgi::request_service]
 
- void destroy(
- implementation_type & impl);
 
+ template<>
+ basic_client(
+ io_service_type & ios);
 
 
-[endsect]
 
+[endsect]
 
 
-[section:get_role acgi::request_service::get_role]
+[endsect]
 
 
-['Inherited from cgi_service_impl_base.]
+[section:bytes_left common::basic_client::bytes_left]
 
-[indexterm2 get_role..acgi::request_service]
+[indexterm2 bytes_left..common::basic_client]
 
- role_type get_role(
- implementation_type & impl);
+ std::size_t & bytes_left();
 
 
 
@@ -1327,136 +1359,146 @@
 
 
 
-[section:id acgi::request_service::id]
+[section:bytes_left_ common::basic_client::bytes_left_]
 
-[indexterm2 id..acgi::request_service]
+[indexterm2 bytes_left_..common::basic_client]
 
- static boost::asio::detail::service_id< request_service > id;
+ std::size_t bytes_left_;
 
 
 
 [endsect]
 
 
+[section:close common::basic_client::close]
 
-[section:is_file acgi::request_service::is_file]
+[indexterm2 close..common::basic_client]
 
+ boost::system::error_code ``[link cgi.reference.common__basic_client.close.overload1 close]``(
+ boost::uint64_t app_status,
+ boost::system::error_code & ec);
 
-['Inherited from common::request_base.]
+ void ``[link cgi.reference.common__basic_client.close.overload2 close]``(
+ boost::uint64_t app_status = 0);
 
-[indexterm2 is_file..acgi::request_service] Check if a given POST variable represents a file upload.
+ template<>
+ boost::system::error_code ``[link cgi.reference.common__basic_client.close.overload3 close]``(
+ boost::uint64_t app_status,
+ boost::system::error_code & ec);
 
- bool is_file(
- ImplType & impl,
- typename ImplType::string_type const & key);
 
+[section:overload1 common::basic_client::close (1 of 3 overloads)]
 
 
-[endsect]
 
+ boost::system::error_code close(
+ boost::uint64_t app_status,
+ boost::system::error_code & ec);
 
 
-[section:is_open acgi::request_service::is_open]
 
+[endsect]
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 is_open..acgi::request_service] Return if the request is still open.
 
- bool is_open(
- implementation_type & impl);
+[section:overload2 common::basic_client::close (2 of 3 overloads)]
+
 
 
-For CGI, this always returns true. However, in the case that a "Location: xxx" header is sent and the header is terminated, the request can be taken to be 'closed'.
+ void close(
+ boost::uint64_t app_status = 0);
+
 
 
 [endsect]
 
 
-[section:load acgi::request_service::load]
 
-[indexterm2 load..acgi::request_service] Synchronously read/parse the request meta-data.
+[section:overload3 common::basic_client::close (3 of 3 overloads)]
 
- boost::system::error_code ``[link cgi.reference.acgi__request_service.load.overload1 load]``(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
 
- boost::system::error_code & ``[link cgi.reference.acgi__request_service.load.overload2 load]``(
- implementation_type & impl,
- common::parse_options parse_opts,
+
+ template<>
+ boost::system::error_code close(
+ boost::uint64_t app_status,
       boost::system::error_code & ec);
 
 
-[section:overload1 acgi::request_service::load (1 of 2 overloads)]
+Closing a FastCGI means sending an END\_REQUEST header to the HTTP server and potentially closing the connection.
 
+Note that in general the HTTP server is responsible for the lifetime of the connection, but can hand that control over to the library (eg. if the server is set up to recycle connections after N requests).
 
-['Inherited from common::request_base.]
 
-Synchronously read/parse the request meta-data.
+[endsect]
 
- boost::system::error_code load(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
 
+[endsect]
 
 
-[endsect]
+[section:connection common::basic_client::connection]
+
+[indexterm2 connection..common::basic_client] Get a shared_ptr of the connection associated with the client.
 
+ connection_ptr & connection();
 
 
-[section:overload2 acgi::request_service::load (2 of 2 overloads)]
 
+[endsect]
 
-['Inherited from cgi_service_impl_base.]
 
-Synchronously read/parse the request data.
 
- boost::system::error_code & load(
- implementation_type & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
+[section:connection_ptr common::basic_client::connection_ptr]
 
+[indexterm2 connection_ptr..common::basic_client]
+
+ typedef connection_type::pointer connection_ptr;
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:load_environment acgi::request_service::load_environment]
 
+[section:connection_type common::basic_client::connection_type]
 
-['Inherited from common::request_base.]
+[indexterm2 connection_type..common::basic_client]
 
-[indexterm2 load_environment..acgi::request_service] Load the base_environment into the current environment.
+ typedef Connection connection_type;
 
- void load_environment(
- ImplType & impl,
- char ** base_environment,
- bool is_command_line);
 
 
-Parsed the base\_environment and add it to the current request's environment. This overwrites any environment variables with the existing key.
 
-If `is\_command\_line` is true, then the first argument is skipped as this is the name of the program and ignored. Using it actually causes a crash on Windows (MSVC 9) anyway: I'm not exactly sure why.
+[endsect]
 
 
-[endsect]
 
+[section:construct common::basic_client::construct]
+
+[indexterm2 construct..common::basic_client] Construct the client by claiming a request id.
 
+ template<
+ typename RequestImpl >
+ boost::system::error_code construct(
+ RequestImpl & req,
+ boost::system::error_code & ec);
+
+
+Before loading a request, it will usually not have a request id. This function reads headers (and corresponding bodies if necessary) until a BEGIN\_REQUEST record is found. The calling request then claims and serves that request.
 
-[section:map_type acgi::request_service::map_type]
+
+[endsect]
 
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 map_type..acgi::request_service]
+[section:handle_write common::basic_client::handle_write]
 
- typedef ::cgi::common::map map_type;
+[indexterm2 handle_write..common::basic_client]
 
+ template<>
+ void handle_write(
+ std::size_t bytes_transferred,
+ boost::system::error_code & ec);
 
 
 
@@ -1464,16 +1506,24 @@
 
 
 
-[section:parse_cookie_vars acgi::request_service::parse_cookie_vars]
+[section:header_ common::basic_client::header_]
 
+[indexterm2 header_..common::basic_client] Buffer used to check the header of each packet.
 
-['Inherited from common::request_base.]
+ fcgi::spec::header header_;
 
-[indexterm2 parse_cookie_vars..acgi::request_service] Read and parse the HTTP_COOKIE meta variable.
 
- boost::system::error_code parse_cookie_vars(
- ImplType & impl,
- boost::system::error_code & ec);
+
+[endsect]
+
+
+
+[section:header_buffer_type common::basic_client::header_buffer_type]
+
+[indexterm2 header_buffer_type..common::basic_client]
+
+ typedef boost::array< unsigned char, 8 > header_buffer_type;
+
 
 
 
@@ -1481,16 +1531,24 @@
 
 
 
-[section:parse_get_vars acgi::request_service::parse_get_vars]
+[section:io_service_type common::basic_client::io_service_type]
 
+[indexterm2 io_service_type..common::basic_client]
 
-['Inherited from common::request_base.]
+ typedef ::BOOST_CGI_NAMESPACE::common::io_service io_service_type;
+
+
+
+
+[endsect]
 
-[indexterm2 parse_get_vars..acgi::request_service] Read and parse the cgi GET meta variables.
 
- boost::system::error_code parse_get_vars(
- ImplType & impl,
- boost::system::error_code & ec);
+
+[section:is_open common::basic_client::is_open]
+
+[indexterm2 is_open..common::basic_client]
+
+ bool is_open();
 
 
 
@@ -1498,16 +1556,23 @@
 
 
 
-[section:parse_post_vars acgi::request_service::parse_post_vars]
+[section:keep_connection common::basic_client::keep_connection]
 
+[indexterm2 keep_connection..common::basic_client]
 
-['Inherited from cgi_service_impl_base.]
+ bool keep_connection() const;
 
-[indexterm2 parse_post_vars..acgi::request_service] Read and parse the cgi POST meta variables (greedily).
 
- boost::system::error_code parse_post_vars(
- RequestImpl & impl,
- boost::system::error_code & ec);
+
+[endsect]
+
+
+
+[section:keep_connection_ common::basic_client::keep_connection_]
+
+[indexterm2 keep_connection_..common::basic_client]
+
+ bool keep_connection_;
 
 
 
@@ -1515,120 +1580,51 @@
 
 
 
-[section:protocol_service_type acgi::request_service::protocol_service_type]
+[section:map_type common::basic_client::map_type]
 
-[indexterm2 protocol_service_type..acgi::request_service]
+[indexterm2 map_type..common::basic_client]
 
- typedef acgi::service protocol_service_type;
+ typedef ::BOOST_CGI_NAMESPACE::common::map map_type;
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
- []
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
- []
-
- ]
 
- [
+[section:mutable_buffers_type common::basic_client::mutable_buffers_type]
 
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
- []
-
- ]
+[indexterm2 mutable_buffers_type..common::basic_client]
 
- [
+ typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
 
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
- []
-
- ]
+[section:outbuf_ common::basic_client::outbuf_]
 
-]
+[indexterm2 outbuf_..common::basic_client] Output buffer.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ std::vector< boost::asio::const_buffer > outbuf_;
 
- [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
- []
- ]
-
-]
 
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
+
+[endsect]
+
+
+
+[section:prepare_buffer common::basic_client::prepare_buffer]
+
+[indexterm2 prepare_buffer..common::basic_client]
+
+ template<>
+ void prepare_buffer(
+ const ConstBufferSequence & buf);
 
 
 
@@ -1636,11 +1632,11 @@
 
 
 
-[section:protocol_type acgi::request_service::protocol_type]
+[section:protocol_type common::basic_client::protocol_type]
 
-[indexterm2 protocol_type..acgi::request_service]
+[indexterm2 protocol_type..common::basic_client]
 
- typedef common::tags::acgi protocol_type;
+ typedef Protocol protocol_type;
 
 
 
@@ -1649,51 +1645,51 @@
 
 
 
-[section:read_env_vars acgi::request_service::read_env_vars]
+[section:read_some common::basic_client::read_some]
 
+[indexterm2 read_some..common::basic_client] Read data into the supplied buffer.
 
-['Inherited from cgi_service_impl_base.]
+ template<
+ typename MutableBufferSequence >
+ std::size_t read_some(
+ const MutableBufferSequence & buf,
+ boost::system::error_code & ec);
 
-[indexterm2 read_env_vars..acgi::request_service] Read the environment variables into an internal map.
 
- boost::system::error_code read_env_vars(
- RequestImpl & impl,
- boost::system::error_code & ec);
+Reads some data that, correctly checking and stripping FastCGI headers.
+
+Returns the number of bytes read and sets `ec` such that `ec` evaluates to `true` iff an error occured during the read operation.
+
+Notable errors:
+* `fcgierror::data_for_another_request`
+
+* `fcgierror::connection_locked`
 
 
+These must be dealt with by user code if they choose to read through the client (reading through the request is recommended).
+
 
 [endsect]
 
 
-[section:read_some acgi::request_service::read_some]
 
-[indexterm2 read_some..acgi::request_service] Read some data from the client into the supplied buffer.
+[section:request_id common::basic_client::request_id]
 
- std::size_t ``[link cgi.reference.acgi__request_service.read_some.overload1 read_some]``(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
+[indexterm2 request_id..common::basic_client]
 
- std::size_t ``[link cgi.reference.acgi__request_service.read_some.overload2 read_some]``(
- ImplType & impl,
- boost::system::error_code & ec);
+ boost::uint16_t const & request_id() const;
 
- std::size_t ``[link cgi.reference.acgi__request_service.read_some.overload3 read_some]``(
- implementation_type & impl,
- boost::system::error_code & ec);
 
 
-[section:overload1 acgi::request_service::read_some (1 of 3 overloads)]
+[endsect]
 
 
-['Inherited from common::request_base.]
 
-Read some data from the client into the supplied buffer.
+[section:request_id_ common::basic_client::request_id_]
 
- std::size_t read_some(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
+[indexterm2 request_id_..common::basic_client]
+
+ boost::uint16_t request_id_;
 
 
 
@@ -1701,92 +1697,169 @@
 
 
 
-[section:overload2 acgi::request_service::read_some (2 of 3 overloads)]
+[section:role_ common::basic_client::role_]
 
+[indexterm2 role_..common::basic_client]
 
-['Inherited from common::request_base.]
+ role_type role_;
 
-Read some data into the internal buffer.
 
- std::size_t read_some(
- ImplType & impl,
- boost::system::error_code & ec);
+
+[endsect]
+
+
+
+[section:role_type common::basic_client::role_type]
+
+[indexterm2 role_type..common::basic_client]
+
+ typedef detail::protocol_traits< Protocol >::role_type role_type;
+
 
 
 
 [endsect]
 
 
+[section:set_connection common::basic_client::set_connection]
 
-[section:overload3 acgi::request_service::read_some (3 of 3 overloads)]
+[indexterm2 set_connection..common::basic_client] Associate a connection with this client.
 
+ bool ``[link cgi.reference.common__basic_client.set_connection.overload1 set_connection]``(
+ connection_type * conn);
 
-['Inherited from cgi_service_impl_base.]
+ bool ``[link cgi.reference.common__basic_client.set_connection.overload2 set_connection]``(
+ const typename connection_type::pointer & conn);
 
 
+[section:overload1 common::basic_client::set_connection (1 of 2 overloads)]
 
- std::size_t read_some(
- implementation_type & impl,
- boost::system::error_code & ec);
+Associate a connection with this client.
+
+ bool set_connection(
+ connection_type * conn);
+
+
+Note: the connection must have been created using the new operator
+
+
+[endsect]
+
+
+
+[section:overload2 common::basic_client::set_connection (2 of 2 overloads)]
+
+Associate a connection with this client.
+
+ bool set_connection(
+ const typename connection_type::pointer & conn);
 
 
+Note: the connection must have been created using the new operator
+
 
 [endsect]
 
 
 [endsect]
 
-[section:request_id acgi::request_service::request_id]
+[section:status common::basic_client::status]
 
-[indexterm2 request_id..acgi::request_service] Get the request ID of a FastCGI request, or 1.
+[indexterm2 status..common::basic_client] Get the status of the client.
 
- boost::uint16_t const & ``[link cgi.reference.acgi__request_service.request_id.overload1 request_id]``(
- ImplType & impl) const;
+ const client_status & ``[link cgi.reference.common__basic_client.status.overload1 status]``() const;
+
+ void ``[link cgi.reference.common__basic_client.status.overload2 status]``(
+ client_status status);
 
- int ``[link cgi.reference.acgi__request_service.request_id.overload2 request_id]``(
- implementation_type & impl);
 
+[section:overload1 common::basic_client::status (1 of 2 overloads)]
 
-[section:overload1 acgi::request_service::request_id (1 of 2 overloads)]
+Get the status of the client.
 
+ const client_status & status() const;
 
-['Inherited from common::request_base.]
 
-Get the request ID of a FastCGI request, or 1.
 
- boost::uint16_t const & request_id(
- ImplType & impl) const;
+[endsect]
+
+
+
+[section:overload2 common::basic_client::status (2 of 2 overloads)]
+
+Set the status of the client.
+
+ void status(
+ client_status status);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 acgi::request_service::request_id (2 of 2 overloads)]
 
+[section:status_ common::basic_client::status_]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 status_..common::basic_client]
 
+ client_status status_;
 
 
- int request_id(
- implementation_type & impl);
+
+[endsect]
+
+
+
+[section:total_sent_bytes_ common::basic_client::total_sent_bytes_]
+
+[indexterm2 total_sent_bytes_..common::basic_client]
+
+ boost::uint64_t total_sent_bytes_;
 
 
 
 [endsect]
 
 
+
+[section:total_sent_packets_ common::basic_client::total_sent_packets_]
+
+[indexterm2 total_sent_packets_..common::basic_client]
+
+ boost::uint64_t total_sent_packets_;
+
+
+
 [endsect]
 
 
-[section:request_service acgi::request_service::request_service]
+[section:write_some common::basic_client::write_some]
+
+[indexterm2 write_some..common::basic_client] Write some data to the client.
 
-[indexterm2 request_service..acgi::request_service]
+ template<
+ typename ConstBufferSequence >
+ std::size_t ``[link cgi.reference.common__basic_client.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buf,
+ boost::system::error_code & ec);
 
- request_service(
- common::io_service & ios);
+ template<>
+ std::size_t ``[link cgi.reference.common__basic_client.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buf,
+ boost::system::error_code & ec);
+
+
+[section:overload1 common::basic_client::write_some (1 of 2 overloads)]
+
+Write some data to the client.
+
+ template<
+ typename ConstBufferSequence >
+ std::size_t write_some(
+ const ConstBufferSequence & buf,
+ boost::system::error_code & ec);
 
 
 
@@ -1794,58 +1867,55 @@
 
 
 
-[section:self_type acgi::request_service::self_type]
+[section:overload2 common::basic_client::write_some (2 of 2 overloads)]
 
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 self_type..acgi::request_service]
+ template<>
+ std::size_t write_some(
+ const ConstBufferSequence & buf,
+ boost::system::error_code & ec);
 
- typedef cgi_service_impl_base< acgi::request_impl > self_type;
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.base_type [*base_type]]]
- []
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base__callback_functor [*callback_functor]]]
- []
-
- ]
+[endsect]
 
- [
+[section:common__basic_cookie common::basic_cookie]
+
+A `basic_cookie<>` object that can be (out-) streamed.
+
+ template<
+ typename CharT >
+ struct basic_cookie
 
- [[link cgi.reference.cgi_service_impl_base__implementation_type [*implementation_type]]]
- []
-
- ]
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_cookie.char_type [*char_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_cookie.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.self_type [*self_type]]]
+ [[link cgi.reference.common__basic_cookie.string_type [*string_type]]]
     []
   
   ]
@@ -1857,166 +1927,230 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.cgi_service_impl_base.cgi_service_impl_base [*cgi_service_impl_base]]]
+ [[link cgi.reference.common__basic_cookie.basic_cookie [*basic_cookie]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.clear [*clear]]]
+ [[link cgi.reference.common__basic_cookie.c_str [*c_str]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.client [*client]]]
- [Return the connection associated with the request. ]
+ [[link cgi.reference.common__basic_cookie.empty [*empty]]]
+ []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.close [*close]]]
+ [[link cgi.reference.common__basic_cookie.operator_const_char_type_* [*operator const char_type *]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.get_role [*get_role]]]
+ [[link cgi.reference.common__basic_cookie.operator_std__basic_string_lt__T__gt_ [*operator std::basic_string< T >]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
+ [[link cgi.reference.common__basic_cookie.operator_string_type [*operator string_type]]]
+ []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.is_open [*is_open]]]
- [Return if the request is still open. ]
+ [[link cgi.reference.common__basic_cookie.operator_string_type_const_& [*operator string_type const &]]]
+ []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
+ [[link cgi.reference.common__basic_cookie.to_string [*to_string]]]
+ [TODO: Create a cookie from a const char*. ]
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.cgi_service_impl_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
+ [[link cgi.reference.common__basic_cookie.domain [*domain]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.cgi_service_impl_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
+ [[link cgi.reference.common__basic_cookie.expires [*expires]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.cgi_service_impl_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_cookie.http_only [*http_only]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.cgi_service_impl_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
+ [[link cgi.reference.common__basic_cookie.name [*name]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.cgi_service_impl_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
+ [[link cgi.reference.common__basic_cookie.path [*path]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.cgi_service_impl_base.set_status [*set_status]]]
- [Set the request status. ]
+ [[link cgi.reference.common__basic_cookie.secure [*secure]]]
+ [`true` iff the cookie is only used for secure connections. ]
   ]
-
+
+ [
+ [[link cgi.reference.common__basic_cookie.value [*value]]]
+ []
+ ]
+
 ]
 
-[heading Protected Member Functions]
+[heading Friends]
 [table
   [[Name][Description]]
 
   [
- [[link cgi.reference.cgi_service_impl_base.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
+ [[link cgi.reference.common__basic_cookie.operator_lt__lt_ [*operator<<]]]
+ []
   ]
   
 ]
 
+Either set the parameters in the constructor, or set them directly. Note: If you want to set the parameters individually, remember that each parameter must NOT have a trailing semi-colon!
+
+TODO
+* Data should be URL-encoded, or maybe provide an overload for url_decode that takes an HttpCookie?
+
+* Add from_string() ?
+
+
+[section:basic_cookie common::basic_cookie::basic_cookie]
+
+[indexterm2 basic_cookie..common::basic_cookie]
+
+ ``[link cgi.reference.common__basic_cookie.basic_cookie.overload1 basic_cookie]``();
+
+ ``[link cgi.reference.common__basic_cookie.basic_cookie.overload2 basic_cookie]``(
+ const char * _name);
+
+ ``[link cgi.reference.common__basic_cookie.basic_cookie.overload3 basic_cookie]``(
+ const string_type & _name);
+
+ ``[link cgi.reference.common__basic_cookie.basic_cookie.overload4 basic_cookie]``(
+ const string_type & _name,
+ const string_type & _val,
+ const string_type & _expires = "",
+ const string_type & _path = "/",
+ const string_type & _domain = "",
+ bool _secure = false,
+ bool HttpOnly = false);
+
+
+[section:overload1 common::basic_cookie::basic_cookie (1 of 4 overloads)]
+
+
+
+ basic_cookie();
+
 
 
 [endsect]
 
 
 
-[section:set_service acgi::request_service::set_service]
+[section:overload2 common::basic_cookie::basic_cookie (2 of 4 overloads)]
 
-[indexterm2 set_service..acgi::request_service]
 
- void set_service(
- implementation_type & impl,
- protocol_service_type & ps);
+
+ basic_cookie(
+ const char * _name);
 
 
 
 [endsect]
 
 
-[section:set_status acgi::request_service::set_status]
 
-[indexterm2 set_status..acgi::request_service] Set the request status.
+[section:overload3 common::basic_cookie::basic_cookie (3 of 4 overloads)]
 
- void ``[link cgi.reference.acgi__request_service.set_status.overload1 set_status]``(
- implementation_type & impl,
- common::request_status status);
+Create a cookie for deleting the cookie named `_name`.
+
+ basic_cookie(
+ const string_type & _name);
 
- void ``[link cgi.reference.acgi__request_service.set_status.overload2 set_status]``(
- implementation_type & impl,
- common::http::status_code & );
 
 
-[section:overload1 acgi::request_service::set_status (1 of 2 overloads)]
+[endsect]
 
 
-['Inherited from cgi_service_impl_base.]
 
-Set the request status.
+[section:overload4 common::basic_cookie::basic_cookie (4 of 4 overloads)]
 
- void set_status(
- implementation_type & impl,
- common::request_status status);
+Create a cookie.
+
+ basic_cookie(
+ const string_type & _name,
+ const string_type & _val,
+ const string_type & _expires = "",
+ const string_type & _path = "/",
+ const string_type & _domain = "",
+ bool _secure = false,
+ bool HttpOnly = false);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 acgi::request_service::set_status (2 of 2 overloads)]
 
+[section:c_str common::basic_cookie::c_str]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 c_str..common::basic_cookie]
 
-Set the http status (this does nothing for aCGI).
+ const char_type * c_str() const;
+
+
+
+[endsect]
+
+
+
+[section:char_type common::basic_cookie::char_type]
+
+[indexterm2 char_type..common::basic_cookie]
+
+ typedef CharT char_type;
 
- void set_status(
- implementation_type & impl,
- common::http::status_code & );
 
 
 
 [endsect]
 
 
+
+[section:domain common::basic_cookie::domain]
+
+[indexterm2 domain..common::basic_cookie]
+
+ string_type domain;
+
+
+
 [endsect]
 
 
-[section:shutdown_service acgi::request_service::shutdown_service]
 
-[indexterm2 shutdown_service..acgi::request_service]
+[section:empty common::basic_cookie::empty]
 
- void shutdown_service();
+[indexterm2 empty..common::basic_cookie]
+
+ bool empty() const;
 
 
 
@@ -2024,55 +2158,160 @@
 
 
 
-[section:type acgi::request_service::type]
+[section:expires common::basic_cookie::expires]
 
-[indexterm2 type..acgi::request_service]
+[indexterm2 expires..common::basic_cookie]
 
- typedef request_service type;
+ string_type expires;
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link cgi.reference.acgi__request_service.base_type [*base_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.acgi__request_service.map_type [*map_type]]]
- []
-
- ]
+[section:http_only common::basic_cookie::http_only]
 
- [
+[indexterm2 http_only..common::basic_cookie]
 
- [[link cgi.reference.acgi__request_service.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
+ bool http_only;
+
+
+
+[endsect]
+
+
+
+[section:name common::basic_cookie::name]
+
+[indexterm2 name..common::basic_cookie]
+
+ string_type name;
+
+
+
+[endsect]
+
+
+
+[section:operator_const_char_type_* common::basic_cookie::operator const char_type *]
+
+[indexterm2 operator const char_type *..common::basic_cookie]
+
+ operator const char_type *() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_std__basic_string_lt__T__gt_ common::basic_cookie::operator std::basic_string< T >]
+
+[indexterm2 operator std::basic_string< T >..common::basic_cookie]
+
+ template<
+ typename T >
+ operator std::basic_string< T >();
+
+
+
+[endsect]
+
+
+
+[section:operator_string_type common::basic_cookie::operator string_type]
+
+[indexterm2 operator string_type..common::basic_cookie]
+
+ operator string_type() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_string_type_const_& common::basic_cookie::operator string_type const &]
+
+[indexterm2 operator string_type const &..common::basic_cookie]
+
+ operator string_type const &() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ common::basic_cookie::operator<<]
+
+[indexterm2 operator<<..common::basic_cookie]
+
+ template<
+ typename T >
+ friend std::ostream & operator<<(
+ std::ostream & os,
+ basic_cookie< T > const & ck);
+
+
+
+[endsect]
+
+
+
+[section:path common::basic_cookie::path]
+
+[indexterm2 path..common::basic_cookie]
+
+ string_type path;
+
+
+
+[endsect]
+
+
+
+[section:secure common::basic_cookie::secure]
+
+[indexterm2 secure..common::basic_cookie] `true` iff the cookie is only used for secure connections.
+
+ bool secure;
+
+
+
+[endsect]
+
+
+
+[section:self_type common::basic_cookie::self_type]
+
+[indexterm2 self_type..common::basic_cookie]
+
+ typedef basic_cookie< CharT > self_type;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link cgi.reference.acgi__request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_cookie.char_type [*char_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.self_type [*self_type]]]
+ [[link cgi.reference.common__basic_cookie.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.acgi__request_service.type [*type]]]
+ [[link cgi.reference.common__basic_cookie.string_type [*string_type]]]
     []
   
   ]
@@ -2084,109 +2323,195 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.acgi__request_service.clear [*clear]]]
+ [[link cgi.reference.common__basic_cookie.basic_cookie [*basic_cookie]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.client [*client]]]
- [Return the connection associated with the request. ]
+ [[link cgi.reference.common__basic_cookie.c_str [*c_str]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.close [*close]]]
+ [[link cgi.reference.common__basic_cookie.empty [*empty]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.construct [*construct]]]
+ [[link cgi.reference.common__basic_cookie.operator_const_char_type_* [*operator const char_type *]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.destroy [*destroy]]]
+ [[link cgi.reference.common__basic_cookie.operator_std__basic_string_lt__T__gt_ [*operator std::basic_string< T >]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.get_role [*get_role]]]
+ [[link cgi.reference.common__basic_cookie.operator_string_type [*operator string_type]]]
     []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
+ [[link cgi.reference.common__basic_cookie.operator_string_type_const_& [*operator string_type const &]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.is_open [*is_open]]]
- [Return if the request is still open. ]
+ [[link cgi.reference.common__basic_cookie.to_string [*to_string]]]
+ [TODO: Create a cookie from a const char*. ]
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.acgi__request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
+ [[link cgi.reference.common__basic_cookie.domain [*domain]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
+ [[link cgi.reference.common__basic_cookie.expires [*expires]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
+ [[link cgi.reference.common__basic_cookie.http_only [*http_only]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_cookie.name [*name]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
+ [[link cgi.reference.common__basic_cookie.path [*path]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
+ [[link cgi.reference.common__basic_cookie.secure [*secure]]]
+ [`true` iff the cookie is only used for secure connections. ]
   ]
-
+
   [
- [[link cgi.reference.acgi__request_service.request_service [*request_service]]]
+ [[link cgi.reference.common__basic_cookie.value [*value]]]
     []
   ]
-
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.acgi__request_service.set_service [*set_service]]]
+ [[link cgi.reference.common__basic_cookie.operator_lt__lt_ [*operator<<]]]
     []
   ]
   
+]
+
+Either set the parameters in the constructor, or set them directly. Note: If you want to set the parameters individually, remember that each parameter must NOT have a trailing semi-colon!
+
+TODO
+* Data should be URL-encoded, or maybe provide an overload for url_decode that takes an HttpCookie?
+
+* Add from_string() ?
+
+
+
+
+[endsect]
+
+
+
+[section:string_type common::basic_cookie::string_type]
+
+[indexterm2 string_type..common::basic_cookie]
+
+ typedef std::basic_string< CharT > string_type;
+
+
+
+
+[endsect]
+
+
+
+[section:to_string common::basic_cookie::to_string]
+
+[indexterm2 to_string..common::basic_cookie] TODO: Create a cookie from a const char*.
+
+ string_type to_string() const;
+
+
+Rules at: http://wp.netscape.com/newsref/std/cookie\_spec.html Make a string out of the cookie.
+
+
+[endsect]
+
+
+
+[section:value common::basic_cookie::value]
+
+[indexterm2 value..common::basic_cookie]
+
+ string_type value;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:common__basic_header common::basic_header]
+
+
+
+ template<
+ typename ``[link cgi.reference.CharT CharT]``>
+ struct basic_header
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.acgi__request_service.set_status [*set_status]]]
- [Set the request status. ]
- ]
+
+ [[link cgi.reference.common__basic_header.char_type [*char_type]]]
+ []
   
+ ]
+
   [
- [[link cgi.reference.acgi__request_service.shutdown_service [*shutdown_service]]]
+
+ [[link cgi.reference.common__basic_header.string_type [*string_type]]]
     []
- ]
   
+ ]
+
 ]
 
-[heading Protected Member Functions]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link cgi.reference.acgi__request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.common__basic_header.basic_header [*basic_header]]]
+ []
   ]
   
   [
- [[link cgi.reference.acgi__request_service.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
+ [[link cgi.reference.common__basic_header.operator_string_type [*operator string_type]]]
+ []
   ]
   
 ]
@@ -2196,26 +2521,127 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.acgi__request_service.id [*id]]]
+ [[link cgi.reference.common__basic_header.content [*content]]]
     []
   ]
 
 ]
 
+[section:basic_header common::basic_header::basic_header]
+
+[indexterm2 basic_header..common::basic_header]
+
+ ``[link cgi.reference.common__basic_header.basic_header.overload1 basic_header]``();
+
+ ``[link cgi.reference.common__basic_header.basic_header.overload2 basic_header]``(
+ const string_type & _content);
+
+ ``[link cgi.reference.common__basic_header.basic_header.overload3 basic_header]``(
+ const string_type & name,
+ const string_type & val);
+
+
+[section:overload1 common::basic_header::basic_header (1 of 3 overloads)]
+
+
+
+ basic_header();
+
+
+
+[endsect]
+
+
+
+[section:overload2 common::basic_header::basic_header (2 of 3 overloads)]
+
+
+
+ basic_header(
+ const string_type & _content);
+
+
+
+[endsect]
+
+
+
+[section:overload3 common::basic_header::basic_header (3 of 3 overloads)]
+
+
+
+ basic_header(
+ const string_type & name,
+ const string_type & val);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:char_type common::basic_header::char_type]
+
+[indexterm2 char_type..common::basic_header]
+
+ typedef CharT char_type;
+
+
+
+
+[endsect]
+
+
+
+[section:content common::basic_header::content]
+
+[indexterm2 content..common::basic_header]
+
+ string_type content;
+
+
+
+[endsect]
+
+
+
+[section:operator_string_type common::basic_header::operator string_type]
+
+[indexterm2 operator string_type..common::basic_header]
+
+ operator string_type();
+
 
 
 [endsect]
 
 
 
+[section:string_type common::basic_header::string_type]
+
+[indexterm2 string_type..common::basic_header]
+
+ typedef std::basic_string< CharT > string_type;
+
+
+
+
 [endsect]
 
 
-[section:acgi__service acgi::service]
 
-[indexterm1 acgi::service]
+[endsect]
+
+[section:common__basic_protocol_service common::basic_protocol_service]
+
+Basic Protocol Service.
 
- typedef common::basic_protocol_service< common::tags::acgi > service;
+ template<
+ typename ``[link cgi.reference.Protocol Protocol]``,
+ typename ``[link cgi.reference.IoServiceProvider IoServiceProvider]``>
+ class basic_protocol_service
 
 
 [heading Types]
@@ -2326,296 +2752,79 @@
 
 Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
 
+[section:basic_protocol_service common::basic_protocol_service::basic_protocol_service]
 
+[indexterm2 basic_protocol_service..common::basic_protocol_service]
 
-[endsect]
+ ``[link cgi.reference.common__basic_protocol_service.basic_protocol_service.overload1 basic_protocol_service]``(
+ int pool_size_hint = 1);
 
+ ``[link cgi.reference.common__basic_protocol_service.basic_protocol_service.overload2 basic_protocol_service]``(
+ boost::asio::io_service & ios);
 
-[section:cgi_request_impl cgi_request_impl]
 
-Implementation for a standard CGI request.
+[section:overload1 common::basic_protocol_service::basic_protocol_service (1 of 2 overloads)]
 
- class cgi_request_impl
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ basic_protocol_service(
+ int pool_size_hint = 1);
 
- [
 
- [[link cgi.reference.cgi_request_impl.client_type [*client_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.cgi_request_impl.conn_ptr [*conn_ptr]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.cgi_request_impl.connection_type [*connection_type]]]
- []
-
- ]
+[section:overload2 common::basic_protocol_service::basic_protocol_service (2 of 2 overloads)]
 
- [
 
- [[link cgi.reference.cgi_request_impl.map_type [*map_type]]]
- []
-
- ]
 
- [
+ basic_protocol_service(
+ boost::asio::io_service & ios);
 
- [[link cgi.reference.cgi_request_impl.protocol_type [*protocol_type]]]
- []
-
- ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.cgi_request_impl.cgi_request_impl [*cgi_request_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.connection [*connection]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.http_status [*http_status]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.status [*status]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.stdin_parsed [*stdin_parsed]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.cgi_request_impl.stdin_bytes_left_ [*stdin_bytes_left_]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.stdin_data_read_ [*stdin_data_read_]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.stdin_parsed_ [*stdin_parsed_]]]
- []
- ]
-
-]
-
-[heading Protected Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.cgi_request_impl.connection_ [*connection_]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.http_status_ [*http_status_]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_request_impl.request_status_ [*request_status_]]]
- []
- ]
-
-]
-
-Note: This isn't noncopyable since there's no real reason it can't be copied around. Since basic\_request is noncopyable, basic copying will be restricted but if someone really wants to copy the data, then they can.
-
-[section:cgi_request_impl cgi_request_impl::cgi_request_impl]
-
-[indexterm2 cgi_request_impl..cgi_request_impl]
-
- ``[link cgi.reference.cgi_request_impl.cgi_request_impl.overload1 cgi_request_impl]``();
-
- template<
- typename ProtocolService >
- ``[link cgi.reference.cgi_request_impl.cgi_request_impl.overload2 cgi_request_impl]``(
- ProtocolService & pserv);
-
-
-[section:overload1 cgi_request_impl::cgi_request_impl (1 of 2 overloads)]
-
-
-
- cgi_request_impl();
 
+[endsect]
 
 
 [endsect]
 
 
+[section:dispatch common::basic_protocol_service::dispatch]
 
-[section:overload2 cgi_request_impl::cgi_request_impl (2 of 2 overloads)]
-
-Constructor.
+[indexterm2 dispatch..common::basic_protocol_service] Dispatch a handler through an available io_service.
 
   template<
- typename ProtocolService >
- cgi_request_impl(
- ProtocolService & pserv);
-
-
-Since this request type is synchronous, there is no need for an io\_service, so the passed ProtocolService is just ignored.
-
+ typename Handler >
+ void dispatch(
+ Handler handler);
 
-[endsect]
 
 
 [endsect]
 
 
-[section:client_type cgi_request_impl::client_type]
-
-[indexterm2 client_type..cgi_request_impl]
-
- typedef common::basic_client< connections::stdio, common::tags::cgi > client_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
- [Asynchronously read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
- [Asynchronously write some data to the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.connection [*connection]]]
- [Get a shared_ptr of the connection associated with the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.read_some [*read_some]]]
- [Read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
- [Associate a connection with this client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.write_some [*write_some]]]
- [Write some data to the client. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[section:io_service common::basic_protocol_service::io_service]
 
- [
- [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
- []
- ]
+[indexterm2 io_service..common::basic_protocol_service] Return an available io_service from the IoServiceProvider.
 
-]
+ ::BOOST_CGI_NAMESPACE::common::io_service & io_service();
 
-A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
 
+The order in which the underlying io\_services are returned is determined by what policy the IoServiceProvider uses.
 
 
 [endsect]
 
 
 
-[section:conn_ptr cgi_request_impl::conn_ptr]
+[section:ios_provider_type common::basic_protocol_service::ios_provider_type]
 
-[indexterm2 conn_ptr..cgi_request_impl]
+[indexterm2 ios_provider_type..common::basic_protocol_service]
 
- typedef connection_type::pointer conn_ptr;
+ typedef IoServiceProvider ios_provider_type;
 
 
 
@@ -2624,11 +2833,11 @@
 
 
 
-[section:connection cgi_request_impl::connection]
+[section:is_cgi common::basic_protocol_service::is_cgi]
 
-[indexterm2 connection..cgi_request_impl]
+[indexterm2 is_cgi..common::basic_protocol_service]
 
- conn_ptr & connection();
+ bool is_cgi();
 
 
 
@@ -2636,11 +2845,14 @@
 
 
 
-[section:connection_ cgi_request_impl::connection_]
+[section:post common::basic_protocol_service::post]
 
-[indexterm2 connection_..cgi_request_impl]
+[indexterm2 post..common::basic_protocol_service] Post the handler through an available io_service.
 
- conn_ptr connection_;
+ template<
+ typename Handler >
+ void post(
+ Handler handler);
 
 
 
@@ -2648,11 +2860,11 @@
 
 
 
-[section:connection_type cgi_request_impl::connection_type]
+[section:protocol_type common::basic_protocol_service::protocol_type]
 
-[indexterm2 connection_type..cgi_request_impl]
+[indexterm2 protocol_type..common::basic_protocol_service]
 
- typedef connections::stdio connection_type;
+ typedef Protocol protocol_type;
 
 
 
@@ -2661,23 +2873,12 @@
 
 
 
-[section:http_status cgi_request_impl::http_status]
-
-[indexterm2 http_status..cgi_request_impl]
-
- common::http::status_code & http_status();
-
-
-
-[endsect]
-
-
+[section:queue_type common::basic_protocol_service::queue_type]
 
-[section:http_status_ cgi_request_impl::http_status_]
+[indexterm2 queue_type..common::basic_protocol_service]
 
-[indexterm2 http_status_..cgi_request_impl]
+ typedef std::queue< request_ptr > queue_type;
 
- common::http::status_code http_status_;
 
 
 
@@ -2685,11 +2886,11 @@
 
 
 
-[section:map_type cgi_request_impl::map_type]
+[section:request_ptr common::basic_protocol_service::request_ptr]
 
-[indexterm2 map_type..cgi_request_impl]
+[indexterm2 request_ptr..common::basic_protocol_service]
 
- typedef ::cgi::common::map map_type;
+ typedef boost::shared_ptr< request_type > request_ptr;
 
 
 
@@ -2698,11 +2899,11 @@
 
 
 
-[section:protocol_type cgi_request_impl::protocol_type]
+[section:request_type common::basic_protocol_service::request_type]
 
-[indexterm2 protocol_type..cgi_request_impl]
+[indexterm2 request_type..common::basic_protocol_service]
 
- typedef common::tags::cgi protocol_type;
+ typedef traits::request_type request_type;
 
 
 
@@ -2711,35 +2912,40 @@
 
 
 
-[section:request_status_ cgi_request_impl::request_status_]
+[section:reset common::basic_protocol_service::reset]
 
-[indexterm2 request_status_..cgi_request_impl]
+[indexterm2 reset..common::basic_protocol_service] Reset all the io_services contained by this service.
 
- common::request_status request_status_;
+ void reset();
 
 
+This deletes the request queue(s), aborts all running requests and then calls reset() on each of the io\_services held by ios\_provider\_. There is no guarantee that requests will terminate immediately.
+
 
 [endsect]
 
 
 
-[section:status cgi_request_impl::status]
+[section:run common::basic_protocol_service::run]
+
+[indexterm2 run..common::basic_protocol_service] Run all the io_services contained by this service.
 
-[indexterm2 status..cgi_request_impl]
+ void run();
 
- common::request_status & status();
 
+This is equivalent to calling run() on each of the io\_services held by ios\_provider\_
 
 
 [endsect]
 
 
 
-[section:stdin_bytes_left_ cgi_request_impl::stdin_bytes_left_]
+[section:set_type common::basic_protocol_service::set_type]
+
+[indexterm2 set_type..common::basic_protocol_service]
 
-[indexterm2 stdin_bytes_left_..cgi_request_impl]
+ typedef std::set< request_ptr > set_type;
 
- std::size_t stdin_bytes_left_;
 
 
 
@@ -2747,23 +2953,26 @@
 
 
 
-[section:stdin_data_read_ cgi_request_impl::stdin_data_read_]
+[section:stop common::basic_protocol_service::stop]
+
+[indexterm2 stop..common::basic_protocol_service] Stop all the io_services contained by this service.
 
-[indexterm2 stdin_data_read_..cgi_request_impl]
+ void stop();
 
- bool stdin_data_read_;
 
+This is equivalent to calling stop() on each of the io\_services held by ios\_provider\_
 
 
 [endsect]
 
 
 
-[section:stdin_parsed cgi_request_impl::stdin_parsed]
+[section:traits common::basic_protocol_service::traits]
 
-[indexterm2 stdin_parsed..cgi_request_impl]
+[indexterm2 traits..common::basic_protocol_service]
+
+ typedef detail::protocol_traits< Protocol >::type traits;
 
- bool stdin_parsed();
 
 
 
@@ -2771,11 +2980,11 @@
 
 
 
-[section:stdin_parsed_ cgi_request_impl::stdin_parsed_]
+[section:_basic_protocol_service common::basic_protocol_service::~basic_protocol_service]
 
-[indexterm2 stdin_parsed_..cgi_request_impl]
+[indexterm2 ~basic_protocol_service..common::basic_protocol_service]
 
- bool stdin_parsed_;
+ ~basic_protocol_service();
 
 
 
@@ -2785,12 +2994,13 @@
 
 [endsect]
 
-[section:cgi_request_service cgi_request_service]
-
+[section:common__basic_request common::basic_request]
 
+The basic_request class, primary entry point to the library.
 
- class cgi_request_service :
- public cgi_service_impl_base< cgi_request_impl >
+ template<
+ typename ``[link cgi.reference.Protocol Protocol]``>
+ class basic_request
 
 
 [heading Types]
@@ -2799,228 +3009,352 @@
 
   [
 
- [[link cgi.reference.cgi_request_service.base_type [*base_type]]]
+ [[link cgi.reference.common__basic_request.buffer_type [*buffer_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_request_service.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_request.char_type [*char_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_request.client_type [*client_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_request_service.self_type [*self_type]]]
+ [[link cgi.reference.common__basic_request.implementation_type [*implementation_type]]]
     []
   
   ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.cgi_request_service.cgi_request_service [*cgi_request_service]]]
+
+ [[link cgi.reference.common__basic_request.pointer [*pointer]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.cgi_request_service.clear [*clear]]]
+
+ [[link cgi.reference.common__basic_request.protocol_service_type [*protocol_service_type]]]
     []
- ]
   
- [
- [[link cgi.reference.cgi_request_service.client [*client]]]
- [Return the connection associated with the request. ]
   ]
-
+
   [
- [[link cgi.reference.cgi_request_service.close [*close]]]
+
+ [[link cgi.reference.common__basic_request.protocol_type [*protocol_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.cgi_request_service.construct [*construct]]]
+
+ [[link cgi.reference.common__basic_request.self_type [*self_type]]]
     []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_request.service_type [*service_type]]]
+ []
+
   ]
+
+ [
+
+ [[link cgi.reference.common__basic_request.string_type [*string_type]]]
+ []
   
+ ]
+
   [
- [[link cgi.reference.cgi_request_service.destroy [*destroy]]]
+
+ [[link cgi.reference.common__basic_request.traits [*traits]]]
     []
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link cgi.reference.common__basic_request.abort [*abort]]]
+ [Abort a request. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.get_role [*get_role]]]
+ [[link cgi.reference.common__basic_request.auth_type [*auth_type]]]
+ [Set the output for the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.basic_request [*basic_request]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
+ [[link cgi.reference.common__basic_request.charset [*charset]]]
+ [Get the charset from the CONTENT_TYPE header. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.is_open [*is_open]]]
- [Return if the request is still open. ]
+ [[link cgi.reference.common__basic_request.clear [*clear]]]
+ [Clear the data for the request, for reusing this object. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.client [*client]]]
+ [Get the client connection associated with the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.close [*close]]]
+ [Asynchronously read/parse the request meta-data. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.content_length [*content_length]]]
+ [Get the content length as a long. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.content_type [*content_type]]]
+ [The content type of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.create [*create]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.gateway_interface [*gateway_interface]]]
+ [The protocol used by the server to communicate to the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.hash [*hash]]]
+ [Get a hashed interpretation of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.http_cookie [*http_cookie]]]
+ [The cookies sent by the user making the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.http_from [*http_from]]]
+ [The email of the user making the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.load [*load]]]
+ [[link cgi.reference.common__basic_request.id [*id]]]
+ [The id of this request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.is_open [*is_open]]]
+ [Check if the request is still open (ie. not aborted or closed). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.load [*load]]]
     [Synchronously read/parse the request meta-data. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
+ [[link cgi.reference.common__basic_request.method [*method]]]
+ [The method of the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
+ [[link cgi.reference.common__basic_request.path_info [*path_info]]]
+ [Additional information, appendended to the script. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_request.path_translated [*path_translated]]]
+ [The translated version of the path info. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
+ [[link cgi.reference.common__basic_request.post_buffer [*post_buffer]]]
+ [Get the buffer containing the POST data. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
+ [[link cgi.reference.common__basic_request.query_string [*query_string]]]
+ [The query string for the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.set_status [*set_status]]]
- [Set the request status. ]
+ [[link cgi.reference.common__basic_request.read_some [*read_some]]]
+ [Read some data into the request, parsing if necessary. ]
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.cgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.common__basic_request.referer [*referer]]]
+ [Get the web page the user came from. ]
   ]
   
   [
- [[link cgi.reference.cgi_request_service.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
+ [[link cgi.reference.common__basic_request.reject [*reject]]]
+ [Reject the request with a '500 Internal Server Error' error. ]
   ]
   
-]
-
-
-[section:base_type cgi_request_service::base_type]
-
-
-['Inherited from cgi_service_impl_base.]
-
-[indexterm2 base_type..cgi_request_service]
-
- typedef common::request_base< self_type > base_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
   [
-
- [[link cgi.reference.common__request_base__impl_base [*impl_base]]]
- []
+ [[link cgi.reference.common__basic_request.remote_addr [*remote_addr]]]
+ [The host address of the remote user. ]
+ ]
   
+ [
+ [[link cgi.reference.common__basic_request.remote_host [*remote_host]]]
+ [The host name of the remote user's machine. ]
   ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
   [
- [[link cgi.reference.common__request_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
+ [[link cgi.reference.common__basic_request.remote_ident [*remote_ident]]]
+ [The user making the request. ]
   ]
   
   [
- [[link cgi.reference.common__request_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
+ [[link cgi.reference.common__basic_request.remote_user [*remote_user]]]
+ [The userid of the person accessing the script. ]
   ]
   
   [
- [[link cgi.reference.common__request_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
+ [[link cgi.reference.common__basic_request.request_method [*request_method]]]
+ [The method of the request (long-hand of `method()`). ]
   ]
   
   [
- [[link cgi.reference.common__request_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
+ [[link cgi.reference.common__basic_request.request_uri [*request_uri]]]
+ [Get the URI of the request (long-hand of `uri()`). ]
   ]
   
   [
- [[link cgi.reference.common__request_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_request.role [*role]]]
+ [The role that the request is playing. ]
   ]
   
   [
- [[link cgi.reference.common__request_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
+ [[link cgi.reference.common__basic_request.script_name [*script_name]]]
+ [The name of the script. ]
   ]
   
   [
- [[link cgi.reference.common__request_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
+ [[link cgi.reference.common__basic_request.script_uri [*script_uri]]]
+ [The full URI of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_url [*script_url]]]
+ [The URL of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_name [*server_name]]]
+ [Get the name of the server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_port [*server_port]]]
+ [Get the port the calling server is listening on. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_protocol [*server_protocol]]]
+ [Get the protocol being used by the calling server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_software [*server_software]]]
+ [Get a string identifying the calling server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.set_protocol_service [*set_protocol_service]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.status [*status]]]
+ [Get / Set the status of a request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.uri [*uri]]]
+ [Get the URI of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request._basic_request [*~basic_request]]]
+ []
   ]
   
 ]
 
-This class provides generic member functions that can be used by any request type.
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__basic_request.cookies [*cookies]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_request.env [*env]]]
+ []
+ ]
 
-[endsect]
+ [
+ [[link cgi.reference.common__basic_request.form [*form]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_request.get [*get]]]
+ []
+ ]
 
-[section:cgi_request_service cgi_request_service::cgi_request_service]
+ [
+ [[link cgi.reference.common__basic_request.post [*post]]]
+ []
+ ]
 
-[indexterm2 cgi_request_service..cgi_request_service]
+ [
+ [[link cgi.reference.common__basic_request.uploads [*uploads]]]
+ []
+ ]
 
- template<
- typename T >
- ``[link cgi.reference.cgi_request_service.cgi_request_service.overload1 cgi_request_service]``(
- T & );
+]
 
- ``[link cgi.reference.cgi_request_service.cgi_request_service.overload2 cgi_request_service]``();
+Note: By default, synchronous protocols (ie. cgi) auto-load AND parse STDIN,whereas async protocols don't.
 
+Note: The alternative functions which take a boost::system::error\_code are the non-throwing versions. Instead of a boost::system::system\_error being thrown in case of an error, the passed error\_code will be set to the value of the error, s.t. if (error) evaluates to true.`
 
-[section:overload1 cgi_request_service::cgi_request_service (1 of 2 overloads)]
+Note: This class isn't thread safe: carrying around a mutex-per-request seems prohibitively expensive. There could be functions which take a mutex as an argument and lock it. (Async calls could get messy if you need a protected request object).
 
 
+[section:abort common::basic_request::abort]
 
- template<
- typename T >
- cgi_request_service(
- T & );
+[indexterm2 abort..common::basic_request] Abort a request.
+
+ void abort();
 
 
 
@@ -3028,64 +3362,93 @@
 
 
 
-[section:overload2 cgi_request_service::cgi_request_service (2 of 2 overloads)]
+[section:auth_type common::basic_request::auth_type]
+
+[indexterm2 auth_type..common::basic_request] Set the output for the request.
 
+ string_type & auth_type();
 
 
- cgi_request_service();
+Not Implemented Yet ******************
 
+Set the output sink as `stdout\_`, `stderr\_`, or `stdout\_ | stderr\_`
 
 
 [endsect]
 
 
-[endsect]
+[section:basic_request common::basic_request::basic_request]
+
+[indexterm2 basic_request..common::basic_request]
 
+ ``[link cgi.reference.common__basic_request.basic_request.overload1 basic_request]``(
+ int opts,
+ char ** base_env = NULL);
 
-[section:clear cgi_request_service::clear]
+ ``[link cgi.reference.common__basic_request.basic_request.overload2 basic_request]``(
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
+ ``[link cgi.reference.common__basic_request.basic_request.overload3 basic_request]``(
+ boost::system::error_code & ec,
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
-['Inherited from cgi_service_impl_base.]
+ ``[link cgi.reference.common__basic_request.basic_request.overload4 basic_request]``(
+ protocol_service_type & s,
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
-[indexterm2 clear..cgi_request_service]
+ ``[link cgi.reference.common__basic_request.basic_request.overload5 basic_request]``(
+ protocol_service_type & s,
+ boost::system::error_code & ec,
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
- void clear(
+ ``[link cgi.reference.common__basic_request.basic_request.overload6 basic_request]``(
       implementation_type & impl);
 
+ ``[link cgi.reference.common__basic_request.basic_request.overload7 basic_request]``(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
 
-[endsect]
+[section:overload1 common::basic_request::basic_request (1 of 7 overloads)]
 
 
 
-[section:client cgi_request_service::client]
+ basic_request(
+ int opts,
+ char ** base_env = NULL);
 
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 client..cgi_request_service] Return the connection associated with the request.
+[endsect]
 
- implementation_type::client_type & client(
- implementation_type & impl);
 
 
+[section:overload2 common::basic_request::basic_request (2 of 7 overloads)]
 
-[endsect]
 
 
+ basic_request(
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
-[section:close cgi_request_service::close]
 
 
-['Inherited from cgi_service_impl_base.]
+[endsect]
+
+
+
+[section:overload3 common::basic_request::basic_request (3 of 7 overloads)]
 
-[indexterm2 close..cgi_request_service]
 
- int close(
- implementation_type & impl,
- common::http::status_code & http_s,
- int status,
- boost::system::error_code & ec);
+
+ basic_request(
+ boost::system::error_code & ec,
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
 
 
@@ -3093,40 +3456,42 @@
 
 
 
-[section:construct cgi_request_service::construct]
+[section:overload4 common::basic_request::basic_request (4 of 7 overloads)]
 
-[indexterm2 construct..cgi_request_service]
 
- void construct(
- implementation_type & impl);
 
+ basic_request(
+ protocol_service_type & s,
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
 
-[endsect]
 
+[endsect]
 
 
-[section:destroy cgi_request_service::destroy]
 
-[indexterm2 destroy..cgi_request_service]
+[section:overload5 common::basic_request::basic_request (5 of 7 overloads)]
 
- void destroy(
- implementation_type & impl);
 
 
+ basic_request(
+ protocol_service_type & s,
+ boost::system::error_code & ec,
+ const parse_options opts = traits::parse_opts,
+ char ** base_env = NULL);
 
-[endsect]
 
 
+[endsect]
 
-[section:get_role cgi_request_service::get_role]
 
 
-['Inherited from cgi_service_impl_base.]
+[section:overload6 common::basic_request::basic_request (6 of 7 overloads)]
 
-[indexterm2 get_role..cgi_request_service]
+Make a new mutiplexed request from an existing connection.
 
- role_type get_role(
+ basic_request(
       implementation_type & impl);
 
 
@@ -3135,66 +3500,53 @@
 
 
 
-[section:is_file cgi_request_service::is_file]
+[section:overload7 common::basic_request::basic_request (7 of 7 overloads)]
 
+Make a new mutiplexed request from an existing connection.
 
-['Inherited from common::request_base.]
+ basic_request(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
-[indexterm2 is_file..cgi_request_service] Check if a given POST variable represents a file upload.
 
- bool is_file(
- ImplType & impl,
- typename ImplType::string_type const & key);
 
+[endsect]
 
 
 [endsect]
 
 
+[section:buffer_type common::basic_request::buffer_type]
 
-[section:is_open cgi_request_service::is_open]
+[indexterm2 buffer_type..common::basic_request]
 
+ typedef traits::buffer_type buffer_type;
 
-['Inherited from cgi_service_impl_base.]
 
-[indexterm2 is_open..cgi_request_service] Return if the request is still open.
 
- bool is_open(
- implementation_type & impl);
 
+[endsect]
 
-For CGI, this always returns true. However, in the case that a "Location: xxx" header is sent and the header is terminated, the request can be taken to be 'closed'.
 
 
-[endsect]
+[section:char_type common::basic_request::char_type]
 
+[indexterm2 char_type..common::basic_request]
 
-[section:load cgi_request_service::load]
+ typedef traits::char_type char_type;
 
-[indexterm2 load..cgi_request_service] Synchronously read/parse the request meta-data.
 
- boost::system::error_code ``[link cgi.reference.cgi_request_service.load.overload1 load]``(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
 
- boost::system::error_code & ``[link cgi.reference.cgi_request_service.load.overload2 load]``(
- implementation_type & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
 
+[endsect]
 
-[section:overload1 cgi_request_service::load (1 of 2 overloads)]
 
 
-['Inherited from common::request_base.]
+[section:charset common::basic_request::charset]
 
-Synchronously read/parse the request meta-data.
+[indexterm2 charset..common::basic_request] Get the charset from the CONTENT_TYPE header.
 
- boost::system::error_code load(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
+ string_type charset();
 
 
 
@@ -3202,74 +3554,84 @@
 
 
 
-[section:overload2 cgi_request_service::load (2 of 2 overloads)]
+[section:clear common::basic_request::clear]
+
+[indexterm2 clear..common::basic_request] Clear the data for the request, for reusing this object.
 
+ void clear();
 
-['Inherited from cgi_service_impl_base.]
 
-Synchronously read/parse the request data.
 
- boost::system::error_code & load(
- implementation_type & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
+[endsect]
 
 
 
-[endsect]
+[section:client common::basic_request::client]
 
+[indexterm2 client..common::basic_request] Get the client connection associated with the request.
 
-[endsect]
+ client_type & client();
 
 
-[section:load_environment cgi_request_service::load_environment]
+You use the client for read/write calls.
 
 
-['Inherited from common::request_base.]
+[endsect]
 
-[indexterm2 load_environment..cgi_request_service] Load the base_environment into the current environment.
 
- void load_environment(
- ImplType & impl,
- char ** base_environment,
- bool is_command_line);
 
+[section:client_type common::basic_request::client_type]
 
-Parsed the base\_environment and add it to the current request's environment. This overwrites any environment variables with the existing key.
+[indexterm2 client_type..common::basic_request]
 
-If `is\_command\_line` is true, then the first argument is skipped as this is the name of the program and ignored. Using it actually causes a crash on Windows (MSVC 9) anyway: I'm not exactly sure why.
+ typedef traits::client_type client_type;
 
 
-[endsect]
 
 
+[endsect]
 
-[section:map_type cgi_request_service::map_type]
 
+[section:close common::basic_request::close]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 close..common::basic_request] Asynchronously read/parse the request meta-data.
 
-[indexterm2 map_type..cgi_request_service]
+ int ``[link cgi.reference.common__basic_request.close.overload1 close]``(
+ common::http::status_code http_status = http::ok,
+ int program_status = 0);
 
- typedef ::cgi::common::map map_type;
+ int ``[link cgi.reference.common__basic_request.close.overload2 close]``(
+ common::http::status_code http_status,
+ int program_status,
+ boost::system::error_code & ec);
 
 
+[section:overload1 common::basic_request::close (1 of 2 overloads)]
 
+Asynchronously read/parse the request meta-data.
+
+ int close(
+ common::http::status_code http_status = http::ok,
+ int program_status = 0);
 
-[endsect]
 
+Note: 'loading' including reading/parsing STDIN if parse\_stdin == true Notify the server the request has been handled. In certain situations (such as a Proactor client using the async read functions) it will be necessary to call end, rather than just returning from the sub\_main function.
 
 
-[section:parse_cookie_vars cgi_request_service::parse_cookie_vars]
+[heading Parameters]
+
 
+[variablelist
+
+[[http_status][The HTTP status of the request.]]
 
-['Inherited from common::request_base.]
+[[program_status][This value is returned to the server indicating the state of the request after it was finished handling. It is implementation defined how the server deals with this, and it may have no effect on the http status code returned to the client (eg. 200 OK).]]
 
-[indexterm2 parse_cookie_vars..cgi_request_service] Read and parse the HTTP_COOKIE meta variable.
+]
 
- boost::system::error_code parse_cookie_vars(
- ImplType & impl,
- boost::system::error_code & ec);
+[heading Return Value]
+
+The value of program\_status
 
 
 
@@ -3277,15 +3639,13 @@
 
 
 
-[section:parse_get_vars cgi_request_service::parse_get_vars]
+[section:overload2 common::basic_request::close (2 of 2 overloads)]
 
 
-['Inherited from common::request_base.]
 
-[indexterm2 parse_get_vars..cgi_request_service] Read and parse the cgi GET meta variables.
-
- boost::system::error_code parse_get_vars(
- ImplType & impl,
+ int close(
+ common::http::status_code http_status,
+ int program_status,
       boost::system::error_code & ec);
 
 
@@ -3293,82 +3653,64 @@
 [endsect]
 
 
+[endsect]
 
-[section:parse_post_vars cgi_request_service::parse_post_vars]
 
+[section:content_length common::basic_request::content_length]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 content_length..common::basic_request] Get the content length as a long.
 
-[indexterm2 parse_post_vars..cgi_request_service] Read and parse the cgi POST meta variables (greedily).
+ long content_length();
 
- boost::system::error_code parse_post_vars(
- RequestImpl & impl,
- boost::system::error_code & ec);
 
+The content length defaults to zero if it isn't explicitly set by your HTTP server.
 
 
 [endsect]
 
 
 
-[section:protocol_type cgi_request_service::protocol_type]
+[section:content_type common::basic_request::content_type]
 
-[indexterm2 protocol_type..cgi_request_service]
+[indexterm2 content_type..common::basic_request] The content type of the request.
 
- typedef common::tags::cgi protocol_type;
+ string_type & content_type();
 
 
+Common value: text/html.
 
 
 [endsect]
 
 
 
-[section:read_env_vars cgi_request_service::read_env_vars]
-
+[section:cookies common::basic_request::cookies]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 cookies..common::basic_request]
 
-[indexterm2 read_env_vars..cgi_request_service] Read the environment variables into an internal map.
-
- boost::system::error_code read_env_vars(
- RequestImpl & impl,
- boost::system::error_code & ec);
+ common::data_map_proxy< cookie_map > cookies;
 
 
 
 [endsect]
 
 
-[section:read_some cgi_request_service::read_some]
+[section:create common::basic_request::create]
 
-[indexterm2 read_some..cgi_request_service] Read some data from the client into the supplied buffer.
+[indexterm2 create..common::basic_request]
 
- std::size_t ``[link cgi.reference.cgi_request_service.read_some.overload1 read_some]``(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
- std::size_t ``[link cgi.reference.cgi_request_service.read_some.overload2 read_some]``(
- ImplType & impl,
- boost::system::error_code & ec);
-
- std::size_t ``[link cgi.reference.cgi_request_service.read_some.overload3 read_some]``(
- implementation_type & impl,
- boost::system::error_code & ec);
+ static pointer ``[link cgi.reference.common__basic_request.create.overload1 create]``(
+ protocol_service_type & ps);
 
+ static pointer ``[link cgi.reference.common__basic_request.create.overload2 create]``();
 
-[section:overload1 cgi_request_service::read_some (1 of 3 overloads)]
 
+[section:overload1 common::basic_request::create (1 of 2 overloads)]
 
-['Inherited from common::request_base.]
 
-Read some data from the client into the supplied buffer.
 
- std::size_t read_some(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
+ static pointer create(
+ protocol_service_type & ps);
 
 
 
@@ -3376,558 +3718,273 @@
 
 
 
-[section:overload2 cgi_request_service::read_some (2 of 3 overloads)]
+[section:overload2 common::basic_request::create (2 of 2 overloads)]
 
 
-['Inherited from common::request_base.]
 
-Read some data into the internal buffer.
+ static pointer create();
 
- std::size_t read_some(
- ImplType & impl,
- boost::system::error_code & ec);
 
 
+[endsect]
+
 
 [endsect]
 
 
+[section:env common::basic_request::env]
 
-[section:overload3 cgi_request_service::read_some (3 of 3 overloads)]
+[indexterm2 env..common::basic_request]
 
+ common::data_map_proxy< env_map > env;
 
-['Inherited from cgi_service_impl_base.]
 
 
+[endsect]
 
- std::size_t read_some(
- implementation_type & impl,
- boost::system::error_code & ec);
 
 
+[section:form common::basic_request::form]
+
+[indexterm2 form..common::basic_request]
+
+ common::data_map_proxy< form_map > form;
 
-[endsect]
 
 
 [endsect]
 
-[section:request_id cgi_request_service::request_id]
 
-[indexterm2 request_id..cgi_request_service] Get the request ID of a FastCGI request, or 1.
 
- boost::uint16_t const & ``[link cgi.reference.cgi_request_service.request_id.overload1 request_id]``(
- ImplType & impl) const;
+[section:gateway_interface common::basic_request::gateway_interface]
 
- int ``[link cgi.reference.cgi_request_service.request_id.overload2 request_id]``(
- implementation_type & impl);
+[indexterm2 gateway_interface..common::basic_request] The protocol used by the server to communicate to the script.
 
+ string_type & gateway_interface();
 
-[section:overload1 cgi_request_service::request_id (1 of 2 overloads)]
 
+Common value: CGI/1.1.
 
-['Inherited from common::request_base.]
 
-Get the request ID of a FastCGI request, or 1.
+[endsect]
 
- boost::uint16_t const & request_id(
- ImplType & impl) const;
 
 
+[section:get common::basic_request::get]
 
-[endsect]
+[indexterm2 get..common::basic_request]
 
+ common::data_map_proxy< get_map > get;
 
 
-[section:overload2 cgi_request_service::request_id (2 of 2 overloads)]
 
+[endsect]
 
-['Inherited from cgi_service_impl_base.]
 
 
+[section:hash common::basic_request::hash]
 
- int request_id(
- implementation_type & impl);
+[indexterm2 hash..common::basic_request] Get a hashed interpretation of the request.
 
+ std::size_t hash();
 
 
-[endsect]
+You cannot consider this completely unique to each request, but it should be quite useful anyway. You can use this for logging or tracking, for example.
 
 
 [endsect]
 
 
-[section:self_type cgi_request_service::self_type]
 
+[section:http_cookie common::basic_request::http_cookie]
 
-['Inherited from cgi_service_impl_base.]
+[indexterm2 http_cookie..common::basic_request] The cookies sent by the user making the request.
 
-[indexterm2 self_type..cgi_request_service]
+ string_type & http_cookie();
 
- typedef cgi_service_impl_base< cgi_request_impl > self_type;
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.base_type [*base_type]]]
- []
-
- ]
 
- [
+[section:http_from common::basic_request::http_from]
 
- [[link cgi.reference.cgi_service_impl_base__callback_functor [*callback_functor]]]
- []
-
- ]
+[indexterm2 http_from..common::basic_request] The email of the user making the request.
 
- [
+ string_type & http_from();
 
- [[link cgi.reference.cgi_service_impl_base__implementation_type [*implementation_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.map_type [*map_type]]]
- []
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.protocol_type [*protocol_type]]]
- []
-
- ]
 
- [
+[section:id common::basic_request::id]
 
- [[link cgi.reference.cgi_service_impl_base.self_type [*self_type]]]
- []
-
- ]
+[indexterm2 id..common::basic_request] The id of this request.
 
-]
+ int id();
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.cgi_service_impl_base.cgi_service_impl_base [*cgi_service_impl_base]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.clear [*clear]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.client [*client]]]
- [Return the connection associated with the request. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.is_open [*is_open]]]
- [Return if the request is still open. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.set_status [*set_status]]]
- [Set the request status. ]
- ]
-
-]
+This is 1 for CGI/aCGI requests, but may be != 1 for FastCGI requests.
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+Note that for FastCGI requests, the id's are assigned on a *per-connection* policy, so in one application you may have several requests with the same id.
 
- [
- [[link cgi.reference.cgi_service_impl_base.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
- ]
-
-]
 
+[endsect]
 
 
-[endsect]
 
+[section:implementation_type common::basic_request::implementation_type]
 
-[section:set_status cgi_request_service::set_status]
+[indexterm2 implementation_type..common::basic_request]
 
-[indexterm2 set_status..cgi_request_service] Set the request status.
+ typedef service_type::implementation_type implementation_type;
 
- void ``[link cgi.reference.cgi_request_service.set_status.overload1 set_status]``(
- implementation_type & impl,
- common::request_status status);
 
- void ``[link cgi.reference.cgi_request_service.set_status.overload2 set_status]``(
- implementation_type & impl,
- common::http::status_code & );
 
 
-[section:overload1 cgi_request_service::set_status (1 of 2 overloads)]
+[endsect]
 
 
-['Inherited from cgi_service_impl_base.]
 
-Set the request status.
+[section:is_open common::basic_request::is_open]
 
- void set_status(
- implementation_type & impl,
- common::request_status status);
+[indexterm2 is_open..common::basic_request] Check if the request is still open (ie. not aborted or closed).
+
+ bool is_open();
 
 
 
 [endsect]
 
 
+[section:load common::basic_request::load]
 
-[section:overload2 cgi_request_service::set_status (2 of 2 overloads)]
+[indexterm2 load..common::basic_request] Synchronously read/parse the request meta-data.
 
+ void ``[link cgi.reference.common__basic_request.load.overload1 load]``(
+ parse_options parse_opts = parse_env,
+ char ** base_env = NULL);
 
-['Inherited from cgi_service_impl_base.]
+ boost::system::error_code ``[link cgi.reference.common__basic_request.load.overload2 load]``(
+ parse_options parse_opts,
+ boost::system::error_code & ec,
+ char ** base_environment = NULL,
+ bool is_command_line = true);
 
-Set the http status (this does nothing for aCGI).
+ void ``[link cgi.reference.common__basic_request.load.overload3 load]``(
+ char ** base_environment,
+ bool is_command_line = true);
 
- void set_status(
- implementation_type & impl,
- common::http::status_code & );
 
+[section:overload1 common::basic_request::load (1 of 3 overloads)]
 
+Synchronously read/parse the request meta-data.
 
-[endsect]
+ void load(
+ parse_options parse_opts = parse_env,
+ char ** base_env = NULL);
 
 
-[endsect]
+Note: 'loading' including reading/parsing STDIN if parse\_stdin == true
 
 
 [endsect]
 
-[section:cgi_service_impl_base cgi_service_impl_base]
 
 
+[section:overload2 common::basic_request::load (2 of 3 overloads)]
 
- template<
- typename ``[link cgi.reference.RequestImplType RequestImplType]``>
- class cgi_service_impl_base :
- public common::request_base< cgi_service_impl_base< RequestImplType > >
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ boost::system::error_code load(
+ parse_options parse_opts,
+ boost::system::error_code & ec,
+ char ** base_environment = NULL,
+ bool is_command_line = true);
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.base_type [*base_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.cgi_service_impl_base__callback_functor [*callback_functor]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base__implementation_type [*implementation_type]]]
- []
-
- ]
+[section:overload3 common::basic_request::load (3 of 3 overloads)]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.map_type [*map_type]]]
- []
-
- ]
 
- [
+ void load(
+ char ** base_environment,
+ bool is_command_line = true);
 
- [[link cgi.reference.cgi_service_impl_base.protocol_type [*protocol_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base.self_type [*self_type]]]
- []
-
- ]
+[endsect]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[endsect]
 
- [
- [[link cgi.reference.cgi_service_impl_base.cgi_service_impl_base [*cgi_service_impl_base]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.clear [*clear]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.client [*client]]]
- [Return the connection associated with the request. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.is_open [*is_open]]]
- [Return if the request is still open. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.set_status [*set_status]]]
- [Set the request status. ]
- ]
-
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+[section:method common::basic_request::method]
 
- [
- [[link cgi.reference.cgi_service_impl_base.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
- ]
-
-]
+[indexterm2 method..common::basic_request] The method of the request.
 
+ string_type & method();
 
-[section:base_type cgi_service_impl_base::base_type]
 
-[indexterm2 base_type..cgi_service_impl_base]
+Common values: `GET`, `POST`, `HEAD`.
 
- typedef common::request_base< self_type > base_type;
 
+[endsect]
 
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base [*impl_base]]]
- []
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:path_info common::basic_request::path_info]
 
- [
- [[link cgi.reference.common__request_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
-]
+[indexterm2 path_info..common::basic_request] Additional information, appendended to the script.
 
-This class provides generic member functions that can be used by any request type.
+ common::path_info path_info();
 
 
 
 [endsect]
 
 
-[section:cgi_service_impl_base cgi_service_impl_base::cgi_service_impl_base]
-
-[indexterm2 cgi_service_impl_base..cgi_service_impl_base]
-
- template<
- typename T >
- ``[link cgi.reference.cgi_service_impl_base.cgi_service_impl_base.overload1 cgi_service_impl_base]``(
- T & );
-
- ``[link cgi.reference.cgi_service_impl_base.cgi_service_impl_base.overload2 cgi_service_impl_base]``();
-
 
-[section:overload1 cgi_service_impl_base::cgi_service_impl_base (1 of 2 overloads)]
+[section:path_translated common::basic_request::path_translated]
 
+[indexterm2 path_translated..common::basic_request] The translated version of the path info.
 
+ string_type & path_translated();
 
- template<
- typename T >
- cgi_service_impl_base(
- T & );
 
+Your HTTP server may provide this, depending on configuration. The path info can represent a resource on the local file system.
 
 
 [endsect]
 
 
 
-[section:overload2 cgi_service_impl_base::cgi_service_impl_base (2 of 2 overloads)]
+[section:pointer common::basic_request::pointer]
 
+[indexterm2 pointer..common::basic_request]
 
+ typedef traits::pointer pointer;
 
- cgi_service_impl_base();
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:clear cgi_service_impl_base::clear]
+[section:post common::basic_request::post]
 
-[indexterm2 clear..cgi_service_impl_base]
+[indexterm2 post..common::basic_request]
 
- void clear(
- implementation_type & impl);
+ common::data_map_proxy< post_map > post;
 
 
 
@@ -3935,28 +3992,26 @@
 
 
 
-[section:client cgi_service_impl_base::client]
+[section:post_buffer common::basic_request::post_buffer]
 
-[indexterm2 client..cgi_service_impl_base] Return the connection associated with the request.
+[indexterm2 post_buffer..common::basic_request] Get the buffer containing the POST data.
+
+ buffer_type & post_buffer();
 
- implementation_type::client_type & client(
- implementation_type & impl);
 
+**FIXME** This actually returns the whole buffer on FastCGI at the moment, which contains the params too.
 
 
 [endsect]
 
 
 
-[section:close cgi_service_impl_base::close]
+[section:protocol_service_type common::basic_request::protocol_service_type]
 
-[indexterm2 close..cgi_service_impl_base]
+[indexterm2 protocol_service_type..common::basic_request]
+
+ typedef traits::protocol_service_type protocol_service_type;
 
- int close(
- implementation_type & impl,
- common::http::status_code & http_s,
- int status,
- boost::system::error_code & ec);
 
 
 
@@ -3964,75 +4019,70 @@
 
 
 
-[section:get_role cgi_service_impl_base::get_role]
+[section:protocol_type common::basic_request::protocol_type]
 
-[indexterm2 get_role..cgi_service_impl_base]
+[indexterm2 protocol_type..common::basic_request]
 
- role_type get_role(
- implementation_type & impl);
+ typedef Protocol protocol_type;
 
 
 
-[endsect]
 
+[endsect]
 
 
-[section:is_file cgi_service_impl_base::is_file]
 
+[section:query_string common::basic_request::query_string]
 
-['Inherited from common::request_base.]
+[indexterm2 query_string..common::basic_request] The query string for the request.
 
-[indexterm2 is_file..cgi_service_impl_base] Check if a given POST variable represents a file upload.
+ string_type & query_string();
 
- bool is_file(
- ImplType & impl,
- typename ImplType::string_type const & key);
 
+This is the part of the request URI after a '?'. A GET request passes request parameters, URL encoded in the query string.
 
 
 [endsect]
 
 
+[section:read_some common::basic_request::read_some]
 
-[section:is_open cgi_service_impl_base::is_open]
-
-[indexterm2 is_open..cgi_service_impl_base] Return if the request is still open.
+[indexterm2 read_some..common::basic_request] Read some data into the request, parsing if necessary.
 
- bool is_open(
- implementation_type & impl);
+ void ``[link cgi.reference.common__basic_request.read_some.overload1 read_some]``();
 
+ std::size_t ``[link cgi.reference.common__basic_request.read_some.overload2 read_some]``(
+ boost::system::error_code & ec);
 
-For CGI, this always returns true. However, in the case that a "Location: xxx" header is sent and the header is terminated, the request can be taken to be 'closed'.
+ template<
+ typename MutableBufferSequence >
+ void ``[link cgi.reference.common__basic_request.read_some.overload3 read_some]``(
+ const MutableBufferSequence & buf);
 
+ template<
+ typename MutableBufferSequence >
+ std::size_t ``[link cgi.reference.common__basic_request.read_some.overload4 read_some]``(
+ const MutableBufferSequence & buf,
+ boost::system::error_code & ec);
 
-[endsect]
 
+[section:overload1 common::basic_request::read_some (1 of 4 overloads)]
 
-[section:load cgi_service_impl_base::load]
+Read some data into the request, parsing if necessary.
 
-[indexterm2 load..cgi_service_impl_base] Synchronously read/parse the request meta-data.
+ void read_some();
 
- boost::system::error_code ``[link cgi.reference.cgi_service_impl_base.load.overload1 load]``(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
 
- boost::system::error_code & ``[link cgi.reference.cgi_service_impl_base.load.overload2 load]``(
- implementation_type & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
 
+[endsect]
 
-[section:overload1 cgi_service_impl_base::load (1 of 2 overloads)]
 
 
-['Inherited from common::request_base.]
+[section:overload2 common::basic_request::read_some (2 of 4 overloads)]
 
-Synchronously read/parse the request meta-data.
+Read some data into the request, parsing if necessary.
 
- boost::system::error_code load(
- ImplType & impl,
- common::parse_options parse_opts,
+ std::size_t read_some(
       boost::system::error_code & ec);
 
 
@@ -4041,68 +4091,62 @@
 
 
 
-[section:overload2 cgi_service_impl_base::load (2 of 2 overloads)]
-
-Synchronously read/parse the request data.
-
- boost::system::error_code & load(
- implementation_type & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
+[section:overload3 common::basic_request::read_some (3 of 4 overloads)]
 
+Read some data into the supplied buffer, parsing if necessary.
 
+ template<
+ typename MutableBufferSequence >
+ void read_some(
+ const MutableBufferSequence & buf);
 
-[endsect]
 
 
 [endsect]
 
 
-[section:load_environment cgi_service_impl_base::load_environment]
-
 
-['Inherited from common::request_base.]
+[section:overload4 common::basic_request::read_some (4 of 4 overloads)]
 
-[indexterm2 load_environment..cgi_service_impl_base] Load the base_environment into the current environment.
+Read some data into the supplied buffer, parsing if necessary.
 
- void load_environment(
- ImplType & impl,
- char ** base_environment,
- bool is_command_line);
+ template<
+ typename MutableBufferSequence >
+ std::size_t read_some(
+ const MutableBufferSequence & buf,
+ boost::system::error_code & ec);
 
 
-Parsed the base\_environment and add it to the current request's environment. This overwrites any environment variables with the existing key.
 
-If `is\_command\_line` is true, then the first argument is skipped as this is the name of the program and ignored. Using it actually causes a crash on Windows (MSVC 9) anyway: I'm not exactly sure why.
+[endsect]
 
 
 [endsect]
 
 
+[section:referer common::basic_request::referer]
 
-[section:map_type cgi_service_impl_base::map_type]
+[indexterm2 referer..common::basic_request] Get the web page the user came from.
 
-[indexterm2 map_type..cgi_service_impl_base]
+ string_type & referer();
 
- typedef ::cgi::common::map map_type;
 
+HTTP equivalent: `HTTP\_REFERER`
 
+The referer is commonly used for tracking user's movements and origins. For instance, some sites use this to highlight some keywords on the page when users come from a search engine.
 
-
-[endsect]
+Note that you cannot ever guarantee on this value being either set or accurate.
 
 
+[endsect]
 
-[section:parse_cookie_vars cgi_service_impl_base::parse_cookie_vars]
 
 
-['Inherited from common::request_base.]
+[section:reject common::basic_request::reject]
 
-[indexterm2 parse_cookie_vars..cgi_service_impl_base] Read and parse the HTTP_COOKIE meta variable.
+[indexterm2 reject..common::basic_request] Reject the request with a '500 Internal Server Error' error.
 
- boost::system::error_code parse_cookie_vars(
- ImplType & impl,
- boost::system::error_code & ec);
+ int reject();
 
 
 
@@ -4110,16 +4154,11 @@
 
 
 
-[section:parse_get_vars cgi_service_impl_base::parse_get_vars]
+[section:remote_addr common::basic_request::remote_addr]
 
+[indexterm2 remote_addr..common::basic_request] The host address of the remote user.
 
-['Inherited from common::request_base.]
-
-[indexterm2 parse_get_vars..cgi_service_impl_base] Read and parse the cgi GET meta variables.
-
- boost::system::error_code parse_get_vars(
- ImplType & impl,
- boost::system::error_code & ec);
+ string_type & remote_addr();
 
 
 
@@ -4127,15 +4166,11 @@
 
 
 
-[section:parse_post_vars cgi_service_impl_base::parse_post_vars]
+[section:remote_host common::basic_request::remote_host]
 
-[indexterm2 parse_post_vars..cgi_service_impl_base] Read and parse the cgi POST meta variables (greedily).
+[indexterm2 remote_host..common::basic_request] The host name of the remote user's machine.
 
- template<
- typename RequestImpl >
- boost::system::error_code parse_post_vars(
- RequestImpl & impl,
- boost::system::error_code & ec);
+ string_type & remote_host();
 
 
 
@@ -4143,12 +4178,11 @@
 
 
 
-[section:protocol_type cgi_service_impl_base::protocol_type]
+[section:remote_ident common::basic_request::remote_ident]
 
-[indexterm2 protocol_type..cgi_service_impl_base]
-
- typedef RequestImplType::protocol_type protocol_type;
+[indexterm2 remote_ident..common::basic_request] The user making the request.
 
+ string_type & remote_ident();
 
 
 
@@ -4156,50 +4190,37 @@
 
 
 
-[section:read_env_vars cgi_service_impl_base::read_env_vars]
+[section:remote_user common::basic_request::remote_user]
 
-[indexterm2 read_env_vars..cgi_service_impl_base] Read the environment variables into an internal map.
+[indexterm2 remote_user..common::basic_request] The userid of the person accessing the script.
 
- template<
- typename RequestImpl >
- boost::system::error_code read_env_vars(
- RequestImpl & impl,
- boost::system::error_code & ec);
+ string_type & remote_user();
 
 
 
 [endsect]
 
 
-[section:read_some cgi_service_impl_base::read_some]
 
-[indexterm2 read_some..cgi_service_impl_base] Read some data from the client into the supplied buffer.
+[section:request_method common::basic_request::request_method]
 
- std::size_t ``[link cgi.reference.cgi_service_impl_base.read_some.overload1 read_some]``(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
+[indexterm2 request_method..common::basic_request] The method of the request (long-hand of `method()`).
 
- std::size_t ``[link cgi.reference.cgi_service_impl_base.read_some.overload2 read_some]``(
- ImplType & impl,
- boost::system::error_code & ec);
+ string_type & request_method();
 
- std::size_t ``[link cgi.reference.cgi_service_impl_base.read_some.overload3 read_some]``(
- implementation_type & impl,
- boost::system::error_code & ec);
 
+Common values: `GET`, `POST`, `HEAD`.
 
-[section:overload1 cgi_service_impl_base::read_some (1 of 3 overloads)]
 
+[endsect]
 
-['Inherited from common::request_base.]
 
-Read some data from the client into the supplied buffer.
 
- std::size_t read_some(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
+[section:request_uri common::basic_request::request_uri]
+
+[indexterm2 request_uri..common::basic_request] Get the URI of the request (long-hand of `uri()`).
+
+ string_type & request_uri();
 
 
 
@@ -4207,58 +4228,51 @@
 
 
 
-[section:overload2 cgi_service_impl_base::read_some (2 of 3 overloads)]
+[section:role common::basic_request::role]
 
+[indexterm2 role..common::basic_request] The role that the request is playing.
 
-['Inherited from common::request_base.]
+ role_type & role() const;
 
-Read some data into the internal buffer.
 
- std::size_t read_some(
- ImplType & impl,
- boost::system::error_code & ec);
+The default role type is responder.
 
+In some cases - for instance with FastCGI - the role type can be different eg. `authorizer`, or `filter`.
 
 
 [endsect]
 
 
 
-[section:overload3 cgi_service_impl_base::read_some (3 of 3 overloads)]
-
+[section:script_name common::basic_request::script_name]
 
+[indexterm2 script_name..common::basic_request] The name of the script.
 
- std::size_t read_some(
- implementation_type & impl,
- boost::system::error_code & ec);
+ string_type & script_name();
 
 
 
 [endsect]
 
 
-[endsect]
 
-[section:request_id cgi_service_impl_base::request_id]
+[section:script_uri common::basic_request::script_uri]
 
-[indexterm2 request_id..cgi_service_impl_base] Get the request ID of a FastCGI request, or 1.
+[indexterm2 script_uri..common::basic_request] The full URI of the script.
 
- boost::uint16_t const & ``[link cgi.reference.cgi_service_impl_base.request_id.overload1 request_id]``(
- ImplType & impl) const;
+ string_type & script_uri();
 
- int ``[link cgi.reference.cgi_service_impl_base.request_id.overload2 request_id]``(
- implementation_type & impl);
 
 
-[section:overload1 cgi_service_impl_base::request_id (1 of 2 overloads)]
+[endsect]
 
 
-['Inherited from common::request_base.]
 
-Get the request ID of a FastCGI request, or 1.
+[section:script_url common::basic_request::script_url]
 
- boost::uint16_t const & request_id(
- ImplType & impl) const;
+[indexterm2 script_url..common::basic_request] The URL of the script.
+
+ string_type & script_url();
 
 
 
@@ -4266,70 +4280,90 @@
 
 
 
-[section:overload2 cgi_service_impl_base::request_id (2 of 2 overloads)]
+[section:self_type common::basic_request::self_type]
 
+[indexterm2 self_type..common::basic_request]
 
+ typedef basic_request< Protocol > self_type;
 
- int request_id(
- implementation_type & impl);
 
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
-[endsect]
+ [[link cgi.reference.common__basic_request.buffer_type [*buffer_type]]]
+ []
+
+ ]
 
+ [
 
-[endsect]
+ [[link cgi.reference.common__basic_request.char_type [*char_type]]]
+ []
+
+ ]
 
+ [
 
-[section:self_type cgi_service_impl_base::self_type]
+ [[link cgi.reference.common__basic_request.client_type [*client_type]]]
+ []
+
+ ]
 
-[indexterm2 self_type..cgi_service_impl_base]
+ [
 
- typedef cgi_service_impl_base< RequestImplType > self_type;
+ [[link cgi.reference.common__basic_request.implementation_type [*implementation_type]]]
+ []
+
+ ]
 
+ [
 
-[heading Types]
-[table
- [[Name][Description]]
+ [[link cgi.reference.common__basic_request.pointer [*pointer]]]
+ []
+
+ ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.base_type [*base_type]]]
+ [[link cgi.reference.common__basic_request.protocol_service_type [*protocol_service_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base__callback_functor [*callback_functor]]]
+ [[link cgi.reference.common__basic_request.protocol_type [*protocol_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base__implementation_type [*implementation_type]]]
+ [[link cgi.reference.common__basic_request.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_request.service_type [*service_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_request.string_type [*string_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.cgi_service_impl_base.self_type [*self_type]]]
+ [[link cgi.reference.common__basic_request.traits [*traits]]]
     []
   
   ]
@@ -4341,276 +4375,387 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.cgi_service_impl_base.cgi_service_impl_base [*cgi_service_impl_base]]]
- []
+ [[link cgi.reference.common__basic_request.abort [*abort]]]
+ [Abort a request. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.clear [*clear]]]
+ [[link cgi.reference.common__basic_request.auth_type [*auth_type]]]
+ [Set the output for the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.basic_request [*basic_request]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.client [*client]]]
- [Return the connection associated with the request. ]
+ [[link cgi.reference.common__basic_request.charset [*charset]]]
+ [Get the charset from the CONTENT_TYPE header. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.close [*close]]]
- []
+ [[link cgi.reference.common__basic_request.clear [*clear]]]
+ [Clear the data for the request, for reusing this object. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.client [*client]]]
+ [Get the client connection associated with the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.close [*close]]]
+ [Asynchronously read/parse the request meta-data. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.content_length [*content_length]]]
+ [Get the content length as a long. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.content_type [*content_type]]]
+ [The content type of the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.get_role [*get_role]]]
+ [[link cgi.reference.common__basic_request.create [*create]]]
     []
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
+ [[link cgi.reference.common__basic_request.gateway_interface [*gateway_interface]]]
+ [The protocol used by the server to communicate to the script. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.is_open [*is_open]]]
- [Return if the request is still open. ]
+ [[link cgi.reference.common__basic_request.hash [*hash]]]
+ [Get a hashed interpretation of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.http_cookie [*http_cookie]]]
+ [The cookies sent by the user making the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.http_from [*http_from]]]
+ [The email of the user making the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.load [*load]]]
+ [[link cgi.reference.common__basic_request.id [*id]]]
+ [The id of this request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.is_open [*is_open]]]
+ [Check if the request is still open (ie. not aborted or closed). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.load [*load]]]
     [Synchronously read/parse the request meta-data. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
+ [[link cgi.reference.common__basic_request.method [*method]]]
+ [The method of the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
+ [[link cgi.reference.common__basic_request.path_info [*path_info]]]
+ [Additional information, appendended to the script. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_request.path_translated [*path_translated]]]
+ [The translated version of the path info. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
+ [[link cgi.reference.common__basic_request.post_buffer [*post_buffer]]]
+ [Get the buffer containing the POST data. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
+ [[link cgi.reference.common__basic_request.query_string [*query_string]]]
+ [The query string for the request. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.set_status [*set_status]]]
- [Set the request status. ]
+ [[link cgi.reference.common__basic_request.read_some [*read_some]]]
+ [Read some data into the request, parsing if necessary. ]
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.cgi_service_impl_base.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.common__basic_request.referer [*referer]]]
+ [Get the web page the user came from. ]
   ]
   
   [
- [[link cgi.reference.cgi_service_impl_base.read_env_vars [*read_env_vars]]]
- [Read the environment variables into an internal map. ]
+ [[link cgi.reference.common__basic_request.reject [*reject]]]
+ [Reject the request with a '500 Internal Server Error' error. ]
   ]
   
-]
-
-
-
-[endsect]
-
-
-[section:set_status cgi_service_impl_base::set_status]
-
-[indexterm2 set_status..cgi_service_impl_base] Set the request status.
-
- void ``[link cgi.reference.cgi_service_impl_base.set_status.overload1 set_status]``(
- implementation_type & impl,
- common::request_status status);
-
- void ``[link cgi.reference.cgi_service_impl_base.set_status.overload2 set_status]``(
- implementation_type & impl,
- common::http::status_code & );
-
-
-[section:overload1 cgi_service_impl_base::set_status (1 of 2 overloads)]
-
-Set the request status.
-
- void set_status(
- implementation_type & impl,
- common::request_status status);
-
-
-
-[endsect]
-
+ [
+ [[link cgi.reference.common__basic_request.remote_addr [*remote_addr]]]
+ [The host address of the remote user. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_host [*remote_host]]]
+ [The host name of the remote user's machine. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_ident [*remote_ident]]]
+ [The user making the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_user [*remote_user]]]
+ [The userid of the person accessing the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.request_method [*request_method]]]
+ [The method of the request (long-hand of `method()`). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.request_uri [*request_uri]]]
+ [Get the URI of the request (long-hand of `uri()`). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.role [*role]]]
+ [The role that the request is playing. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_name [*script_name]]]
+ [The name of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_uri [*script_uri]]]
+ [The full URI of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_url [*script_url]]]
+ [The URL of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_name [*server_name]]]
+ [Get the name of the server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_port [*server_port]]]
+ [Get the port the calling server is listening on. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_protocol [*server_protocol]]]
+ [Get the protocol being used by the calling server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_software [*server_software]]]
+ [Get a string identifying the calling server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.set_protocol_service [*set_protocol_service]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.status [*status]]]
+ [Get / Set the status of a request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.uri [*uri]]]
+ [Get the URI of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request._basic_request [*~basic_request]]]
+ []
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link cgi.reference.common__basic_request.cookies [*cookies]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.env [*env]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_request.form [*form]]]
+ []
+ ]
 
-[section:overload2 cgi_service_impl_base::set_status (2 of 2 overloads)]
+ [
+ [[link cgi.reference.common__basic_request.get [*get]]]
+ []
+ ]
 
-Set the http status (this does nothing for aCGI).
+ [
+ [[link cgi.reference.common__basic_request.post [*post]]]
+ []
+ ]
 
- void set_status(
- implementation_type & impl,
- common::http::status_code & );
+ [
+ [[link cgi.reference.common__basic_request.uploads [*uploads]]]
+ []
+ ]
 
+]
 
+Note: By default, synchronous protocols (ie. cgi) auto-load AND parse STDIN,whereas async protocols don't.
 
-[endsect]
+Note: The alternative functions which take a boost::system::error\_code are the non-throwing versions. Instead of a boost::system::system\_error being thrown in case of an error, the passed error\_code will be set to the value of the error, s.t. if (error) evaluates to true.`
 
+Note: This class isn't thread safe: carrying around a mutex-per-request seems prohibitively expensive. There could be functions which take a mutex as an argument and lock it. (Async calls could get messy if you need a protected request object).
 
-[endsect]
 
 
 [endsect]
 
-[section:cgi_service_impl_base__callback_functor cgi_service_impl_base::callback_functor]
 
 
+[section:server_name common::basic_request::server_name]
 
- template<
- typename Service >
- struct callback_functor
+[indexterm2 server_name..common::basic_request] Get the name of the server.
 
+ string_type & server_name();
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.cgi_service_impl_base__callback_functor.callback_functor [*callback_functor]]]
- []
- ]
-
- [
- [[link cgi.reference.cgi_service_impl_base__callback_functor.operator() [*operator()]]]
- []
- ]
-
-]
+Usually set in your HTTP configuration. This could be the name of a virtual host.
 
 
-[section:callback_functor cgi_service_impl_base::callback_functor::callback_functor]
+[endsect]
 
-[indexterm2 callback_functor..cgi_service_impl_base::callback_functor]
 
- callback_functor(
- implementation_type & impl,
- Service * service);
 
+[section:server_port common::basic_request::server_port]
+
+[indexterm2 server_port..common::basic_request] Get the port the calling server is listening on.
+
+ string_type & server_port();
+
+
+Common value: 80.
 
 
 [endsect]
 
 
 
-[section:operator() cgi_service_impl_base::callback_functor::operator()]
+[section:server_protocol common::basic_request::server_protocol]
 
-[indexterm2 operator()..cgi_service_impl_base::callback_functor]
+[indexterm2 server_protocol..common::basic_request] Get the protocol being used by the calling server.
 
- std::size_t operator()(
- boost::system::error_code & ec);
+ string_type & server_protocol();
 
 
+Common value: HTTP/1.1.
+
 
 [endsect]
 
 
 
+[section:server_software common::basic_request::server_software]
+
+[indexterm2 server_software..common::basic_request] Get a string identifying the calling server.
+
+ string_type & server_software();
+
+
+CGI scripts are generally called by a web-facing HTTP server. When set, this string can be useful for knowing what is calling the script, especially in a multi-server or load balanced environment.
+
+
 [endsect]
 
-[section:cgi_service_impl_base__implementation_type cgi_service_impl_base::implementation_type]
 
 
+[section:service_type common::basic_request::service_type]
 
- struct implementation_type :
- common::request_base< T >::impl_base
+[indexterm2 service_type..common::basic_request]
 
+ typedef traits::service_type service_type;
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link cgi.reference.cgi_service_impl_base__implementation_type.client_type [*client_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.cgi_service_impl_base__implementation_type.form_parser_type [*form_parser_type]]]
- []
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:set_protocol_service common::basic_request::set_protocol_service]
 
- [
- [[link cgi.reference.cgi_service_impl_base__implementation_type.implementation_type [*implementation_type]]]
- []
- ]
-
-]
+[indexterm2 set_protocol_service..common::basic_request]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+ void set_protocol_service(
+ protocol_service_type & ps);
 
- [
- [[link cgi.reference.cgi_service_impl_base__implementation_type.characters_left_ [*characters_left_]]]
- []
- ]
 
- [
- [[link cgi.reference.cgi_service_impl_base__implementation_type.client_ [*client_]]]
- []
- ]
 
- [
- [[link cgi.reference.cgi_service_impl_base__implementation_type.fp_ [*fp_]]]
- []
- ]
+[endsect]
 
-]
+
+[section:status common::basic_request::status]
+
+[indexterm2 status..common::basic_request] Get / Set the status of a request.
+
+ common::request_status ``[link cgi.reference.common__basic_request.status.overload1 status]``() const;
+
+ void ``[link cgi.reference.common__basic_request.status.overload2 status]``(
+ common::request_status const & status);
+
+ common::http::status_code ``[link cgi.reference.common__basic_request.status.overload3 status]``(
+ common::http::status_code const & status) const;
+
+ void ``[link cgi.reference.common__basic_request.status.overload4 status]``(
+ common::http::status_code const & status);
 
 
-[section:characters_left_ cgi_service_impl_base::implementation_type::characters_left_]
+[section:overload1 common::basic_request::status (1 of 4 overloads)]
 
-[indexterm2 characters_left_..cgi_service_impl_base::implementation_type]
+Get / Set the status of a request.
 
- std::size_t characters_left_;
+ common::request_status status() const;
 
 
+The usual way to set the request status is to set it when calling `close`.
+
 
 [endsect]
 
 
 
-[section:client_ cgi_service_impl_base::implementation_type::client_]
+[section:overload2 common::basic_request::status (2 of 4 overloads)]
 
-[indexterm2 client_..cgi_service_impl_base::implementation_type]
 
- client_type client_;
+
+ void status(
+ common::request_status const & status);
 
 
 
@@ -4618,12 +4763,12 @@
 
 
 
-[section:client_type cgi_service_impl_base::implementation_type::client_type]
+[section:overload3 common::basic_request::status (3 of 4 overloads)]
 
-[indexterm2 client_type..cgi_service_impl_base::implementation_type]
 
- typedef RequestImplType::client_type client_type;
 
+ common::http::status_code status(
+ common::http::status_code const & status) const;
 
 
 
@@ -4631,116 +4776,52 @@
 
 
 
-[section:form_parser_type cgi_service_impl_base::implementation_type::form_parser_type]
+[section:overload4 common::basic_request::status (4 of 4 overloads)]
 
-[indexterm2 form_parser_type..cgi_service_impl_base::implementation_type]
 
- typedef detail::form_parser form_parser_type;
 
+ void status(
+ common::http::status_code const & status);
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link cgi.reference.detail__form_parser.buffer_type [*buffer_type]]]
- []
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.detail__form_parser.callback_type [*callback_type]]]
- [The callback functor to read more data. ]
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.detail__form_parser__context [*context]]]
- [The context used for parsing. ]
-
- ]
+[section:string_type common::basic_request::string_type]
 
- [
+[indexterm2 string_type..common::basic_request]
 
- [[link cgi.reference.detail__form_parser.map_type [*map_type]]]
- []
-
- ]
+ typedef traits::string_type string_type;
 
- [
 
- [[link cgi.reference.detail__form_parser.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.detail__form_parser.string_type [*string_type]]]
- []
-
- ]
+[endsect]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.detail__form_parser.buffer_string [*buffer_string]]]
- []
- ]
-
- [
- [[link cgi.reference.detail__form_parser.form_parser [*form_parser]]]
- []
- ]
-
- [
- [[link cgi.reference.detail__form_parser.move_to_start_of_first_part [*move_to_start_of_first_part]]]
- [Erase any front-cruft on the form data. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse [*parse]]]
- [Run the parser on the given `context`. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_boundary_marker [*parse_boundary_marker]]]
- [Get the boundary marker from the CONTENT_TYPE header. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_form_part [*parse_form_part]]]
- [Parse a single form part. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_multipart_form [*parse_multipart_form]]]
- [Parse a multipart form. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_url_encoded_form [*parse_url_encoded_form]]]
- [URL-encoded forms. ]
- ]
-
-]
+[section:traits common::basic_request::traits]
 
-Construct this and then call `form\_parserparse` with an instance of form_parser::context (or compatible struct).
+[indexterm2 traits..common::basic_request]
 
-This is minimal and doesn't extract all meta-data yet, but is known to work on Windows XP with MSVC9.0 and Ubuntu linux with gcc 4.2.x and 4.3.x.
+ typedef detail::protocol_traits< protocol_type > traits;
 
-Valid Form Encodings > `application/x-www-form-urlencoded` > `multipart/form-data`
 
-File uploads (ie. in `multipart/form-data` forms) are saved to disk. See the `BOOST\_CGI\_UPLOAD\_DIRECTORY` macro.
 
-Should also work for HTTP POST data.
+
+[endsect]
+
+
+
+[section:uploads common::basic_request::uploads]
+
+[indexterm2 uploads..common::basic_request]
+
+ common::data_map_proxy< upload_map > uploads;
 
 
 
@@ -4748,11 +4829,11 @@
 
 
 
-[section:fp_ cgi_service_impl_base::implementation_type::fp_]
+[section:uri common::basic_request::uri]
 
-[indexterm2 fp_..cgi_service_impl_base::implementation_type]
+[indexterm2 uri..common::basic_request] Get the URI of the request.
 
- boost::scoped_ptr< form_parser_type > fp_;
+ string_type & uri();
 
 
 
@@ -4760,11 +4841,11 @@
 
 
 
-[section:implementation_type cgi_service_impl_base::implementation_type::implementation_type]
+[section:_basic_request common::basic_request::~basic_request]
 
-[indexterm2 implementation_type..cgi_service_impl_base::implementation_type]
+[indexterm2 ~basic_request..common::basic_request]
 
- implementation_type();
+ ~basic_request();
 
 
 
@@ -4774,14 +4855,13 @@
 
 [endsect]
 
-[section:common__basic_client common::basic_client]
+[section:common__basic_request_acceptor common::basic_request_acceptor]
 
-A client.
+The interface class for any *BOOST_CGI_NAMESPACEacceptor.
 
   template<
- typename Connection ,
- typename Protocol >
- class basic_client
+ typename RequestAcceptorService >
+ class basic_request_acceptor
 
 
 [heading Types]
@@ -4790,21 +4870,56 @@
 
   [
 
- [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
+ [[link cgi.reference.common__basic_request_acceptor.accept_handler_type [*accept_handler_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
+ [[link cgi.reference.common__basic_request_acceptor.endpoint_type [*endpoint_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_request_acceptor.native_type [*native_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_request_acceptor.next_layer_type [*next_layer_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_request_acceptor.port_number_type [*port_number_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_request_acceptor.protocol_service_type [*protocol_service_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_request_acceptor.protocol_type [*protocol_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__basic_request_acceptor.service_type [*service_type]]]
     []
   
   ]
@@ -4816,125 +4931,132 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
- [Asynchronously read some data from the client. ]
+ [[link cgi.reference.common__basic_request_acceptor.accept [*accept]]]
+ [Accept one request and handle it with `handler`. ]
   ]
   
   [
- [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
- [Asynchronously write some data to the client. ]
+ [[link cgi.reference.common__basic_request_acceptor.assign [*assign]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
+ [[link cgi.reference.common__basic_request_acceptor.async_accept [*async_accept]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
+ [[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor [*basic_request_acceptor]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_client.close [*close]]]
+ [[link cgi.reference.common__basic_request_acceptor.bind [*bind]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_client.connection [*connection]]]
- [Get a shared_ptr of the connection associated with the client. ]
+ [[link cgi.reference.common__basic_request_acceptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
   ]
   
   [
- [[link cgi.reference.common__basic_client.is_open [*is_open]]]
+ [[link cgi.reference.common__basic_request_acceptor.close [*close]]]
+ [Close the acceptor. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request_acceptor.is_cgi [*is_cgi]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_client.read_some [*read_some]]]
- [Read some data from the client. ]
+ [[link cgi.reference.common__basic_request_acceptor.is_open [*is_open]]]
+ [Check if the acceptor is open. ]
   ]
   
   [
- [[link cgi.reference.common__basic_client.request_id [*request_id]]]
+ [[link cgi.reference.common__basic_request_acceptor.listen [*listen]]]
+ [Set the acceptor to listen. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request_acceptor.local_endpoint [*local_endpoint]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
- [Associate a connection with this client. ]
+ [[link cgi.reference.common__basic_request_acceptor.native [*native]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_client.write_some [*write_some]]]
- [Write some data to the client. ]
+ [[link cgi.reference.common__basic_request_acceptor.open [*open]]]
+ [Open the acceptor. ]
   ]
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
+ [[link cgi.reference.common__basic_request_acceptor.protocol_service [*protocol_service]]]
     []
   ]
-
+
+ [
+ [[link cgi.reference.common__basic_request_acceptor._basic_request_acceptor [*~basic_request_acceptor]]]
+ []
+ ]
+
 ]
 
-A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
+[section:accept common::basic_request_acceptor::accept]
 
+[indexterm2 accept..common::basic_request_acceptor] Accept one request and handle it with `handler`.
 
-[section:async_read_some common::basic_client::async_read_some]
+ int ``[link cgi.reference.common__basic_request_acceptor.accept.overload1 accept]``(
+ accept_handler_type handler);
 
-[indexterm2 async_read_some..common::basic_client] Asynchronously read some data from the client.
+ int ``[link cgi.reference.common__basic_request_acceptor.accept.overload2 accept]``(
+ accept_handler_type handler,
+ boost::system::error_code & ec);
 
   template<
- typename MutableBufferSequence ,
- typename Handler >
- void async_read_some(
- const MutableBufferSequence & buf,
- Handler handler);
-
-
-
-[endsect]
-
-
-
-[section:async_write_some common::basic_client::async_write_some]
+ typename CommonGatewayRequest >
+ void ``[link cgi.reference.common__basic_request_acceptor.accept.overload3 accept]``(
+ CommonGatewayRequest & request);
 
-[indexterm2 async_write_some..common::basic_client] Asynchronously write some data to the client.
+ template<
+ typename CommonGatewayRequest >
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.accept.overload4 accept]``(
+ CommonGatewayRequest & request,
+ boost::system::error_code & ec);
 
   template<
- typename ConstBufferSequence ,
- typename Handler >
- void async_write_some(
- const ConstBufferSequence & buf,
- Handler handler);
+ typename CommonGatewayRequest >
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.accept.overload5 accept]``(
+ CommonGatewayRequest & request,
+ endpoint_type & ep,
+ boost::system::error_code & ec);
 
 
+[section:overload1 common::basic_request_acceptor::accept (1 of 5 overloads)]
 
-[endsect]
+Accept one request and handle it with `handler`.
 
+ int accept(
+ accept_handler_type handler);
 
-[section:basic_client common::basic_client::basic_client]
 
-[indexterm2 basic_client..common::basic_client]
 
- ``[link cgi.reference.common__basic_client.basic_client.overload1 basic_client]``(
- io_service & ios);
+[endsect]
 
- ``[link cgi.reference.common__basic_client.basic_client.overload2 basic_client]``();
 
 
-[section:overload1 common::basic_client::basic_client (1 of 2 overloads)]
+[section:overload2 common::basic_request_acceptor::accept (2 of 5 overloads)]
 
 
 
- basic_client(
- io_service & ios);
+ int accept(
+ accept_handler_type handler,
+ boost::system::error_code & ec);
 
 
 
@@ -4942,25 +5064,30 @@
 
 
 
-[section:overload2 common::basic_client::basic_client (2 of 2 overloads)]
+[section:overload3 common::basic_request_acceptor::accept (3 of 5 overloads)]
 
 
 
- basic_client();
+ template<
+ typename CommonGatewayRequest >
+ void accept(
+ CommonGatewayRequest & request);
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:bytes_left common::basic_client::bytes_left]
+[section:overload4 common::basic_request_acceptor::accept (4 of 5 overloads)]
 
-[indexterm2 bytes_left..common::basic_client]
+Accept one request.
 
- std::size_t & bytes_left();
+ template<
+ typename CommonGatewayRequest >
+ boost::system::error_code accept(
+ CommonGatewayRequest & request,
+ boost::system::error_code & ec);
 
 
 
@@ -4968,48 +5095,64 @@
 
 
 
-[section:bytes_left_ common::basic_client::bytes_left_]
-
-[indexterm2 bytes_left_..common::basic_client]
+[section:overload5 common::basic_request_acceptor::accept (5 of 5 overloads)]
 
- std::size_t bytes_left_;
 
 
+ template<
+ typename CommonGatewayRequest >
+ boost::system::error_code accept(
+ CommonGatewayRequest & request,
+ endpoint_type & ep,
+ boost::system::error_code & ec);
 
-[endsect]
 
 
+[endsect]
 
-[section:close common::basic_client::close]
 
-[indexterm2 close..common::basic_client]
+[endsect]
 
- void close();
 
+[section:accept_handler_type common::basic_request_acceptor::accept_handler_type]
 
+[indexterm2 accept_handler_type..common::basic_request_acceptor]
 
-[endsect]
+ typedef service_type::accept_handler_type accept_handler_type;
 
 
 
-[section:connection common::basic_client::connection]
 
-[indexterm2 connection..common::basic_client] Get a shared_ptr of the connection associated with the client.
+[endsect]
 
- connection_ptr & connection();
 
+[section:assign common::basic_request_acceptor::assign]
 
+[indexterm2 assign..common::basic_request_acceptor]
 
-[endsect]
+ template<
+ typename Protocol >
+ void ``[link cgi.reference.common__basic_request_acceptor.assign.overload1 assign]``(
+ Protocol protocol,
+ const native_type & native_acceptor);
 
+ template<
+ typename Protocol >
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.assign.overload2 assign]``(
+ Protocol protocol,
+ const native_type & native_acceptor,
+ boost::system::error_code & ec);
 
 
-[section:connection_ptr common::basic_client::connection_ptr]
+[section:overload1 common::basic_request_acceptor::assign (1 of 2 overloads)]
 
-[indexterm2 connection_ptr..common::basic_client]
 
- typedef connection_type::pointer connection_ptr;
 
+ template<
+ typename Protocol >
+ void assign(
+ Protocol protocol,
+ const native_type & native_acceptor);
 
 
 
@@ -5017,37 +5160,45 @@
 
 
 
-[section:connection_type common::basic_client::connection_type]
+[section:overload2 common::basic_request_acceptor::assign (2 of 2 overloads)]
 
-[indexterm2 connection_type..common::basic_client]
 
- typedef Connection connection_type;
 
+ template<
+ typename Protocol >
+ boost::system::error_code assign(
+ Protocol protocol,
+ const native_type & native_acceptor,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:is_open common::basic_client::is_open]
-
-[indexterm2 is_open..common::basic_client]
-
- bool is_open();
-
+[section:async_accept common::basic_request_acceptor::async_accept]
 
+[indexterm2 async_accept..common::basic_request_acceptor]
 
-[endsect]
+ void ``[link cgi.reference.common__basic_request_acceptor.async_accept.overload1 async_accept]``(
+ accept_handler_type handler);
 
+ template<
+ typename CommonGatewayRequest ,
+ typename Handler >
+ void ``[link cgi.reference.common__basic_request_acceptor.async_accept.overload2 async_accept]``(
+ CommonGatewayRequest & request,
+ Handler handler);
 
 
-[section:protocol_type common::basic_client::protocol_type]
+[section:overload1 common::basic_request_acceptor::async_accept (1 of 2 overloads)]
 
-[indexterm2 protocol_type..common::basic_client]
 
- typedef Protocol protocol_type;
 
+ void async_accept(
+ accept_handler_type handler);
 
 
 
@@ -5055,60 +5206,60 @@
 
 
 
-[section:read_some common::basic_client::read_some]
+[section:overload2 common::basic_request_acceptor::async_accept (2 of 2 overloads)]
 
-[indexterm2 read_some..common::basic_client] Read some data from the client.
+Asynchronously accept one request.
 
   template<
- typename MutableBufferSequence >
- std::size_t read_some(
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
+ typename CommonGatewayRequest ,
+ typename Handler >
+ void async_accept(
+ CommonGatewayRequest & request,
+ Handler handler);
 
 
 
 [endsect]
 
 
-
-[section:request_id common::basic_client::request_id]
-
-[indexterm2 request_id..common::basic_client]
-
- boost::uint16_t const & request_id() const;
-
-
-
 [endsect]
 
+[section:basic_request_acceptor common::basic_request_acceptor::basic_request_acceptor]
 
+[indexterm2 basic_request_acceptor..common::basic_request_acceptor]
 
-[section:set_connection common::basic_client::set_connection]
-
-[indexterm2 set_connection..common::basic_client] Associate a connection with this client.
-
- bool set_connection(
- const typename connection_type::pointer & conn);
-
-
-Note: the connection must have been created using the new operator
-
-bool set\_connection(connection\_type* conn) { make sure there isn't already a connection associated with the client if (!connection\_) return false; connection\_.reset(conn); return true; } Associate a connection with this client Note: the connection must have been created using the new operator
+ template<
+ typename IoServiceProvider >
+ ``[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor.overload1 basic_request_acceptor]``(
+ common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
+ port_number_type port_num = 0);
 
+ template<
+ typename IoServiceProvider ,
+ typename InternetProtocol >
+ ``[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor.overload2 basic_request_acceptor]``(
+ common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
+ const boost::asio::ip::basic_endpoint< InternetProtocol > & endpoint,
+ bool reuse_addr = true);
 
-[endsect]
+ template<
+ typename IoServiceProvider ,
+ typename InternetProtocol >
+ ``[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor.overload3 basic_request_acceptor]``(
+ common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
+ const InternetProtocol & ip,
+ const native_type & native_acceptor);
 
 
+[section:overload1 common::basic_request_acceptor::basic_request_acceptor (1 of 3 overloads)]
 
-[section:write_some common::basic_client::write_some]
 
-[indexterm2 write_some..common::basic_client] Write some data to the client.
 
   template<
- typename ConstBufferSequence >
- std::size_t write_some(
- const ConstBufferSequence & buf,
- boost::system::error_code & ec);
+ typename IoServiceProvider >
+ basic_request_acceptor(
+ common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
+ port_number_type port_num = 0);
 
 
 
@@ -5116,266 +5267,118 @@
 
 
 
-[endsect]
+[section:overload2 common::basic_request_acceptor::basic_request_acceptor (2 of 3 overloads)]
 
-[section:common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_ common::basic_client< connections::shareable_tcp, Protocol >]
 
-A client that uses a TCP socket that owned by it.
 
   template<
- typename Protocol >
- class basic_client< connections::shareable_tcp, Protocol >
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.connection_ptr [*connection_ptr]]]
- []
-
- ]
-
- [
+ typename IoServiceProvider ,
+ typename InternetProtocol >
+ basic_request_acceptor(
+ common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
+ const boost::asio::ip::basic_endpoint< InternetProtocol > & endpoint,
+ bool reuse_addr = true);
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.connection_type [*connection_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.header_buffer_type [*header_buffer_type]]]
- []
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.io_service_type [*io_service_type]]]
- []
-
- ]
 
- [
+[section:overload3 common::basic_request_acceptor::basic_request_acceptor (3 of 3 overloads)]
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.map_type [*map_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
+ template<
+ typename IoServiceProvider ,
+ typename InternetProtocol >
+ basic_request_acceptor(
+ common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
+ const InternetProtocol & ip,
+ const native_type & native_acceptor);
 
- [
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.protocol_type [*protocol_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.role_type [*role_type]]]
- []
-
- ]
 
-]
+[endsect]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:bind common::basic_request_acceptor::bind]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.async_read_some [*async_read_some]]]
- [Asynchronously read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.async_write_some [*async_write_some]]]
- [Asynchronously write some data to the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.basic_client [*basic_client]]]
- [Construct. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.bytes_left [*bytes_left]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.connection [*connection]]]
- [Get a shared_ptr of the connection associated with the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.construct [*construct]]]
- [Construct the client by claiming a request id. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.keep_connection [*keep_connection]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.read_some [*read_some]]]
- [Read data into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.set_connection [*set_connection]]]
- [Associate a connection with this client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.status [*status]]]
- [Set the status of the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.write_some [*write_some]]]
- [Write some data to the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_._basic_client [*~basic_client]]]
- [Destroy. ]
- ]
-
-]
+[indexterm2 bind..common::basic_request_acceptor]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+ template<
+ typename Endpoint >
+ void ``[link cgi.reference.common__basic_request_acceptor.bind.overload1 bind]``(
+ Endpoint & ep);
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.bytes_left_ [*bytes_left_]]]
- []
- ]
+ template<
+ typename Endpoint >
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.bind.overload2 bind]``(
+ Endpoint & ep,
+ boost::system::error_code & ec);
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.connection_ [*connection_]]]
- []
- ]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.header_ [*header_]]]
- [Buffer used to check the header of each packet. ]
- ]
+[section:overload1 common::basic_request_acceptor::bind (1 of 2 overloads)]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.keep_connection_ [*keep_connection_]]]
- []
- ]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.outbuf_ [*outbuf_]]]
- [Output buffer. ]
- ]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.request_id_ [*request_id_]]]
- []
- ]
+ template<
+ typename Endpoint >
+ void bind(
+ Endpoint & ep);
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.role_ [*role_]]]
- []
- ]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.status_ [*status_]]]
- []
- ]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.total_sent_bytes_ [*total_sent_bytes_]]]
- []
- ]
+[endsect]
 
- [
- [[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.total_sent_packets_ [*total_sent_packets_]]]
- []
- ]
 
-]
 
+[section:overload2 common::basic_request_acceptor::bind (2 of 2 overloads)]
 
-[section:async_read_some common::basic_client< connections::shareable_tcp, Protocol >::async_read_some]
 
-[indexterm2 async_read_some..common::basic_client< connections::shareable_tcp, Protocol >] Asynchronously read some data from the client.
 
   template<
- typename MutableBufferSequence ,
- typename Handler >
- void async_read_some(
- const MutableBufferSequence & buf,
- Handler handler);
+ typename Endpoint >
+ boost::system::error_code bind(
+ Endpoint & ep,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:async_write_some common::basic_client< connections::shareable_tcp, Protocol >::async_write_some]
 
-[indexterm2 async_write_some..common::basic_client< connections::shareable_tcp, Protocol >] Asynchronously write some data to the client.
+[section:cancel common::basic_request_acceptor::cancel]
 
- template<
- typename ConstBufferSequence ,
- typename Handler >
- void async_write_some(
- const ConstBufferSequence & buf,
- Handler handler);
+[indexterm2 cancel..common::basic_request_acceptor] Cancel all asynchronous operations associated with the acceptor.
+
+ boost::system::error_code cancel();
 
 
 
 [endsect]
 
 
-[section:basic_client common::basic_client< connections::shareable_tcp, Protocol >::basic_client]
+[section:close common::basic_request_acceptor::close]
 
-[indexterm2 basic_client..common::basic_client< connections::shareable_tcp, Protocol >] Construct.
+[indexterm2 close..common::basic_request_acceptor] Close the acceptor.
 
- ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.basic_client.overload1 basic_client]``(
- io_service_type & ios);
+ void ``[link cgi.reference.common__basic_request_acceptor.close.overload1 close]``();
 
- ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.basic_client.overload2 basic_client]``();
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.close.overload2 close]``(
+ boost::system::error_code & ec);
 
 
-[section:overload1 common::basic_client< connections::shareable_tcp, Protocol >::basic_client (1 of 2 overloads)]
+[section:overload1 common::basic_request_acceptor::close (1 of 2 overloads)]
 
-Construct.
+Close the acceptor.
 
- basic_client(
- io_service_type & ios);
+ void close();
 
 
 
@@ -5383,11 +5386,12 @@
 
 
 
-[section:overload2 common::basic_client< connections::shareable_tcp, Protocol >::basic_client (2 of 2 overloads)]
+[section:overload2 common::basic_request_acceptor::close (2 of 2 overloads)]
 
-Construct.
+Close the acceptor.
 
- basic_client();
+ boost::system::error_code close(
+ boost::system::error_code & ec);
 
 
 
@@ -5397,11 +5401,12 @@
 [endsect]
 
 
-[section:bytes_left common::basic_client< connections::shareable_tcp, Protocol >::bytes_left]
+[section:endpoint_type common::basic_request_acceptor::endpoint_type]
+
+[indexterm2 endpoint_type..common::basic_request_acceptor]
 
-[indexterm2 bytes_left..common::basic_client< connections::shareable_tcp, Protocol >]
+ typedef service_type::endpoint_type endpoint_type;
 
- std::size_t & bytes_left();
 
 
 
@@ -5409,101 +5414,47 @@
 
 
 
-[section:bytes_left_ common::basic_client< connections::shareable_tcp, Protocol >::bytes_left_]
+[section:is_cgi common::basic_request_acceptor::is_cgi]
 
-[indexterm2 bytes_left_..common::basic_client< connections::shareable_tcp, Protocol >]
+[indexterm2 is_cgi..common::basic_request_acceptor]
 
- std::size_t bytes_left_;
+ bool is_cgi();
 
 
 
 [endsect]
 
 
-[section:close common::basic_client< connections::shareable_tcp, Protocol >::close]
 
-[indexterm2 close..common::basic_client< connections::shareable_tcp, Protocol >]
+[section:is_open common::basic_request_acceptor::is_open]
 
- boost::system::error_code ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.close.overload1 close]``(
- boost::uint64_t app_status,
- boost::system::error_code & ec);
+[indexterm2 is_open..common::basic_request_acceptor] Check if the acceptor is open.
 
- void ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.close.overload2 close]``(
- boost::uint64_t app_status = 0);
+ bool is_open();
 
 
-[section:overload1 common::basic_client< connections::shareable_tcp, Protocol >::close (1 of 2 overloads)]
 
+[endsect]
 
 
- boost::system::error_code close(
- boost::uint64_t app_status,
- boost::system::error_code & ec);
+[section:listen common::basic_request_acceptor::listen]
 
+[indexterm2 listen..common::basic_request_acceptor] Set the acceptor to listen.
 
+ void ``[link cgi.reference.common__basic_request_acceptor.listen.overload1 listen]``(
+ int backlog = boost::asio::socket_base::max_connections);
 
-[endsect]
-
-
-
-[section:overload2 common::basic_client< connections::shareable_tcp, Protocol >::close (2 of 2 overloads)]
-
-
-
- void close(
- boost::uint64_t app_status = 0);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:connection common::basic_client< connections::shareable_tcp, Protocol >::connection]
-
-[indexterm2 connection..common::basic_client< connections::shareable_tcp, Protocol >] Get a shared_ptr of the connection associated with the client.
-
- connection_type::pointer & connection();
-
-
-
-[endsect]
-
-
-
-[section:connection_ common::basic_client< connections::shareable_tcp, Protocol >::connection_]
-
-[indexterm2 connection_..common::basic_client< connections::shareable_tcp, Protocol >]
-
- connection_ptr connection_;
-
-
-
-[endsect]
-
-
-
-[section:connection_ptr common::basic_client< connections::shareable_tcp, Protocol >::connection_ptr]
-
-[indexterm2 connection_ptr..common::basic_client< connections::shareable_tcp, Protocol >]
-
- typedef connection_type::pointer connection_ptr;
-
-
-
-
-[endsect]
-
-
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.listen.overload2 listen]``(
+ int backlog,
+ boost::system::error_code & ec);
 
-[section:connection_type common::basic_client< connections::shareable_tcp, Protocol >::connection_type]
 
-[indexterm2 connection_type..common::basic_client< connections::shareable_tcp, Protocol >]
+[section:overload1 common::basic_request_acceptor::listen (1 of 2 overloads)]
 
- typedef connections::shareable_tcp connection_type;
+Set the acceptor to listen.
 
+ void listen(
+ int backlog = boost::asio::socket_base::max_connections);
 
 
 
@@ -5511,55 +5462,36 @@
 
 
 
-[section:construct common::basic_client< connections::shareable_tcp, Protocol >::construct]
+[section:overload2 common::basic_request_acceptor::listen (2 of 2 overloads)]
 
-[indexterm2 construct..common::basic_client< connections::shareable_tcp, Protocol >] Construct the client by claiming a request id.
+Set the acceptor to listen.
 
- template<
- typename RequestImpl >
- boost::system::error_code construct(
- RequestImpl & req,
+ boost::system::error_code listen(
+ int backlog,
       boost::system::error_code & ec);
 
 
-Before loading a request, it will usually not have a request id. This function reads headers (and corresponding bodies if necessary) until a BEGIN\_REQUEST record is found. The calling request then claims and serves that request.
-
 
 [endsect]
 
 
-
-[section:header_ common::basic_client< connections::shareable_tcp, Protocol >::header_]
-
-[indexterm2 header_..common::basic_client< connections::shareable_tcp, Protocol >] Buffer used to check the header of each packet.
-
- fcgi::spec::header header_;
-
-
-
 [endsect]
 
+[section:local_endpoint common::basic_request_acceptor::local_endpoint]
 
+[indexterm2 local_endpoint..common::basic_request_acceptor]
 
-[section:header_buffer_type common::basic_client< connections::shareable_tcp, Protocol >::header_buffer_type]
-
-[indexterm2 header_buffer_type..common::basic_client< connections::shareable_tcp, Protocol >]
-
- typedef boost::array< unsigned char, fcgi::spec::header_length::value > header_buffer_type;
-
-
-
-
-[endsect]
+ endpoint_type ``[link cgi.reference.common__basic_request_acceptor.local_endpoint.overload1 local_endpoint]``();
 
+ endpoint_type ``[link cgi.reference.common__basic_request_acceptor.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
 
 
-[section:io_service_type common::basic_client< connections::shareable_tcp, Protocol >::io_service_type]
+[section:overload1 common::basic_request_acceptor::local_endpoint (1 of 2 overloads)]
 
-[indexterm2 io_service_type..common::basic_client< connections::shareable_tcp, Protocol >]
 
- typedef ::cgi::common::io_service io_service_type;
 
+ endpoint_type local_endpoint();
 
 
 
@@ -5567,48 +5499,26 @@
 
 
 
-[section:is_open common::basic_client< connections::shareable_tcp, Protocol >::is_open]
-
-[indexterm2 is_open..common::basic_client< connections::shareable_tcp, Protocol >]
-
- bool is_open() const;
-
-
-
-[endsect]
-
-
+[section:overload2 common::basic_request_acceptor::local_endpoint (2 of 2 overloads)]
 
-[section:keep_connection common::basic_client< connections::shareable_tcp, Protocol >::keep_connection]
 
-[indexterm2 keep_connection..common::basic_client< connections::shareable_tcp, Protocol >]
 
- bool keep_connection() const;
+ endpoint_type local_endpoint(
+ boost::system::error_code & ec) const;
 
 
 
 [endsect]
 
 
-
-[section:keep_connection_ common::basic_client< connections::shareable_tcp, Protocol >::keep_connection_]
-
-[indexterm2 keep_connection_..common::basic_client< connections::shareable_tcp, Protocol >]
-
- bool keep_connection_;
-
-
-
 [endsect]
 
 
+[section:native common::basic_request_acceptor::native]
 
-[section:map_type common::basic_client< connections::shareable_tcp, Protocol >::map_type]
-
-[indexterm2 map_type..common::basic_client< connections::shareable_tcp, Protocol >]
-
- typedef ::cgi::common::map map_type;
+[indexterm2 native..common::basic_request_acceptor]
 
+ native_type native();
 
 
 
@@ -5616,24 +5526,12 @@
 
 
 
-[section:mutable_buffers_type common::basic_client< connections::shareable_tcp, Protocol >::mutable_buffers_type]
-
-[indexterm2 mutable_buffers_type..common::basic_client< connections::shareable_tcp, Protocol >]
-
- typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
-
-
-
-
-[endsect]
-
-
+[section:native_type common::basic_request_acceptor::native_type]
 
-[section:outbuf_ common::basic_client< connections::shareable_tcp, Protocol >::outbuf_]
+[indexterm2 native_type..common::basic_request_acceptor]
 
-[indexterm2 outbuf_..common::basic_client< connections::shareable_tcp, Protocol >] Output buffer.
+ typedef service_type::native_type native_type;
 
- std::vector< boost::asio::const_buffer > outbuf_;
 
 
 
@@ -5641,11 +5539,11 @@
 
 
 
-[section:protocol_type common::basic_client< connections::shareable_tcp, Protocol >::protocol_type]
+[section:next_layer_type common::basic_request_acceptor::next_layer_type]
 
-[indexterm2 protocol_type..common::basic_client< connections::shareable_tcp, Protocol >]
+[indexterm2 next_layer_type..common::basic_request_acceptor]
 
- typedef Protocol protocol_type;
+ typedef service_type::acceptor_service_type next_layer_type;
 
 
 
@@ -5653,64 +5551,61 @@
 [endsect]
 
 
+[section:open common::basic_request_acceptor::open]
 
-[section:read_some common::basic_client< connections::shareable_tcp, Protocol >::read_some]
+[indexterm2 open..common::basic_request_acceptor] Open the acceptor.
 
-[indexterm2 read_some..common::basic_client< connections::shareable_tcp, Protocol >] Read data into the supplied buffer.
+ template<
+ typename Protocol >
+ void ``[link cgi.reference.common__basic_request_acceptor.open.overload1 open]``(
+ const Protocol & protocol);
 
   template<
- typename MutableBufferSequence >
- std::size_t read_some(
- const MutableBufferSequence & buf,
+ typename Protocol >
+ boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.open.overload2 open]``(
+ const Protocol & protocol,
       boost::system::error_code & ec);
 
 
-Reads some data that, correctly checking and stripping FastCGI headers.
-
-Returns the number of bytes read and sets `ec` such that `ec` evaluates to `true` iff an error occured during the read operation.
-
-Notable errors:
-* `fcgierror::data_for_another_request`
+[section:overload1 common::basic_request_acceptor::open (1 of 2 overloads)]
 
-* `fcgierror::connection_locked`
+Open the acceptor.
 
+ template<
+ typename Protocol >
+ void open(
+ const Protocol & protocol);
 
-These must be dealt with by user code if they choose to read through the client (reading through the request is recommended).
 
 
 [endsect]
 
 
 
-[section:request_id common::basic_client< connections::shareable_tcp, Protocol >::request_id]
+[section:overload2 common::basic_request_acceptor::open (2 of 2 overloads)]
 
-[indexterm2 request_id..common::basic_client< connections::shareable_tcp, Protocol >]
+Open the acceptor.
 
- boost::uint16_t const & request_id() const;
+ template<
+ typename Protocol >
+ boost::system::error_code open(
+ const Protocol & protocol,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
-
-[section:request_id_ common::basic_client< connections::shareable_tcp, Protocol >::request_id_]
-
-[indexterm2 request_id_..common::basic_client< connections::shareable_tcp, Protocol >]
-
- boost::uint16_t request_id_;
-
-
-
 [endsect]
 
 
+[section:port_number_type common::basic_request_acceptor::port_number_type]
 
-[section:role_ common::basic_client< connections::shareable_tcp, Protocol >::role_]
+[indexterm2 port_number_type..common::basic_request_acceptor]
 
-[indexterm2 role_..common::basic_client< connections::shareable_tcp, Protocol >]
+ typedef service_type::implementation_type::port_number_type port_number_type;
 
- role_type role_;
 
 
 
@@ -5718,35 +5613,24 @@
 
 
 
-[section:role_type common::basic_client< connections::shareable_tcp, Protocol >::role_type]
-
-[indexterm2 role_type..common::basic_client< connections::shareable_tcp, Protocol >]
+[section:protocol_service common::basic_request_acceptor::protocol_service]
 
- typedef fcgi::spec_detail::role_types role_type;
+[indexterm2 protocol_service..common::basic_request_acceptor]
 
+ protocol_service_type & protocol_service() const;
 
 
 
 [endsect]
 
 
-[section:set_connection common::basic_client< connections::shareable_tcp, Protocol >::set_connection]
-
-[indexterm2 set_connection..common::basic_client< connections::shareable_tcp, Protocol >] Associate a connection with this client.
-
- bool ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.set_connection.overload1 set_connection]``(
- const connection_type::pointer & conn);
-
- bool ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.set_connection.overload2 set_connection]``(
- connection_type * conn);
 
+[section:protocol_service_type common::basic_request_acceptor::protocol_service_type]
 
-[section:overload1 common::basic_client< connections::shareable_tcp, Protocol >::set_connection (1 of 2 overloads)]
+[indexterm2 protocol_service_type..common::basic_request_acceptor]
 
-Associate a connection with this client.
+ typedef service_type::protocol_service_type protocol_service_type;
 
- bool set_connection(
- const connection_type::pointer & conn);
 
 
 
@@ -5754,38 +5638,25 @@
 
 
 
-[section:overload2 common::basic_client< connections::shareable_tcp, Protocol >::set_connection (2 of 2 overloads)]
-
-Associate a connection with this client.
-
- bool set_connection(
- connection_type * conn);
+[section:protocol_type common::basic_request_acceptor::protocol_type]
 
+[indexterm2 protocol_type..common::basic_request_acceptor]
 
-Note: the connection must have been created using the new operator
+ typedef service_type::protocol_type protocol_type;
 
 
-[endsect]
 
 
 [endsect]
 
-[section:status common::basic_client< connections::shareable_tcp, Protocol >::status]
 
-[indexterm2 status..common::basic_client< connections::shareable_tcp, Protocol >] Set the status of the client.
-
- void ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.status.overload1 status]``(
- client_status status);
-
- const client_status & ``[link cgi.reference.common__basic_client_lt__connections__shareable_tcp,_Protocol__gt_.status.overload2 status]``() const;
 
+[section:service_type common::basic_request_acceptor::service_type]
 
-[section:overload1 common::basic_client< connections::shareable_tcp, Protocol >::status (1 of 2 overloads)]
+[indexterm2 service_type..common::basic_request_acceptor]
 
-Set the status of the client.
+ typedef RequestAcceptorService service_type;
 
- void status(
- client_status status);
 
 
 
@@ -5793,158 +5664,194 @@
 
 
 
-[section:overload2 common::basic_client< connections::shareable_tcp, Protocol >::status (2 of 2 overloads)]
-
-Get the status of the client.
-
- const client_status & status() const;
+[section:_basic_request_acceptor common::basic_request_acceptor::~basic_request_acceptor]
 
+[indexterm2 ~basic_request_acceptor..common::basic_request_acceptor]
 
+ ~basic_request_acceptor();
 
-[endsect]
 
 
 [endsect]
 
 
-[section:status_ common::basic_client< connections::shareable_tcp, Protocol >::status_]
-
-[indexterm2 status_..common::basic_client< connections::shareable_tcp, Protocol >]
-
- client_status status_;
-
-
 
 [endsect]
 
+[section:common__basic_response common::basic_response]
 
+The response class: a helper for responding to requests.
 
-[section:total_sent_bytes_ common::basic_client< connections::shareable_tcp, Protocol >::total_sent_bytes_]
-
-[indexterm2 total_sent_bytes_..common::basic_client< connections::shareable_tcp, Protocol >]
-
- boost::uint64_t total_sent_bytes_;
-
-
-
-[endsect]
+ template<
+ typename ``[link cgi.reference.CharT CharT]``>
+ class basic_response
 
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[section:total_sent_packets_ common::basic_client< connections::shareable_tcp, Protocol >::total_sent_packets_]
+ [
 
-[indexterm2 total_sent_packets_..common::basic_client< connections::shareable_tcp, Protocol >]
+ [[link cgi.reference.common__basic_response.char_type [*char_type]]]
+ []
+
+ ]
 
- boost::uint64_t total_sent_packets_;
+ [
 
+ [[link cgi.reference.common__basic_response.ostream_type [*ostream_type]]]
+ []
+
+ ]
 
+ [
 
-[endsect]
+ [[link cgi.reference.common__basic_response.self_type [*self_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__basic_response.string_type [*string_type]]]
+ []
+
+ ]
 
-[section:write_some common::basic_client< connections::shareable_tcp, Protocol >::write_some]
+]
 
-[indexterm2 write_some..common::basic_client< connections::shareable_tcp, Protocol >] Write some data to the client.
-
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- const ConstBufferSequence & buf,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:_basic_client common::basic_client< connections::shareable_tcp, Protocol >::~basic_client]
-
-[indexterm2 ~basic_client..common::basic_client< connections::shareable_tcp, Protocol >] Destroy.
-
- ~basic_client();
-
-
-Closing the connection as early as possible is good for efficiency
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__basic_connection_lt__tags__async_stdio__gt_ common::basic_connection< tags::async_stdio >]
-
-
-
- template<>
- class basic_connection< tags::async_stdio > :
- public common::basic_connection< tags::stdio >
-
-
-[heading Types]
-[table
- [[Name][Description]]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
   [
-
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.pointer [*pointer]]]
+ [[link cgi.reference.common__basic_response.async_send [*async_send]]]
+ [Asynchronously send the data through the supplied request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.basic_response [*basic_response]]]
     []
+ ]
   
+ [
+ [[link cgi.reference.common__basic_response.charset [*charset]]]
+ [Get the charset. ]
   ]
-
+
   [
-
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.type [*type]]]
+ [[link cgi.reference.common__basic_response.clear [*clear]]]
+ [Clear the response buffer. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.clear_headers [*clear_headers]]]
     []
+ ]
   
+ [
+ [[link cgi.reference.common__basic_response.content_length [*content_length]]]
+ [Get the length of the body of the response (ie. not including the headers). ]
   ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
+ [
+ [[link cgi.reference.common__basic_response.do_async_send [*do_async_send]]]
+ []
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.async_read_some [*async_read_some]]]
+ [[link cgi.reference.common__basic_response.end_headers [*end_headers]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.async_write_some [*async_write_some]]]
+ [[link cgi.reference.common__basic_response.flush [*flush]]]
+ [Synchronously flush the data to the supplied SyncWriteStream. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.header_value [*header_value]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.basic_connection [*basic_connection]]]
+ [[link cgi.reference.common__basic_response.headers [*headers]]]
+ [Get the headers. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.headers_terminated [*headers_terminated]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.close [*close]]]
+ [[link cgi.reference.common__basic_response.operator_lt__lt_ [*operator<<]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.create [*create]]]
+ [[link cgi.reference.common__basic_response.ostream [*ostream]]]
+ [Get the ostream containing the response body. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.rdbuf [*rdbuf]]]
+ [Get the buffer associated with the stream. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.resend [*resend]]]
+ [Resend headers + content regardless of value of `headers_terminated_`. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.reset [*reset]]]
+ [Return the response to the 'just constructed' state. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.reset_headers [*reset_headers]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.is_open [*is_open]]]
+ [[link cgi.reference.common__basic_response.send [*send]]]
+ [Synchronously send the data via the supplied request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.set [*set]]]
+ [Add a header after appending the CRLF sequence. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.set_header [*set_header]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.read_some [*read_some]]]
+ [[link cgi.reference.common__basic_response.status [*status]]]
+ [Set the status code associated with the response. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.str [*str]]]
+ [Get the contents of the response as a string. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.unterminate_headers [*unterminate_headers]]]
+ [Allow more headers to be added (WARNING: avoid using this). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.write [*write]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.write_some [*write_some]]]
+ [[link cgi.reference.common__basic_response._basic_response [*~basic_response]]]
     []
   ]
   
@@ -5955,40 +5862,74 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.is_open_ [*is_open_]]]
+ [[link cgi.reference.common__basic_response.buffer_ [*buffer_]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.charset_ [*charset_]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.headers_ [*headers_]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.headers_terminated_ [*headers_terminated_]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.http_status_ [*http_status_]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.ostream_ [*ostream_]]]
     []
   ]
 
 ]
 
 
-[section:async_read_some common::basic_connection< tags::async_stdio >::async_read_some]
+[section:async_send common::basic_response::async_send]
 
-[indexterm2 async_read_some..common::basic_connection< tags::async_stdio >]
+[indexterm2 async_send..common::basic_response] Asynchronously send the data through the supplied request.
 
   template<
- typename MutableBufferSequence ,
+ typename AsyncWriteStream ,
       typename Handler >
- void async_read_some(
- const MutableBufferSequence & buf,
+ void async_send(
+ AsyncWriteStream & aws,
       Handler handler);
 
 
+Note: This is quite crude at the moment and not as asynchronous as it could/should be. The data in the stream isn't cleared after this call.
+
 
 [endsect]
 
 
+[section:basic_response common::basic_response::basic_response]
 
-[section:async_write_some common::basic_connection< tags::async_stdio >::async_write_some]
+[indexterm2 basic_response..common::basic_response]
+
+ ``[link cgi.reference.common__basic_response.basic_response.overload1 basic_response]``(
+ common::http::status_code sc = common::http::ok);
+
+ ``[link cgi.reference.common__basic_response.basic_response.overload2 basic_response]``(
+ ::BOOST_CGI_NAMESPACE::common::streambuf * buf,
+ common::http::status_code sc = common::http::ok);
+
+
+[section:overload1 common::basic_response::basic_response (1 of 2 overloads)]
 
-[indexterm2 async_write_some..common::basic_connection< tags::async_stdio >]
 
- template<
- typename ConstBufferSequence ,
- typename Handler >
- void async_write_some(
- const ConstBufferSequence & buf,
- Handler handler);
+
+ basic_response(
+ common::http::status_code sc = common::http::ok);
 
 
 
@@ -5996,61 +5937,76 @@
 
 
 
-[section:basic_connection common::basic_connection< tags::async_stdio >::basic_connection]
+[section:overload2 common::basic_response::basic_response (2 of 2 overloads)]
+
+Construct with a particular buffer.
 
-[indexterm2 basic_connection..common::basic_connection< tags::async_stdio >]
+ basic_response(
+ ::BOOST_CGI_NAMESPACE::common::streambuf * buf,
+ common::http::status_code sc = common::http::ok);
 
- basic_connection(
- common::io_service & ios);
 
+Takes the buffer and uses it internally, does nothing with it on destruction.
 
 
 [endsect]
 
 
+[endsect]
 
-[section:close common::basic_connection< tags::async_stdio >::close]
 
-[indexterm2 close..common::basic_connection< tags::async_stdio >]
+[section:buffer_ common::basic_response::buffer_]
 
- void close();
+[indexterm2 buffer_..common::basic_response]
+
+ boost::shared_ptr< common::streambuf > buffer_;
 
 
 
 [endsect]
 
 
-[section:create common::basic_connection< tags::async_stdio >::create]
 
-[indexterm2 create..common::basic_connection< tags::async_stdio >]
+[section:char_type common::basic_response::char_type]
+
+[indexterm2 char_type..common::basic_response]
+
+ typedef CharT char_type;
 
- static pointer ``[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.create.overload1 create]``();
 
- static pointer ``[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.create.overload2 create]``(
- ::cgi::common::io_service & ios);
 
 
-[section:overload1 common::basic_connection< tags::async_stdio >::create (1 of 2 overloads)]
+[endsect]
 
 
-['Inherited from common::basic_connection< tags::stdio >.]
+[section:charset common::basic_response::charset]
 
+[indexterm2 charset..common::basic_response] Get the charset.
 
+ string_type & ``[link cgi.reference.common__basic_response.charset.overload1 charset]``() const;
 
- static pointer create();
+ void ``[link cgi.reference.common__basic_response.charset.overload2 charset]``(
+ string_type const & cs);
 
 
+[section:overload1 common::basic_response::charset (1 of 2 overloads)]
 
-[endsect]
+Get the charset.
 
+ string_type & charset() const;
 
 
-[section:overload2 common::basic_connection< tags::async_stdio >::create (2 of 2 overloads)]
 
+[endsect]
 
 
- static pointer create(
- ::cgi::common::io_service & ios);
+
+[section:overload2 common::basic_response::charset (2 of 2 overloads)]
+
+Set the charset.
+
+ void charset(
+ string_type const & cs);
 
 
 
@@ -6060,11 +6016,11 @@
 [endsect]
 
 
-[section:is_open common::basic_connection< tags::async_stdio >::is_open]
+[section:charset_ common::basic_response::charset_]
 
-[indexterm2 is_open..common::basic_connection< tags::async_stdio >]
+[indexterm2 charset_..common::basic_response]
 
- bool is_open() const;
+ string_type charset_;
 
 
 
@@ -6072,14 +6028,24 @@
 
 
 
-[section:is_open_ common::basic_connection< tags::async_stdio >::is_open_]
+[section:clear common::basic_response::clear]
+
+[indexterm2 clear..common::basic_response] Clear the response buffer.
+
+ void clear(
+ bool clear_headers = true);
+
+
+
+[endsect]
+
 
 
-['Inherited from common::basic_connection< tags::stdio >.]
+[section:clear_headers common::basic_response::clear_headers]
 
-[indexterm2 is_open_..common::basic_connection< tags::async_stdio >]
+[indexterm2 clear_headers..common::basic_response]
 
- bool is_open_;
+ void clear_headers();
 
 
 
@@ -6087,89 +6053,28 @@
 
 
 
-[section:pointer common::basic_connection< tags::async_stdio >::pointer]
+[section:content_length common::basic_response::content_length]
 
-[indexterm2 pointer..common::basic_connection< tags::async_stdio >]
+[indexterm2 content_length..common::basic_response] Get the length of the body of the response (ie. not including the headers).
 
- typedef boost::shared_ptr< type > pointer;
+ std::size_t content_length();
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.pointer [*pointer]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.type [*type]]]
- []
-
- ]
+[section:do_async_send common::basic_response::do_async_send]
 
-]
+[indexterm2 do_async_send..common::basic_response]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.async_read_some [*async_read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.async_write_some [*async_write_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.basic_connection [*basic_connection]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.create [*create]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.read_some [*read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.write_some [*write_some]]]
- []
- ]
-
-]
-
-[heading Protected Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__async_stdio__gt_.is_open_ [*is_open_]]]
- []
- ]
-
-]
+ template<
+ typename AsyncWriteStream ,
+ typename Handler >
+ void do_async_send(
+ AsyncWriteStream & aws,
+ Handler handler);
 
 
 
@@ -6177,259 +6082,124 @@
 
 
 
-[section:read_some common::basic_connection< tags::async_stdio >::read_some]
+[section:end_headers common::basic_response::end_headers]
 
+[indexterm2 end_headers..common::basic_response]
 
-['Inherited from common::basic_connection< tags::stdio >.]
+ void end_headers();
 
-[indexterm2 read_some..common::basic_connection< tags::async_stdio >]
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence buf,
- boost::system::error_code & ec);
 
+[endsect]
 
 
-[endsect]
+[section:flush common::basic_response::flush]
 
+[indexterm2 flush..common::basic_response] Synchronously flush the data to the supplied SyncWriteStream.
 
+ template<
+ typename SyncWriteStream >
+ void ``[link cgi.reference.common__basic_response.flush.overload1 flush]``(
+ SyncWriteStream & sws);
 
-[section:type common::basic_connection< tags::async_stdio >::type]
+ template<
+ typename SyncWriteStream >
+ boost::system::error_code ``[link cgi.reference.common__basic_response.flush.overload2 flush]``(
+ SyncWriteStream & sws,
+ boost::system::error_code & ec);
 
-[indexterm2 type..common::basic_connection< tags::async_stdio >]
 
- typedef basic_connection< tags::async_stdio > type;
+[section:overload1 common::basic_response::flush (1 of 2 overloads)]
 
+Synchronously flush the data to the supplied SyncWriteStream.
 
+ template<
+ typename SyncWriteStream >
+ void flush(
+ SyncWriteStream & sws);
 
 
-[endsect]
+This call uses throwing semantics. ie. an exception will be thrown on any failure. If there is no error, the buffer is cleared.
 
 
+[endsect]
 
-[section:write_some common::basic_connection< tags::async_stdio >::write_some]
 
 
-['Inherited from common::basic_connection< tags::stdio >.]
+[section:overload2 common::basic_response::flush (2 of 2 overloads)]
 
-[indexterm2 write_some..common::basic_connection< tags::async_stdio >]
+Synchronously flush the data via the supplied request.
 
   template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf,
+ typename SyncWriteStream >
+ boost::system::error_code flush(
+ SyncWriteStream & sws,
       boost::system::error_code & ec);
 
 
+This call uses error\_code semantics. ie. ec is set if an error occurs. If there is no error, the buffer is cleared.
+
 
 [endsect]
 
 
-
 [endsect]
 
-[section:common__basic_connection_lt__tags__shareable_tcp_socket__gt_ common::basic_connection< tags::shareable_tcp_socket >]
 
+[section:header_value common::basic_response::header_value]
 
+[indexterm2 header_value..common::basic_response]
 
- template<>
- class basic_connection< tags::shareable_tcp_socket > :
- public connection_base
+ string_type header_value(
+ string_type const & name);
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt___condition_type [*basic_connection< tags::shareable_tcp_socket >::condition_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.mutex_type [*mutex_type]]]
- []
-
- ]
+[section:headers common::basic_response::headers]
 
- [
+[indexterm2 headers..common::basic_response] Get the headers.
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.next_layer_type [*next_layer_type]]]
- []
-
- ]
+ std::vector< string_type > & headers();
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.pointer [*pointer]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.request_map_type [*request_map_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.request_ptr [*request_ptr]]]
- []
-
- ]
+[section:headers_ common::basic_response::headers_]
 
- [
+[indexterm2 headers_..common::basic_response]
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.request_type [*request_type]]]
- []
-
- ]
+ std::vector< string_type > headers_;
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.request_vector_type [*request_vector_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.scoped_lock_type [*scoped_lock_type]]]
- []
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:headers_terminated common::basic_response::headers_terminated]
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.add_request [*add_request]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.async_read_some [*async_read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.async_write_some [*async_write_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.basic_connection [*basic_connection]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.condition [*condition]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.create [*create]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.get_slot [*get_slot]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.lock [*lock]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.mutex [*mutex]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.next_layer [*next_layer]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.read_some [*read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.unlock [*unlock]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.wait [*wait]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.write_some [*write_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_._basic_connection [*~basic_connection]]]
- []
- ]
-
-]
+[indexterm2 headers_terminated..common::basic_response]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+ bool headers_terminated() const;
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.deletable_request_ids_ [*deletable_request_ids_]]]
- []
- ]
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.request_map_ [*request_map_]]]
- []
- ]
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.requests_ [*requests_]]]
- []
- ]
+[endsect]
 
-]
 
 
-[section:add_request common::basic_connection< tags::shareable_tcp_socket >::add_request]
+[section:headers_terminated_ common::basic_response::headers_terminated_]
 
-[indexterm2 add_request..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 headers_terminated_..common::basic_response]
 
- boost::system::error_code add_request(
- boost::uint16_t id,
- request_type * req,
- bool on_heap,
- boost::system::error_code & ec);
+ bool headers_terminated_;
 
 
 
@@ -6437,60 +6207,63 @@
 
 
 
-[section:async_read_some common::basic_connection< tags::shareable_tcp_socket >::async_read_some]
+[section:http_status_ common::basic_response::http_status_]
 
-[indexterm2 async_read_some..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 http_status_..common::basic_response]
 
- template<
- typename MutableBufferSequence ,
- typename Handler >
- void async_read_some(
- MutableBufferSequence & buf,
- Handler handler);
+ http::status_code http_status_;
 
 
 
 [endsect]
 
 
+[section:operator_lt__lt_ common::basic_response::operator<<]
 
-[section:async_write_some common::basic_connection< tags::shareable_tcp_socket >::async_write_some]
-
-[indexterm2 async_write_some..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 operator<<..common::basic_response]
 
   template<
- typename ConstBufferSequence ,
- typename Handler >
- void async_write_some(
- ConstBufferSequence & buf,
- Handler handler);
+ typename T >
+ self_type & ``[link cgi.reference.common__basic_response.operator_lt__lt_.overload1 operator<<]``(
+ T t);
 
+ self_type & ``[link cgi.reference.common__basic_response.operator_lt__lt_.overload2 operator<<]``(
+ charset_header< char_type > const & hdr);
 
+ self_type & ``[link cgi.reference.common__basic_response.operator_lt__lt_.overload3 operator<<]``(
+ basic_header< char_type > const & hdr);
 
-[endsect]
+ self_type & ``[link cgi.reference.common__basic_response.operator_lt__lt_.overload4 operator<<]``(
+ basic_cookie< char_type > const & ck);
 
+ self_type & ``[link cgi.reference.common__basic_response.operator_lt__lt_.overload5 operator<<]``(
+ http::status_code stat);
 
+ self_type & ``[link cgi.reference.common__basic_response.operator_lt__lt_.overload6 operator<<]``(
+ self_type & other);
 
-[section:basic_connection common::basic_connection< tags::shareable_tcp_socket >::basic_connection]
 
-[indexterm2 basic_connection..common::basic_connection< tags::shareable_tcp_socket >]
+[section:overload1 common::basic_response::operator<< (1 of 6 overloads)]
+
 
- basic_connection(
- io_service & ios);
 
+ template<
+ typename T >
+ self_type & operator<<(
+ T t);
 
-End FastCGI stuff
 
 
 [endsect]
 
 
 
-[section:close common::basic_connection< tags::shareable_tcp_socket >::close]
+[section:overload2 common::basic_response::operator<< (2 of 6 overloads)]
 
-[indexterm2 close..common::basic_connection< tags::shareable_tcp_socket >]
 
- void close();
+
+ self_type & operator<<(
+ charset_header< char_type > const & hdr);
 
 
 
@@ -6498,11 +6271,12 @@
 
 
 
-[section:condition common::basic_connection< tags::shareable_tcp_socket >::condition]
+[section:overload3 common::basic_response::operator<< (3 of 6 overloads)]
 
-[indexterm2 condition..common::basic_connection< tags::shareable_tcp_socket >]
 
- condition_type & condition();
+
+ self_type & operator<<(
+ basic_header< char_type > const & hdr);
 
 
 
@@ -6510,12 +6284,12 @@
 
 
 
-[section:create common::basic_connection< tags::shareable_tcp_socket >::create]
+[section:overload4 common::basic_response::operator<< (4 of 6 overloads)]
 
-[indexterm2 create..common::basic_connection< tags::shareable_tcp_socket >]
 
- static pointer create(
- io_service & ios);
+
+ self_type & operator<<(
+ basic_cookie< char_type > const & ck);
 
 
 
@@ -6523,11 +6297,12 @@
 
 
 
-[section:deletable_request_ids_ common::basic_connection< tags::shareable_tcp_socket >::deletable_request_ids_]
+[section:overload5 common::basic_response::operator<< (5 of 6 overloads)]
 
-[indexterm2 deletable_request_ids_..common::basic_connection< tags::shareable_tcp_socket >]
 
- std::set< int > deletable_request_ids_;
+
+ self_type & operator<<(
+ http::status_code stat);
 
 
 
@@ -6535,25 +6310,26 @@
 
 
 
-[section:get_slot common::basic_connection< tags::shareable_tcp_socket >::get_slot]
+[section:overload6 common::basic_response::operator<< (6 of 6 overloads)]
 
-[indexterm2 get_slot..common::basic_connection< tags::shareable_tcp_socket >]
 
- boost::system::error_code get_slot(
- boost::uint16_t id,
- boost::system::error_code & ec);
+
+ self_type & operator<<(
+ self_type & other);
 
 
 
 [endsect]
 
 
+[endsect]
+
 
-[section:is_open common::basic_connection< tags::shareable_tcp_socket >::is_open]
+[section:ostream common::basic_response::ostream]
 
-[indexterm2 is_open..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 ostream..common::basic_response] Get the ostream containing the response body.
 
- bool is_open() const;
+ ostream_type & ostream();
 
 
 
@@ -6561,11 +6337,11 @@
 
 
 
-[section:lock common::basic_connection< tags::shareable_tcp_socket >::lock]
+[section:ostream_ common::basic_response::ostream_]
 
-[indexterm2 lock..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 ostream_..common::basic_response]
 
- void lock();
+ ostream_type ostream_;
 
 
 
@@ -6573,24 +6349,24 @@
 
 
 
-[section:mutex common::basic_connection< tags::shareable_tcp_socket >::mutex]
+[section:ostream_type common::basic_response::ostream_type]
 
-[indexterm2 mutex..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 ostream_type..common::basic_response]
 
- mutex_type & mutex();
+ typedef std::basic_ostream< CharT > ostream_type;
 
 
 
-[endsect]
 
+[endsect]
 
 
-[section:mutex_type common::basic_connection< tags::shareable_tcp_socket >::mutex_type]
 
-[indexterm2 mutex_type..common::basic_connection< tags::shareable_tcp_socket >]
+[section:rdbuf common::basic_response::rdbuf]
 
- typedef boost::mutex mutex_type;
+[indexterm2 rdbuf..common::basic_response] Get the buffer associated with the stream.
 
+ common::streambuf * rdbuf();
 
 
 
@@ -6598,11 +6374,14 @@
 
 
 
-[section:next_layer common::basic_connection< tags::shareable_tcp_socket >::next_layer]
+[section:resend common::basic_response::resend]
 
-[indexterm2 next_layer..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 resend..common::basic_response] Resend headers + content regardless of value of `headers_terminated_`.
 
- next_layer_type & next_layer();
+ template<
+ typename SyncWriteStream >
+ void resend(
+ SyncWriteStream & sws);
 
 
 
@@ -6610,12 +6389,11 @@
 
 
 
-[section:next_layer_type common::basic_connection< tags::shareable_tcp_socket >::next_layer_type]
-
-[indexterm2 next_layer_type..common::basic_connection< tags::shareable_tcp_socket >]
+[section:reset common::basic_response::reset]
 
- typedef boost::asio::ip::tcp::socket next_layer_type;
+[indexterm2 reset..common::basic_response] Return the response to the 'just constructed' state.
 
+ void reset();
 
 
 
@@ -6623,153 +6401,344 @@
 
 
 
-[section:pointer common::basic_connection< tags::shareable_tcp_socket >::pointer]
-
-[indexterm2 pointer..common::basic_connection< tags::shareable_tcp_socket >]
+[section:reset_headers common::basic_response::reset_headers]
 
- typedef boost::shared_ptr< basic_connection< tags::shareable_tcp_socket > > pointer;
+[indexterm2 reset_headers..common::basic_response]
 
+ void reset_headers();
 
 
 
 [endsect]
 
 
-[section:read_some common::basic_connection< tags::shareable_tcp_socket >::read_some]
 
-[indexterm2 read_some..common::basic_connection< tags::shareable_tcp_socket >]
+[section:self_type common::basic_response::self_type]
 
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.read_some.overload1 read_some]``(
- MutableBufferSequence & buf,
- boost::system::error_code & ec);
+[indexterm2 self_type..common::basic_response]
+
+ typedef basic_response< CharT > self_type;
 
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.read_some.overload2 read_some]``(
- MutableBufferSequence & buf);
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[section:overload1 common::basic_connection< tags::shareable_tcp_socket >::read_some (1 of 2 overloads)]
+ [
 
+ [[link cgi.reference.common__basic_response.char_type [*char_type]]]
+ []
+
+ ]
 
+ [
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence & buf,
- boost::system::error_code & ec);
+ [[link cgi.reference.common__basic_response.ostream_type [*ostream_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__basic_response.self_type [*self_type]]]
+ []
+
+ ]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__basic_response.string_type [*string_type]]]
+ []
+
+ ]
 
+]
 
-[section:overload2 common::basic_connection< tags::shareable_tcp_socket >::read_some (2 of 2 overloads)]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__basic_response.async_send [*async_send]]]
+ [Asynchronously send the data through the supplied request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.basic_response [*basic_response]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.charset [*charset]]]
+ [Get the charset. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.clear [*clear]]]
+ [Clear the response buffer. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.clear_headers [*clear_headers]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.content_length [*content_length]]]
+ [Get the length of the body of the response (ie. not including the headers). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.do_async_send [*do_async_send]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.end_headers [*end_headers]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.flush [*flush]]]
+ [Synchronously flush the data to the supplied SyncWriteStream. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.header_value [*header_value]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.headers [*headers]]]
+ [Get the headers. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.headers_terminated [*headers_terminated]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.operator_lt__lt_ [*operator<<]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.ostream [*ostream]]]
+ [Get the ostream containing the response body. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.rdbuf [*rdbuf]]]
+ [Get the buffer associated with the stream. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.resend [*resend]]]
+ [Resend headers + content regardless of value of `headers_terminated_`. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.reset [*reset]]]
+ [Return the response to the 'just constructed' state. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.reset_headers [*reset_headers]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.send [*send]]]
+ [Synchronously send the data via the supplied request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.set [*set]]]
+ [Add a header after appending the CRLF sequence. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.set_header [*set_header]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.status [*status]]]
+ [Set the status code associated with the response. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.str [*str]]]
+ [Get the contents of the response as a string. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.unterminate_headers [*unterminate_headers]]]
+ [Allow more headers to be added (WARNING: avoid using this). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response.write [*write]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_response._basic_response [*~basic_response]]]
+ []
+ ]
+
+]
 
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence & buf);
+ [
+ [[link cgi.reference.common__basic_response.buffer_ [*buffer_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_response.charset_ [*charset_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_response.headers_ [*headers_]]]
+ []
+ ]
 
-[endsect]
+ [
+ [[link cgi.reference.common__basic_response.headers_terminated_ [*headers_terminated_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_response.http_status_ [*http_status_]]]
+ []
+ ]
 
-[endsect]
+ [
+ [[link cgi.reference.common__basic_response.ostream_ [*ostream_]]]
+ []
+ ]
 
+]
 
-[section:request_map_ common::basic_connection< tags::shareable_tcp_socket >::request_map_]
 
-[indexterm2 request_map_..common::basic_connection< tags::shareable_tcp_socket >]
 
- request_map_type request_map_;
+[endsect]
 
 
-FastCGI specific stuff
+[section:send common::basic_response::send]
 
+[indexterm2 send..common::basic_response] Synchronously send the data via the supplied request.
 
-[endsect]
+ template<
+ typename SyncWriteStream >
+ void ``[link cgi.reference.common__basic_response.send.overload1 send]``(
+ SyncWriteStream & sws);
 
+ template<
+ typename SyncWriteStream >
+ boost::system::error_code ``[link cgi.reference.common__basic_response.send.overload2 send]``(
+ SyncWriteStream & sws,
+ boost::system::error_code & ec);
 
 
-[section:request_map_type common::basic_connection< tags::shareable_tcp_socket >::request_map_type]
+[section:overload1 common::basic_response::send (1 of 2 overloads)]
 
-[indexterm2 request_map_type..common::basic_connection< tags::shareable_tcp_socket >]
+Synchronously send the data via the supplied request.
 
- typedef std::map< boost::uint16_t, request_type * > request_map_type;
+ template<
+ typename SyncWriteStream >
+ void send(
+ SyncWriteStream & sws);
 
 
+This call uses throwing semantics. ie. an exception will be thrown on any failure. Note: The data in the stream isn't cleared after this call.
 
 
 [endsect]
 
 
 
-[section:request_ptr common::basic_connection< tags::shareable_tcp_socket >::request_ptr]
+[section:overload2 common::basic_response::send (2 of 2 overloads)]
 
-[indexterm2 request_ptr..common::basic_connection< tags::shareable_tcp_socket >]
+Synchronously send the data via the supplied request.
 
- typedef detail::protocol_traits< fcgi_ >::request_ptr request_ptr;
+ template<
+ typename SyncWriteStream >
+ boost::system::error_code send(
+ SyncWriteStream & sws,
+ boost::system::error_code & ec);
 
 
+This call will not throw, but will set `ec` such that `ec == true` if an error occurs. Details of the error are held in the `error\_code` object.
 
 
 [endsect]
 
 
+[endsect]
 
-[section:request_type common::basic_connection< tags::shareable_tcp_socket >::request_type]
+[section:set common::basic_response::set]
 
-[indexterm2 request_type..common::basic_connection< tags::shareable_tcp_socket >]
+[indexterm2 set..common::basic_response] Add a header after appending the CRLF sequence.
 
- typedef detail::protocol_traits< fcgi_ >::request_type request_type;
+ basic_response< char_type > & ``[link cgi.reference.common__basic_response.set.overload1 set]``(
+ basic_header< char_type > const & hdr);
 
+ basic_response< char_type > & ``[link cgi.reference.common__basic_response.set.overload2 set]``(
+ const basic_cookie< char_type > & ck);
 
 
-FastCGI specific stuff
+[section:overload1 common::basic_response::set (1 of 2 overloads)]
 
+Add a header after appending the CRLF sequence.
 
-[endsect]
+ basic_response< char_type > & set(
+ basic_header< char_type > const & hdr);
 
 
 
-[section:request_vector_type common::basic_connection< tags::shareable_tcp_socket >::request_vector_type]
+[endsect]
 
-[indexterm2 request_vector_type..common::basic_connection< tags::shareable_tcp_socket >]
 
- typedef std::vector< request_type * > request_vector_type;
 
+[section:overload2 common::basic_response::set (2 of 2 overloads)]
 
 
 
-[endsect]
+ basic_response< char_type > & set(
+ const basic_cookie< char_type > & ck);
 
 
 
-[section:requests_ common::basic_connection< tags::shareable_tcp_socket >::requests_]
+[endsect]
 
-[indexterm2 requests_..common::basic_connection< tags::shareable_tcp_socket >]
 
- request_vector_type requests_;
+[endsect]
 
+[section:set_header common::basic_response::set_header]
 
+[indexterm2 set_header..common::basic_response]
 
-[endsect]
+ basic_response< char_type > & ``[link cgi.reference.common__basic_response.set_header.overload1 set_header]``(
+ const string_type & value);
 
+ basic_response< char_type > & ``[link cgi.reference.common__basic_response.set_header.overload2 set_header]``(
+ string_type const & name,
+ string_type const & value);
 
 
-[section:scoped_lock_type common::basic_connection< tags::shareable_tcp_socket >::scoped_lock_type]
+[section:overload1 common::basic_response::set_header (1 of 2 overloads)]
 
-[indexterm2 scoped_lock_type..common::basic_connection< tags::shareable_tcp_socket >]
 
- typedef boost::mutex::scoped_lock scoped_lock_type;
 
+ basic_response< char_type > & set_header(
+ const string_type & value);
 
 
 
@@ -6777,83 +6746,121 @@
 
 
 
-[section:unlock common::basic_connection< tags::shareable_tcp_socket >::unlock]
+[section:overload2 common::basic_response::set_header (2 of 2 overloads)]
+
+Format and add a header given name and value, appending CRLF.
+
+ basic_response< char_type > & set_header(
+ string_type const & name,
+ string_type const & value);
 
-[indexterm2 unlock..common::basic_connection< tags::shareable_tcp_socket >]
 
- void unlock();
 
+[endsect]
 
 
 [endsect]
 
+[section:status common::basic_response::status]
+
+[indexterm2 status..common::basic_response] Set the status code associated with the response.
+
+ basic_response< char_type > & ``[link cgi.reference.common__basic_response.status.overload1 status]``(
+ const http::status_code & num);
 
+ http::status_code ``[link cgi.reference.common__basic_response.status.overload2 status]``() const;
 
-[section:wait common::basic_connection< tags::shareable_tcp_socket >::wait]
 
-[indexterm2 wait..common::basic_connection< tags::shareable_tcp_socket >]
+[section:overload1 common::basic_response::status (1 of 2 overloads)]
 
- void wait();
+Set the status code associated with the response.
+
+ basic_response< char_type > & status(
+ const http::status_code & num);
 
 
 
 [endsect]
 
 
-[section:write_some common::basic_connection< tags::shareable_tcp_socket >::write_some]
 
-[indexterm2 write_some..common::basic_connection< tags::shareable_tcp_socket >]
+[section:overload2 common::basic_response::status (2 of 2 overloads)]
 
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.write_some.overload1 write_some]``(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
+Get the status code associated with the response.
 
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt_.write_some.overload2 write_some]``(
- ConstBufferSequence & buf);
+ http::status_code status() const;
 
 
-[section:overload1 common::basic_connection< tags::shareable_tcp_socket >::write_some (1 of 2 overloads)]
 
+[endsect]
 
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
+[endsect]
+
+
+[section:str common::basic_response::str]
+
+[indexterm2 str..common::basic_response] Get the contents of the response as a string.
+
+ string_type str(
+ bool include_header = false) const;
+
 
+This copies the contents of the response into a string. Headers aren't included in the dump unless `include\_header` is true.
 
 
 [endsect]
 
 
 
-[section:overload2 common::basic_connection< tags::shareable_tcp_socket >::write_some (2 of 2 overloads)]
+[section:string_type common::basic_response::string_type]
 
+[indexterm2 string_type..common::basic_response]
 
+ typedef std::basic_string< CharT > string_type;
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf);
 
 
 
 [endsect]
 
 
+
+[section:unterminate_headers common::basic_response::unterminate_headers]
+
+[indexterm2 unterminate_headers..common::basic_response] Allow more headers to be added (WARNING: avoid using this).
+
+ void unterminate_headers();
+
+
+
 [endsect]
 
 
-[section:_basic_connection common::basic_connection< tags::shareable_tcp_socket >::~basic_connection]
+[section:write common::basic_response::write]
+
+[indexterm2 write..common::basic_response]
+
+ std::size_t ``[link cgi.reference.common__basic_response.write.overload1 write]``(
+ const char_type * str,
+ std::size_t len);
+
+ std::size_t ``[link cgi.reference.common__basic_response.write.overload2 write]``(
+ string_type const & str);
+
+ template<
+ typename ConstBufferSequence >
+ std::size_t ``[link cgi.reference.common__basic_response.write.overload3 write]``(
+ const ConstBufferSequence & buf);
+
+
+[section:overload1 common::basic_response::write (1 of 3 overloads)]
+
 
-[indexterm2 ~basic_connection..common::basic_connection< tags::shareable_tcp_socket >]
 
- ~basic_connection();
+ std::size_t write(
+ const char_type * str,
+ std::size_t len);
 
 
 
@@ -6861,35 +6868,41 @@
 
 
 
+[section:overload2 common::basic_response::write (2 of 3 overloads)]
+
+
+
+ std::size_t write(
+ string_type const & str);
+
+
+
 [endsect]
 
-[section:common__basic_connection_lt__tags__shareable_tcp_socket__gt___condition_type common::basic_connection< tags::shareable_tcp_socket >::condition_type]
 
 
+[section:overload3 common::basic_response::write (3 of 3 overloads)]
 
- struct basic_connection< tags::shareable_tcp_socket >::condition_type
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ template<
+ typename ConstBufferSequence >
+ std::size_t write(
+ const ConstBufferSequence & buf);
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__shareable_tcp_socket__gt___condition_type.pointer [*pointer]]]
- []
-
- ]
 
-]
+[endsect]
 
 
-[section:pointer common::basic_connection< tags::shareable_tcp_socket >::condition_type::pointer]
+[endsect]
+
 
-[indexterm2 pointer..common::basic_connection< tags::shareable_tcp_socket >::condition_type]
+[section:_basic_response common::basic_response::~basic_response]
 
- typedef boost::shared_ptr< boost::condition_variable > pointer;
+[indexterm2 ~basic_response..common::basic_response]
 
+ ~basic_response();
 
 
 
@@ -6899,13 +6912,13 @@
 
 [endsect]
 
-[section:common__basic_connection_lt__tags__stderr__gt_ common::basic_connection< tags::stderr >]
+[section:common__charset_header common::charset_header]
 
 
 
- template<>
- class basic_connection< tags::stderr > :
- public connection_base
+ template<
+ typename CharT >
+ struct charset_header
 
 
 [heading Types]
@@ -6914,14 +6927,14 @@
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.pointer [*pointer]]]
+ [[link cgi.reference.common__charset_header.char_type [*char_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.type [*type]]]
+ [[link cgi.reference.common__charset_header.string_type [*string_type]]]
     []
   
   ]
@@ -6933,63 +6946,30 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.async_read_some [*async_read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.async_write_some [*async_write_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.basic_connection [*basic_connection]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.create [*create]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.next_layer [*next_layer]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.read_some [*read_some]]]
+ [[link cgi.reference.common__charset_header.charset_header [*charset_header]]]
     []
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.write_some [*write_some]]]
+ [[link cgi.reference.common__charset_header.content [*content]]]
     []
   ]
-
+
 ]
 
 
-[section:async_read_some common::basic_connection< tags::stderr >::async_read_some]
+[section:char_type common::charset_header::char_type]
 
-[indexterm2 async_read_some..common::basic_connection< tags::stderr >]
+[indexterm2 char_type..common::charset_header]
+
+ typedef CharT char_type;
 
- template<
- typename MutableBufferSequence ,
- typename Handler >
- void async_read_some(
- MutableBufferSequence & buf,
- Handler handler);
 
 
 
@@ -6997,16 +6977,12 @@
 
 
 
-[section:async_write_some common::basic_connection< tags::stderr >::async_write_some]
+[section:charset_header common::charset_header::charset_header]
 
-[indexterm2 async_write_some..common::basic_connection< tags::stderr >]
+[indexterm2 charset_header..common::charset_header]
 
- template<
- typename ConstBufferSequence ,
- typename Handler >
- void async_write_some(
- ConstBufferSequence & buf,
- Handler handler);
+ charset_header(
+ const string_type & _content);
 
 
 
@@ -7014,12 +6990,11 @@
 
 
 
-[section:basic_connection common::basic_connection< tags::stderr >::basic_connection]
+[section:content common::charset_header::content]
 
-[indexterm2 basic_connection..common::basic_connection< tags::stderr >]
+[indexterm2 content..common::charset_header]
 
- basic_connection(
- io_service & ios);
+ string_type content;
 
 
 
@@ -7027,60 +7002,75 @@
 
 
 
-[section:close common::basic_connection< tags::stderr >::close]
-
-[indexterm2 close..common::basic_connection< tags::stderr >]
-
- void close();
-
-
+[section:string_type common::charset_header::string_type]
 
-[endsect]
+[indexterm2 string_type..common::charset_header]
 
+ typedef std::basic_string< CharT > string_type;
 
 
-[section:create common::basic_connection< tags::stderr >::create]
 
-[indexterm2 create..common::basic_connection< tags::stderr >]
 
- static pointer create(
- io_service & ios);
+[endsect]
 
 
 
 [endsect]
 
 
+[section:common__client_status common::client_status]
 
-[section:is_open common::basic_connection< tags::stderr >::is_open]
-
-[indexterm2 is_open..common::basic_connection< tags::stderr >]
+[indexterm1 common::client_status]
 
- bool is_open() const;
+ enum client_status
 
+[heading Values]
+[variablelist
 
+ [
+ [none_]
+ []
+ ]
 
-[endsect]
+ [
+ [constructed]
+ []
+ ]
 
+ [
+ [params_read]
+ []
+ ]
 
+ [
+ [stdin_read]
+ []
+ ]
 
-[section:next_layer common::basic_connection< tags::stderr >::next_layer]
+ [
+ [end_request_sent]
+ []
+ ]
 
-[indexterm2 next_layer..common::basic_connection< tags::stderr >]
+ [
+ [closed_]
+ []
+ ]
 
- next_layer_type & next_layer();
+]
 
 
 
 [endsect]
 
 
+[section:common__data_map_proxy common::data_map_proxy]
 
-[section:pointer common::basic_connection< tags::stderr >::pointer]
+A proxy class to provide access to the data maps as member variables.
 
-[indexterm2 pointer..common::basic_connection< tags::stderr >]
-
- typedef boost::shared_ptr< type > pointer;
+ template<
+ typename ``[link cgi.reference.MapType MapType]``>
+ struct data_map_proxy
 
 
 [heading Types]
@@ -7089,303 +7079,324 @@
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.pointer [*pointer]]]
+ [[link cgi.reference.common__data_map_proxy.allocator_type [*allocator_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.type [*type]]]
+ [[link cgi.reference.common__data_map_proxy.const_iterator [*const_iterator]]]
     []
   
   ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.async_read_some [*async_read_some]]]
+
+ [[link cgi.reference.common__data_map_proxy.const_reverse_iterator [*const_reverse_iterator]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.async_write_some [*async_write_some]]]
+
+ [[link cgi.reference.common__data_map_proxy.iterator [*iterator]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.basic_connection [*basic_connection]]]
+
+ [[link cgi.reference.common__data_map_proxy.key_type [*key_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.close [*close]]]
+
+ [[link cgi.reference.common__data_map_proxy.map_type [*map_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.create [*create]]]
+
+ [[link cgi.reference.common__data_map_proxy.mapped_type [*mapped_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.is_open [*is_open]]]
+
+ [[link cgi.reference.common__data_map_proxy.reverse_iterator [*reverse_iterator]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.next_layer [*next_layer]]]
+
+ [[link cgi.reference.common__data_map_proxy.self_type [*self_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.read_some [*read_some]]]
+
+ [[link cgi.reference.common__data_map_proxy.size_type [*size_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.write_some [*write_some]]]
+
+ [[link cgi.reference.common__data_map_proxy.value_type [*value_type]]]
     []
- ]
   
+ ]
+
 ]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__data_map_proxy.as [*as]]]
+ [Get a value for the key as a specified type, with fallback. ]
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.begin [*begin]]]
+ [Map iterators. ]
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.clear [*clear]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.count [*count]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.empty [*empty]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.end [*end]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.operator_map_type_& [*operator map_type &]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.operator_not_ [*operator!]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.operator_openbrace__closebrace_ [*operator[]]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.pick [*pick]]]
+ [Get a value for the key, with fallback. ]
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.rbegin [*rbegin]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.rend [*rend]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.self_type [*self_type]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.set [*set]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.size [*size]]]
+ []
+ ]
+
+]
 
-[endsect]
+This wraps the underlying data map and exposes a std::map-like interface for the different data maps.
 
+It also includes an as<> member function which casts the found data into any type the user specifies.
 
-[section:read_some common::basic_connection< tags::stderr >::read_some]
 
-[indexterm2 read_some..common::basic_connection< tags::stderr >]
+[section:allocator_type common::data_map_proxy::allocator_type]
 
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.read_some.overload1 read_some]``(
- MutableBufferSequence & buf,
- boost::system::error_code & ec);
+[indexterm2 allocator_type..common::data_map_proxy]
 
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.read_some.overload2 read_some]``(
- MutableBufferSequence & buf);
+ typedef map_type::allocator_type allocator_type;
 
 
-[section:overload1 common::basic_connection< tags::stderr >::read_some (1 of 2 overloads)]
 
 
+[endsect]
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence & buf,
- boost::system::error_code & ec);
 
 
+[section:as common::data_map_proxy::as]
 
-[endsect]
+[indexterm2 as..common::data_map_proxy] Get a value for the key as a specified type, with fallback.
 
+ template<
+ typename T >
+ T as(
+ key_type const & key,
+ T const & default_value = T()) const;
 
 
-[section:overload2 common::basic_connection< tags::stderr >::read_some (2 of 2 overloads)]
 
+[heading Parameters]
+
 
+[variablelist
+
+[[key][The name of CGI parameter to look for. ]]
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence & buf);
+[[default_value][The default return value. If no data exists in the map for the specified key, or the data cannot be converted into the type of the default\_ value, then this value is returned.]]
 
+]
 
+If the key cannot be found, returns a default-constructed object of type T.
 
-[endsect]
+If the key is found, attempts to convert the value into the type T. This throws a boost::bad\_lexical\_cast when it fails.
 
 
 [endsect]
 
 
-[section:type common::basic_connection< tags::stderr >::type]
+[section:begin common::data_map_proxy::begin]
 
-[indexterm2 type..common::basic_connection< tags::stderr >]
+[indexterm2 begin..common::data_map_proxy] Map iterators.
 
- typedef basic_connection< tags::stderr > type;
+ iterator ``[link cgi.reference.common__data_map_proxy.begin.overload1 begin]``();
 
+ const_iterator ``[link cgi.reference.common__data_map_proxy.begin.overload2 begin]``() const;
 
 
+[section:overload1 common::data_map_proxy::begin (1 of 2 overloads)]
 
-[endsect]
+Map iterators.
 
+ iterator begin();
 
-[section:write_some common::basic_connection< tags::stderr >::write_some]
 
-[indexterm2 write_some..common::basic_connection< tags::stderr >]
 
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.write_some.overload1 write_some]``(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
+[endsect]
 
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__stderr__gt_.write_some.overload2 write_some]``(
- ConstBufferSequence & buf);
 
 
-[section:overload1 common::basic_connection< tags::stderr >::write_some (1 of 2 overloads)]
+[section:overload2 common::data_map_proxy::begin (2 of 2 overloads)]
 
 
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
+ const_iterator begin() const;
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 common::basic_connection< tags::stderr >::write_some (2 of 2 overloads)]
 
+[section:clear common::data_map_proxy::clear]
 
+[indexterm2 clear..common::data_map_proxy]
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf);
+ void clear();
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[endsect]
+[section:const_iterator common::data_map_proxy::const_iterator]
 
-[section:common__basic_connection_lt__tags__stdio__gt_ common::basic_connection< tags::stdio >]
+[indexterm2 const_iterator..common::data_map_proxy]
 
+ typedef map_type::const_iterator const_iterator;
 
 
- template<>
- class basic_connection< tags::stdio > :
- public connection_base
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.pointer [*pointer]]]
- []
-
- ]
 
-]
+[section:const_reverse_iterator common::data_map_proxy::const_reverse_iterator]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[indexterm2 const_reverse_iterator..common::data_map_proxy]
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.basic_connection [*basic_connection]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.create [*create]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.read_some [*read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.write_some [*write_some]]]
- []
- ]
-
-]
+ typedef map_type::const_reverse_iterator const_reverse_iterator;
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.is_open_ [*is_open_]]]
- []
- ]
 
-]
 
-[section:basic_connection common::basic_connection< tags::stdio >::basic_connection]
+[endsect]
 
-[indexterm2 basic_connection..common::basic_connection< tags::stdio >]
 
- template<
- typename T >
- ``[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.basic_connection.overload1 basic_connection]``(
- T & );
 
- ``[link cgi.reference.common__basic_connection_lt__tags__stdio__gt_.basic_connection.overload2 basic_connection]``();
+[section:count common::data_map_proxy::count]
 
+[indexterm2 count..common::data_map_proxy]
 
-[section:overload1 common::basic_connection< tags::stdio >::basic_connection (1 of 2 overloads)]
+ size_type count(
+ const key_type & key);
 
 
 
- template<
- typename T >
- basic_connection(
- T & );
+[endsect]
 
 
 
-[endsect]
+[section:empty common::data_map_proxy::empty]
 
+[indexterm2 empty..common::data_map_proxy]
 
+ bool empty();
 
-[section:overload2 common::basic_connection< tags::stdio >::basic_connection (2 of 2 overloads)]
 
 
+[endsect]
 
- basic_connection();
 
+[section:end common::data_map_proxy::end]
 
+[indexterm2 end..common::data_map_proxy]
 
-[endsect]
+ iterator ``[link cgi.reference.common__data_map_proxy.end.overload1 end]``();
 
+ const_iterator ``[link cgi.reference.common__data_map_proxy.end.overload2 end]``() const;
 
-[endsect]
 
+[section:overload1 common::data_map_proxy::end (1 of 2 overloads)]
 
-[section:close common::basic_connection< tags::stdio >::close]
 
-[indexterm2 close..common::basic_connection< tags::stdio >]
 
- void close();
+ iterator end();
 
 
 
@@ -7393,23 +7404,26 @@
 
 
 
-[section:create common::basic_connection< tags::stdio >::create]
+[section:overload2 common::data_map_proxy::end (2 of 2 overloads)]
 
-[indexterm2 create..common::basic_connection< tags::stdio >]
 
- static pointer create();
 
+ const_iterator end() const;
+
+
+
+[endsect]
 
 
 [endsect]
 
 
+[section:iterator common::data_map_proxy::iterator]
 
-[section:is_open common::basic_connection< tags::stdio >::is_open]
+[indexterm2 iterator..common::data_map_proxy]
 
-[indexterm2 is_open..common::basic_connection< tags::stdio >]
+ typedef map_type::iterator iterator;
 
- bool is_open() const;
 
 
 
@@ -7417,11 +7431,12 @@
 
 
 
-[section:is_open_ common::basic_connection< tags::stdio >::is_open_]
+[section:key_type common::data_map_proxy::key_type]
 
-[indexterm2 is_open_..common::basic_connection< tags::stdio >]
+[indexterm2 key_type..common::data_map_proxy]
+
+ typedef map_type::key_type key_type;
 
- bool is_open_;
 
 
 
@@ -7429,11 +7444,11 @@
 
 
 
-[section:pointer common::basic_connection< tags::stdio >::pointer]
+[section:map_type common::data_map_proxy::map_type]
 
-[indexterm2 pointer..common::basic_connection< tags::stdio >]
+[indexterm2 map_type..common::data_map_proxy]
 
- typedef boost::shared_ptr< basic_connection< tags::stdio > > pointer;
+ typedef MapType map_type;
 
 
 
@@ -7442,15 +7457,12 @@
 
 
 
-[section:read_some common::basic_connection< tags::stdio >::read_some]
+[section:mapped_type common::data_map_proxy::mapped_type]
 
-[indexterm2 read_some..common::basic_connection< tags::stdio >]
+[indexterm2 mapped_type..common::data_map_proxy]
+
+ typedef map_type::mapped_type mapped_type;
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence buf,
- boost::system::error_code & ec);
 
 
 
@@ -7458,15 +7470,11 @@
 
 
 
-[section:write_some common::basic_connection< tags::stdio >::write_some]
+[section:operator_map_type_& common::data_map_proxy::operator map_type &]
 
-[indexterm2 write_some..common::basic_connection< tags::stdio >]
+[indexterm2 operator map_type &..common::data_map_proxy]
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
+ operator map_type &();
 
 
 
@@ -7474,106 +7482,40 @@
 
 
 
-[endsect]
-
-[section:common__basic_connection_lt__tags__tcp_socket__gt_ common::basic_connection< tags::tcp_socket >]
-
+[section:operator_not_ common::data_map_proxy::operator!]
 
+[indexterm2 operator!..common::data_map_proxy]
 
- template<>
- class basic_connection< tags::tcp_socket > :
- public connection_base
+ bool operator!() const;
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.next_layer_type [*next_layer_type]]]
- []
-
- ]
 
- [
+[section:operator_openbrace__closebrace_ common::data_map_proxy::operator[]]
 
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.pointer [*pointer]]]
- []
-
- ]
+[indexterm2 operator[]..common::data_map_proxy]
 
- [
+ mapped_type & ``[link cgi.reference.common__data_map_proxy.operator_openbrace__closebrace_.overload1 operator[]]``(
+ const char * varname);
 
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.type [*type]]]
- []
-
- ]
+ mapped_type & ``[link cgi.reference.common__data_map_proxy.operator_openbrace__closebrace_.overload2 operator[]]``(
+ const char * varname) const;
 
-]
+ mapped_type & ``[link cgi.reference.common__data_map_proxy.operator_openbrace__closebrace_.overload3 operator[]]``(
+ key_type const & varname);
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ mapped_type const & ``[link cgi.reference.common__data_map_proxy.operator_openbrace__closebrace_.overload4 operator[]]``(
+ key_type const & varname) const;
 
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.async_read_some [*async_read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.async_write_some [*async_write_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.basic_connection [*basic_connection]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.create [*create]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.next_layer [*next_layer]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.read_some [*read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.write_some [*write_some]]]
- []
- ]
-
-]
 
+[section:overload1 common::data_map_proxy::operator[] (1 of 4 overloads)]
 
-[section:async_read_some common::basic_connection< tags::tcp_socket >::async_read_some]
 
-[indexterm2 async_read_some..common::basic_connection< tags::tcp_socket >]
 
- template<
- typename MutableBufferSequence ,
- typename Handler >
- void async_read_some(
- MutableBufferSequence & buf,
- Handler handler);
+ mapped_type & operator[](
+ const char * varname);
 
 
 
@@ -7581,16 +7523,12 @@
 
 
 
-[section:async_write_some common::basic_connection< tags::tcp_socket >::async_write_some]
+[section:overload2 common::data_map_proxy::operator[] (2 of 4 overloads)]
 
-[indexterm2 async_write_some..common::basic_connection< tags::tcp_socket >]
 
- template<
- typename ConstBufferSequence ,
- typename Handler >
- void async_write_some(
- ConstBufferSequence & buf,
- Handler handler);
+
+ mapped_type & operator[](
+ const char * varname) const;
 
 
 
@@ -7598,12 +7536,12 @@
 
 
 
-[section:basic_connection common::basic_connection< tags::tcp_socket >::basic_connection]
+[section:overload3 common::data_map_proxy::operator[] (3 of 4 overloads)]
 
-[indexterm2 basic_connection..common::basic_connection< tags::tcp_socket >]
 
- basic_connection(
- io_service & ios);
+
+ mapped_type & operator[](
+ key_type const & varname);
 
 
 
@@ -7611,24 +7549,48 @@
 
 
 
-[section:close common::basic_connection< tags::tcp_socket >::close]
+[section:overload4 common::data_map_proxy::operator[] (4 of 4 overloads)]
 
-[indexterm2 close..common::basic_connection< tags::tcp_socket >]
 
- void close();
+
+ mapped_type const & operator[](
+ key_type const & varname) const;
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:create common::basic_connection< tags::tcp_socket >::create]
 
-[indexterm2 create..common::basic_connection< tags::tcp_socket >]
+[section:pick common::data_map_proxy::pick]
 
- static pointer create(
- io_service & ios);
+[indexterm2 pick..common::data_map_proxy] Get a value for the key, with fallback.
+
+ mapped_type const & pick(
+ key_type const & key,
+ mapped_type const & default_value) const;
+
+
+
+[endsect]
+
+
+[section:rbegin common::data_map_proxy::rbegin]
+
+[indexterm2 rbegin..common::data_map_proxy]
+
+ reverse_iterator ``[link cgi.reference.common__data_map_proxy.rbegin.overload1 rbegin]``();
+
+ const_reverse_iterator ``[link cgi.reference.common__data_map_proxy.rbegin.overload2 rbegin]``() const;
+
+
+[section:overload1 common::data_map_proxy::rbegin (1 of 2 overloads)]
+
+
+
+ reverse_iterator rbegin();
 
 
 
@@ -7636,11 +7598,33 @@
 
 
 
-[section:is_open common::basic_connection< tags::tcp_socket >::is_open]
+[section:overload2 common::data_map_proxy::rbegin (2 of 2 overloads)]
+
+
+
+ const_reverse_iterator rbegin() const;
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:rend common::data_map_proxy::rend]
+
+[indexterm2 rend..common::data_map_proxy]
+
+ reverse_iterator ``[link cgi.reference.common__data_map_proxy.rend.overload1 rend]``();
+
+ const_reverse_iterator ``[link cgi.reference.common__data_map_proxy.rend.overload2 rend]``() const;
+
+
+[section:overload1 common::data_map_proxy::rend (1 of 2 overloads)]
 
-[indexterm2 is_open..common::basic_connection< tags::tcp_socket >]
 
- bool is_open() const;
+
+ reverse_iterator rend();
 
 
 
@@ -7648,23 +7632,25 @@
 
 
 
-[section:next_layer common::basic_connection< tags::tcp_socket >::next_layer]
+[section:overload2 common::data_map_proxy::rend (2 of 2 overloads)]
+
 
-[indexterm2 next_layer..common::basic_connection< tags::tcp_socket >]
 
- next_layer_type & next_layer();
+ const_reverse_iterator rend() const;
 
 
 
 [endsect]
 
 
+[endsect]
+
 
-[section:next_layer_type common::basic_connection< tags::tcp_socket >::next_layer_type]
+[section:reverse_iterator common::data_map_proxy::reverse_iterator]
 
-[indexterm2 next_layer_type..common::basic_connection< tags::tcp_socket >]
+[indexterm2 reverse_iterator..common::data_map_proxy]
 
- typedef boost::asio::ip::tcp::socket next_layer_type;
+ typedef map_type::reverse_iterator reverse_iterator;
 
 
 
@@ -7673,11 +7659,11 @@
 
 
 
-[section:pointer common::basic_connection< tags::tcp_socket >::pointer]
+[section:self_type common::data_map_proxy::self_type]
 
-[indexterm2 pointer..common::basic_connection< tags::tcp_socket >]
+[indexterm2 self_type..common::data_map_proxy]
 
- typedef boost::shared_ptr< type > pointer;
+ typedef data_map_proxy< map_type > self_type;
 
 
 [heading Types]
@@ -7686,21 +7672,77 @@
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.next_layer_type [*next_layer_type]]]
+ [[link cgi.reference.common__data_map_proxy.allocator_type [*allocator_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.const_iterator [*const_iterator]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.const_reverse_iterator [*const_reverse_iterator]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.iterator [*iterator]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.key_type [*key_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.map_type [*map_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.mapped_type [*mapped_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.reverse_iterator [*reverse_iterator]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__data_map_proxy.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.pointer [*pointer]]]
+ [[link cgi.reference.common__data_map_proxy.size_type [*size_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.type [*type]]]
+ [[link cgi.reference.common__data_map_proxy.value_type [*value_type]]]
     []
   
   ]
@@ -7712,82 +7754,97 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.async_read_some [*async_read_some]]]
+ [[link cgi.reference.common__data_map_proxy.as [*as]]]
+ [Get a value for the key as a specified type, with fallback. ]
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.begin [*begin]]]
+ [Map iterators. ]
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.clear [*clear]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.count [*count]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.empty [*empty]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.end [*end]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.async_write_some [*async_write_some]]]
+ [[link cgi.reference.common__data_map_proxy.operator_map_type_& [*operator map_type &]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.basic_connection [*basic_connection]]]
+ [[link cgi.reference.common__data_map_proxy.operator_not_ [*operator!]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.close [*close]]]
+ [[link cgi.reference.common__data_map_proxy.operator_openbrace__closebrace_ [*operator[]]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.create [*create]]]
+ [[link cgi.reference.common__data_map_proxy.pick [*pick]]]
+ [Get a value for the key, with fallback. ]
+ ]
+
+ [
+ [[link cgi.reference.common__data_map_proxy.rbegin [*rbegin]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.is_open [*is_open]]]
+ [[link cgi.reference.common__data_map_proxy.rend [*rend]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.next_layer [*next_layer]]]
+ [[link cgi.reference.common__data_map_proxy.self_type [*self_type]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.read_some [*read_some]]]
+ [[link cgi.reference.common__data_map_proxy.set [*set]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.write_some [*write_some]]]
+ [[link cgi.reference.common__data_map_proxy.size [*size]]]
     []
   ]
   
 ]
 
+This wraps the underlying data map and exposes a std::map-like interface for the different data maps.
 
+It also includes an as<> member function which casts the found data into any type the user specifies.
 
-[endsect]
-
-
-[section:read_some common::basic_connection< tags::tcp_socket >::read_some]
-
-[indexterm2 read_some..common::basic_connection< tags::tcp_socket >]
 
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.read_some.overload1 read_some]``(
- MutableBufferSequence & buf,
- boost::system::error_code & ec);
 
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.read_some.overload2 read_some]``(
- MutableBufferSequence & buf);
+[endsect]
 
 
-[section:overload1 common::basic_connection< tags::tcp_socket >::read_some (1 of 2 overloads)]
 
+[section:self_type common::data_map_proxy::self_type]
 
+[indexterm2 self_type..common::data_map_proxy]
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence & buf,
- boost::system::error_code & ec);
+ self_type();
 
 
 
@@ -7795,231 +7852,268 @@
 
 
 
-[section:overload2 common::basic_connection< tags::tcp_socket >::read_some (2 of 2 overloads)]
-
+[section:set common::data_map_proxy::set]
 
+[indexterm2 set..common::data_map_proxy]
 
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- MutableBufferSequence & buf);
-
+ void set(
+ map_type & data);
 
 
-[endsect]
-
 
 [endsect]
 
 
-[section:type common::basic_connection< tags::tcp_socket >::type]
 
-[indexterm2 type..common::basic_connection< tags::tcp_socket >]
+[section:size common::data_map_proxy::size]
 
- typedef basic_connection< tags::tcp_socket > type;
+[indexterm2 size..common::data_map_proxy]
 
+ size_type size() const;
 
 
 
 [endsect]
 
 
-[section:write_some common::basic_connection< tags::tcp_socket >::write_some]
-
-[indexterm2 write_some..common::basic_connection< tags::tcp_socket >]
-
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.write_some.overload1 write_some]``(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
-
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_connection_lt__tags__tcp_socket__gt_.write_some.overload2 write_some]``(
- ConstBufferSequence & buf);
 
+[section:size_type common::data_map_proxy::size_type]
 
-[section:overload1 common::basic_connection< tags::tcp_socket >::write_some (1 of 2 overloads)]
+[indexterm2 size_type..common::data_map_proxy]
 
+ typedef map_type::size_type size_type;
 
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf,
- boost::system::error_code & ec);
-
 
 
 [endsect]
 
 
 
-[section:overload2 common::basic_connection< tags::tcp_socket >::write_some (2 of 2 overloads)]
+[section:value_type common::data_map_proxy::value_type]
 
+[indexterm2 value_type..common::data_map_proxy]
 
+ typedef map_type::value_type value_type;
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- ConstBufferSequence & buf);
 
 
 
 [endsect]
 
 
-[endsect]
-
 
 [endsect]
 
-[section:common__basic_cookie common::basic_cookie]
 
-A `basic_cookie<>` object that can be (out-) streamed.
+[section:common__error__cgi_errors common::error::cgi_errors]
 
- template<
- typename ``[link cgi.reference.CharT CharT]``>
- struct basic_cookie
+[indexterm1 common::error::cgi_errors]
 
+ enum cgi_errors
 
-[heading Types]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
 
   [
-
- [[link cgi.reference.common__basic_cookie.char_type [*char_type]]]
+ [client_closed]
     []
-
   ]
 
   [
-
- [[link cgi.reference.common__basic_cookie.self_type [*self_type]]]
+ [duplicate_request]
     []
-
   ]
 
   [
-
- [[link cgi.reference.common__basic_cookie.string_type [*string_type]]]
+ [accepting_on_an_open_request]
     []
-
   ]
 
-]
+ [
+ [invalid_socket]
+ []
+ ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [
+ [invalid_form_type]
+ []
+ ]
 
   [
- [[link cgi.reference.common__basic_cookie.basic_cookie [*basic_cookie]]]
- [Create a cookie. ]
+ [broken_pipe]
+ []
   ]
-
+
   [
- [[link cgi.reference.common__basic_cookie.to_string [*to_string]]]
- [Create a cookie from a const char*. ]
+ [bad_read]
+ []
   ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+ [
+ [bad_write]
+ []
+ ]
 
   [
- [[link cgi.reference.common__basic_cookie.domain [*domain]]]
+ [client_not_open]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.expires [*expires]]]
+ [eof]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.http_only [*http_only]]]
+ [multipart_form_boundary_not_found]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.name [*name]]]
+ [multipart_meta_data_not_terminated]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.path [*path]]]
+ [no_boundary_marker]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.secure [*secure]]]
- [`true` iff the cookie is only used for secure connections. ]
+ [already_closed]
+ []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.value [*value]]]
+ [max_post_exceeded]
     []
   ]
 
 ]
 
-Either set the parameters in the constructor, or set them directly. Note: If you want to set the parameters individually, remember that each parameter must NOT have a trailing semi-colon!
-
-TODO
-* Data should be URL-encoded, or maybe provide an overload for url_decode that takes an HttpCookie?
-
-* Add from_string() ?
 
 
-[section:basic_cookie common::basic_cookie::basic_cookie]
+[endsect]
 
-[indexterm2 basic_cookie..common::basic_cookie] Create a cookie.
 
- ``[link cgi.reference.common__basic_cookie.basic_cookie.overload1 basic_cookie]``(
- const string_type & _name,
- const string_type & _val,
- const string_type & _expires = "",
- const string_type & _path = "/",
- const string_type & _domain = "",
- bool _secure = false,
- bool HttpOnly = false);
+[section:common__form_parser common::form_parser]
 
- ``[link cgi.reference.common__basic_cookie.basic_cookie.overload2 basic_cookie]``(
- const string_type & _name);
+A class for parsing POST data sent to a CGI process.
 
- ``[link cgi.reference.common__basic_cookie.basic_cookie.overload3 basic_cookie]``();
+ class form_parser
 
 
-[section:overload1 common::basic_cookie::basic_cookie (1 of 3 overloads)]
+[heading Types]
+[table
+ [[Name][Description]]
 
-Create a cookie.
+ [
 
- basic_cookie(
- const string_type & _name,
- const string_type & _val,
- const string_type & _expires = "",
- const string_type & _path = "/",
- const string_type & _domain = "",
- bool _secure = false,
- bool HttpOnly = false);
+ [[link cgi.reference.common__form_parser.buffer_type [*buffer_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__form_parser.callback_type [*callback_type]]]
+ [The callback functor to read more data. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__form_parser__context [*context]]]
+ [The context used for parsing. ]
+
+ ]
 
+ [
 
-[section:overload2 common::basic_cookie::basic_cookie (2 of 3 overloads)]
+ [[link cgi.reference.common__form_parser.map_type [*map_type]]]
+ []
+
+ ]
 
-Create a cookie for deleting the cookie named `_name`.
+ [
 
- basic_cookie(
- const string_type & _name);
+ [[link cgi.reference.common__form_parser.mutable_buffers_type [*mutable_buffers_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__form_parser.string_type [*string_type]]]
+ []
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link cgi.reference.common__form_parser.buffer_string [*buffer_string]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.form_parser [*form_parser]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.move_to_start_of_first_part [*move_to_start_of_first_part]]]
+ [Erase any front-cruft on the form data. ]
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.parse [*parse]]]
+ [Run the parser on the given `context`. ]
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.parse_boundary_marker [*parse_boundary_marker]]]
+ [Get the boundary marker from the CONTENT_TYPE header. ]
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.parse_form_part [*parse_form_part]]]
+ [Parse a single form part. ]
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.parse_multipart_form [*parse_multipart_form]]]
+ [Parse a multipart form. ]
+ ]
+
+ [
+ [[link cgi.reference.common__form_parser.parse_url_encoded_form [*parse_url_encoded_form]]]
+ [URL-encoded forms. ]
+ ]
+
+]
+
+Construct this and then call `form\_parserparse` with an instance of form_parser::context (or compatible struct).
+
+This is minimal and doesn't extract all meta-data yet, but is known to work on Windows XP with MSVC9.0 and Ubuntu linux with gcc 4.2.x and 4.3.x.
+
+Valid Form Encodings > `application/x-www-form-urlencoded` > `multipart/form-data`
+
+File uploads (ie. in `multipart/form-data` forms) are saved to disk. See the `BOOST\_CGI\_UPLOAD\_DIRECTORY` macro.
+
+Should also work for HTTP POST data.
+
+
+[section:buffer_string common::form_parser::buffer_string]
+
+[indexterm2 buffer_string..common::form_parser]
+
+ string_type buffer_string();
 
 
 
@@ -8027,26 +8121,37 @@
 
 
 
-[section:overload3 common::basic_cookie::basic_cookie (3 of 3 overloads)]
+[section:buffer_type common::form_parser::buffer_type]
 
+[indexterm2 buffer_type..common::form_parser]
 
+ typedef common::form_part::buffer_type buffer_type;
 
- basic_cookie();
 
 
 
 [endsect]
 
 
+
+[section:callback_type common::form_parser::callback_type]
+
+[indexterm2 callback_type..common::form_parser] The callback functor to read more data.
+
+ typedef boost::function< std::size_t(boost::system::error_code &) > callback_type;
+
+
+
+
 [endsect]
 
 
-[section:char_type common::basic_cookie::char_type]
 
-[indexterm2 char_type..common::basic_cookie]
+[section:form_parser common::form_parser::form_parser]
 
- typedef CharT char_type;
+[indexterm2 form_parser..common::form_parser]
 
+ form_parser();
 
 
 
@@ -8054,11 +8159,12 @@
 
 
 
-[section:domain common::basic_cookie::domain]
+[section:map_type common::form_parser::map_type]
 
-[indexterm2 domain..common::basic_cookie]
+[indexterm2 map_type..common::form_parser]
+
+ typedef common::map map_type;
 
- string_type domain;
 
 
 
@@ -8066,23 +8172,27 @@
 
 
 
-[section:expires common::basic_cookie::expires]
+[section:move_to_start_of_first_part common::form_parser::move_to_start_of_first_part]
 
-[indexterm2 expires..common::basic_cookie]
+[indexterm2 move_to_start_of_first_part..common::form_parser] Erase any front-cruft on the form data.
+
+ boost::system::error_code move_to_start_of_first_part(
+ boost::system::error_code & ec);
 
- string_type expires;
 
+In multipart forms, any characters that precede the first form boundary are ignored. This function erases those characters.
 
 
 [endsect]
 
 
 
-[section:http_only common::basic_cookie::http_only]
+[section:mutable_buffers_type common::form_parser::mutable_buffers_type]
 
-[indexterm2 http_only..common::basic_cookie]
+[indexterm2 mutable_buffers_type..common::form_parser]
+
+ typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
 
- bool http_only;
 
 
 
@@ -8090,11 +8200,13 @@
 
 
 
-[section:name common::basic_cookie::name]
+[section:parse common::form_parser::parse]
 
-[indexterm2 name..common::basic_cookie]
+[indexterm2 parse..common::form_parser] Run the parser on the given `context`.
 
- string_type name;
+ boost::system::error_code parse(
+ context ctx,
+ boost::system::error_code & ec);
 
 
 
@@ -8102,11 +8214,12 @@
 
 
 
-[section:path common::basic_cookie::path]
+[section:parse_boundary_marker common::form_parser::parse_boundary_marker]
 
-[indexterm2 path..common::basic_cookie]
+[indexterm2 parse_boundary_marker..common::form_parser] Get the boundary marker from the CONTENT_TYPE header.
 
- string_type path;
+ boost::system::error_code parse_boundary_marker(
+ boost::system::error_code & ec);
 
 
 
@@ -8114,11 +8227,12 @@
 
 
 
-[section:secure common::basic_cookie::secure]
+[section:parse_form_part common::form_parser::parse_form_part]
 
-[indexterm2 secure..common::basic_cookie] `true` iff the cookie is only used for secure connections.
+[indexterm2 parse_form_part..common::form_parser] Parse a single form part.
 
- bool secure;
+ boost::system::error_code parse_form_part(
+ boost::system::error_code & ec);
 
 
 
@@ -8126,104 +8240,130 @@
 
 
 
-[section:self_type common::basic_cookie::self_type]
+[section:parse_multipart_form common::form_parser::parse_multipart_form]
 
-[indexterm2 self_type..common::basic_cookie]
+[indexterm2 parse_multipart_form..common::form_parser] Parse a multipart form.
 
- typedef basic_cookie< CharT > self_type;
+ boost::system::error_code parse_multipart_form(
+ boost::system::error_code & ec);
 
 
-[heading Types]
+Parse forms where the content-type is "multipart/form-data".
+
+
+[endsect]
+
+
+
+[section:parse_url_encoded_form common::form_parser::parse_url_encoded_form]
+
+[indexterm2 parse_url_encoded_form..common::form_parser] URL-encoded forms.
+
+ boost::system::error_code parse_url_encoded_form(
+ boost::system::error_code & ec);
+
+
+Parse forms where the content-type is "application/www-url-encoded".
+
+
+[endsect]
+
+
+
+[section:string_type common::form_parser::string_type]
+
+[indexterm2 string_type..common::form_parser]
+
+ typedef common::form_part::string_type string_type;
+
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:common__form_parser__context common::form_parser::context]
+
+The context used for parsing.
+
+ struct context
+
+
+[heading Data Members]
 [table
   [[Name][Description]]
 
   [
-
- [[link cgi.reference.common__basic_cookie.char_type [*char_type]]]
+ [[link cgi.reference.common__form_parser__context.boundary_marker [*boundary_marker]]]
     []
-
   ]
 
   [
-
- [[link cgi.reference.common__basic_cookie.self_type [*self_type]]]
+ [[link cgi.reference.common__form_parser__context.boundary_markers [*boundary_markers]]]
     []
-
   ]
 
   [
-
- [[link cgi.reference.common__basic_cookie.string_type [*string_type]]]
+ [[link cgi.reference.common__form_parser__context.buffer [*buffer]]]
     []
-
   ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.common__basic_cookie.basic_cookie [*basic_cookie]]]
- [Create a cookie. ]
+ [[link cgi.reference.common__form_parser__context.bytes_left [*bytes_left]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.common__basic_cookie.to_string [*to_string]]]
- [Create a cookie from a const char*. ]
+ [[link cgi.reference.common__form_parser__context.callback [*callback]]]
+ []
   ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_cookie.domain [*domain]]]
+ [[link cgi.reference.common__form_parser__context.content_type [*content_type]]]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.expires [*expires]]]
+ [[link cgi.reference.common__form_parser__context.data_map [*data_map]]]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.http_only [*http_only]]]
+ [[link cgi.reference.common__form_parser__context.offset [*offset]]]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.name [*name]]]
+ [[link cgi.reference.common__form_parser__context.pos [*pos]]]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.path [*path]]]
+ [[link cgi.reference.common__form_parser__context.random_string [*random_string]]]
     []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.secure [*secure]]]
- [`true` iff the cookie is only used for secure connections. ]
+ [[link cgi.reference.common__form_parser__context.stdin_parsed [*stdin_parsed]]]
+ []
   ]
 
   [
- [[link cgi.reference.common__basic_cookie.value [*value]]]
+ [[link cgi.reference.common__form_parser__context.uploads_map [*uploads_map]]]
     []
   ]
 
 ]
 
-Either set the parameters in the constructor, or set them directly. Note: If you want to set the parameters individually, remember that each parameter must NOT have a trailing semi-colon!
 
-TODO
-* Data should be URL-encoded, or maybe provide an overload for url_decode that takes an HttpCookie?
+[section:boundary_marker common::form_parser::context::boundary_marker]
 
-* Add from_string() ?
+[indexterm2 boundary_marker..common::form_parser::context]
 
+ string_type boundary_marker;
 
 
 
@@ -8231,12 +8371,11 @@
 
 
 
-[section:string_type common::basic_cookie::string_type]
-
-[indexterm2 string_type..common::basic_cookie]
+[section:boundary_markers common::form_parser::context::boundary_markers]
 
- typedef std::basic_string< CharT > string_type;
+[indexterm2 boundary_markers..common::form_parser::context]
 
+ std::list< string_type > boundary_markers;
 
 
 
@@ -8244,17 +8383,11 @@
 
 
 
-[section:to_string common::basic_cookie::to_string]
-
-[indexterm2 to_string..common::basic_cookie] Create a cookie from a const char*.
-
- string_type to_string() const;
-
+[section:buffer common::form_parser::context::buffer]
 
-Rules taken from: http://wp.netscape.com/newsref/std/cookie\_spec.html
+[indexterm2 buffer..common::form_parser::context]
 
-Assumes:
-* Parts of the cookie are delimited by '; '. ie. if there is no space, or multiple spaces after the semi-colon, this function won't work... Make a string out of the cookie.
+ buffer_type & buffer;
 
 
 
@@ -8262,11 +8395,11 @@
 
 
 
-[section:value common::basic_cookie::value]
+[section:bytes_left common::form_parser::context::bytes_left]
 
-[indexterm2 value..common::basic_cookie]
+[indexterm2 bytes_left..common::form_parser::context]
 
- string_type value;
+ std::size_t & bytes_left;
 
 
 
@@ -8274,87 +8407,47 @@
 
 
 
-[endsect]
+[section:callback common::form_parser::context::callback]
 
-[section:common__basic_header common::basic_header]
+[indexterm2 callback..common::form_parser::context]
 
+ const callback_type callback;
 
 
- template<
- typename ``[link cgi.reference.CharT CharT]``>
- struct basic_header
 
+[endsect]
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link cgi.reference.common__basic_header.char_type [*char_type]]]
- []
-
- ]
+[section:content_type common::form_parser::context::content_type]
 
- [
+[indexterm2 content_type..common::form_parser::context]
 
- [[link cgi.reference.common__basic_header.string_type [*string_type]]]
- []
-
- ]
+ string_type & content_type;
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.common__basic_header.basic_header [*basic_header]]]
- [Construct an header from a cookie. ]
- ]
-
- [
- [[link cgi.reference.common__basic_header.operator_string_type [*operator string_type]]]
- []
- ]
-
-]
+[endsect]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.common__basic_header.content [*content]]]
- []
- ]
 
-]
+[section:data_map common::form_parser::context::data_map]
 
-[section:basic_header common::basic_header::basic_header]
+[indexterm2 data_map..common::form_parser::context]
 
-[indexterm2 basic_header..common::basic_header] Construct an header from a cookie.
+ common::post_map & data_map;
 
- ``[link cgi.reference.common__basic_header.basic_header.overload1 basic_header]``(
- const basic_cookie< char_type > & ck);
 
- ``[link cgi.reference.common__basic_header.basic_header.overload2 basic_header]``(
- const string_type & name,
- const string_type & val);
 
- ``[link cgi.reference.common__basic_header.basic_header.overload3 basic_header]``(
- const string_type & _content);
+[endsect]
 
- ``[link cgi.reference.common__basic_header.basic_header.overload4 basic_header]``();
 
 
-[section:overload1 common::basic_header::basic_header (1 of 4 overloads)]
+[section:offset common::form_parser::context::offset]
 
-Construct an header from a cookie.
+[indexterm2 offset..common::form_parser::context]
 
- basic_header(
- const basic_cookie< char_type > & ck);
+ std::size_t offset;
 
 
 
@@ -8362,13 +8455,11 @@
 
 
 
-[section:overload2 common::basic_header::basic_header (2 of 4 overloads)]
+[section:pos common::form_parser::context::pos]
 
+[indexterm2 pos..common::form_parser::context]
 
-
- basic_header(
- const string_type & name,
- const string_type & val);
+ buffer_type::iterator pos;
 
 
 
@@ -8376,39 +8467,11 @@
 
 
 
-[section:overload3 common::basic_header::basic_header (3 of 4 overloads)]
+[section:random_string common::form_parser::context::random_string]
 
+[indexterm2 random_string..common::form_parser::context]
 
-
- basic_header(
- const string_type & _content);
-
-
-
-[endsect]
-
-
-
-[section:overload4 common::basic_header::basic_header (4 of 4 overloads)]
-
-
-
- basic_header();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:char_type common::basic_header::char_type]
-
-[indexterm2 char_type..common::basic_header]
-
- typedef CharT char_type;
-
+ string_type random_string;
 
 
 
@@ -8416,11 +8479,11 @@
 
 
 
-[section:content common::basic_header::content]
+[section:stdin_parsed common::form_parser::context::stdin_parsed]
 
-[indexterm2 content..common::basic_header]
+[indexterm2 stdin_parsed..common::form_parser::context]
 
- string_type content;
+ bool & stdin_parsed;
 
 
 
@@ -8428,11 +8491,11 @@
 
 
 
-[section:operator_string_type common::basic_header::operator string_type]
+[section:uploads_map common::form_parser::context::uploads_map]
 
-[indexterm2 operator string_type..common::basic_header]
+[indexterm2 uploads_map..common::form_parser::context]
 
- operator string_type();
+ common::upload_map & uploads_map;
 
 
 
@@ -8440,29 +8503,13 @@
 
 
 
-[section:string_type common::basic_header::string_type]
-
-[indexterm2 string_type..common::basic_header]
-
- typedef std::basic_string< CharT > string_type;
-
-
-
-
 [endsect]
 
+[section:common__form_part common::form_part]
 
 
-[endsect]
-
-[section:common__basic_protocol_service common::basic_protocol_service]
-
-Basic Protocol Service.
 
- template<
- typename Protocol ,
- typename IoServiceProvider >
- class basic_protocol_service
+ struct form_part
 
 
 [heading Types]
@@ -8471,49 +8518,49 @@
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
+ [[link cgi.reference.common__form_part.buffer_type [*buffer_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__form_part.char_type [*char_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
+ [[link cgi.reference.common__form_part.iter_t [*iter_t]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
+ [[link cgi.reference.common__form_part.meta_data_map_type [*meta_data_map_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
+ [[link cgi.reference.common__form_part.pair_t [*pair_t]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
+ [[link cgi.reference.common__form_part.range_type [*range_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
+ [[link cgi.reference.common__form_part.string_type [*string_type]]]
     []
   
   ]
@@ -8525,127 +8572,159 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
+ [[link cgi.reference.common__form_part.c_str [*c_str]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
+ [[link cgi.reference.common__form_part.empty [*empty]]]
+ [TODO: Check that the uploaded file isn't empty too. ]
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
+ [[link cgi.reference.common__form_part.operator_const_char_type_* [*operator const char_type *]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
+ [[link cgi.reference.common__form_part.operator_std__basic_string_lt__T__gt_ [*operator std::basic_string< T >]]]
     []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
+ [[link cgi.reference.common__form_part.operator_string_type [*operator string_type]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
+ [[link cgi.reference.common__form_part.operator_string_type_const_& [*operator string_type const &]]]
+ []
   ]
   
   [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
+ [[link cgi.reference.common__form_part._form_part [*~form_part]]]
+ []
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
+ [[link cgi.reference.common__form_part.boundary_marker_ [*boundary_marker_]]]
+ [The boundary marker that's needed. ]
   ]
-
+
   [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
+ [[link cgi.reference.common__form_part.buffer_ [*buffer_]]]
     []
   ]
-
-]
 
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
+ [
+ [[link cgi.reference.common__form_part.content_disposition [*content_disposition]]]
+ []
+ ]
 
-[section:basic_protocol_service common::basic_protocol_service::basic_protocol_service]
+ [
+ [[link cgi.reference.common__form_part.content_type [*content_type]]]
+ []
+ ]
 
-[indexterm2 basic_protocol_service..common::basic_protocol_service]
+ [
+ [[link cgi.reference.common__form_part.filename [*filename]]]
+ []
+ ]
 
- ``[link cgi.reference.common__basic_protocol_service.basic_protocol_service.overload1 basic_protocol_service]``(
- boost::asio::io_service & ios);
+ [
+ [[link cgi.reference.common__form_part.meta_data_ [*meta_data_]]]
+ []
+ ]
 
- ``[link cgi.reference.common__basic_protocol_service.basic_protocol_service.overload2 basic_protocol_service]``(
- int pool_size_hint = 1);
+ [
+ [[link cgi.reference.common__form_part.name [*name]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__form_part.path [*path]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__form_part.value [*value]]]
+ []
+ ]
 
-[section:overload1 common::basic_protocol_service::basic_protocol_service (1 of 2 overloads)]
+]
 
+[heading Friends]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__form_part.operator_lt__lt_ [*operator<<]]]
+ []
+ ]
+
+]
 
- basic_protocol_service(
- boost::asio::io_service & ios);
 
+[section:boundary_marker_ common::form_part::boundary_marker_]
 
+[indexterm2 boundary_marker_..common::form_part] The boundary marker that's needed.
 
-[endsect]
+ string_type boundary_marker_;
 
 
 
-[section:overload2 common::basic_protocol_service::basic_protocol_service (2 of 2 overloads)]
+[endsect]
 
 
 
- basic_protocol_service(
- int pool_size_hint = 1);
+[section:buffer_ common::form_part::buffer_]
 
+[indexterm2 buffer_..common::form_part]
 
+ pair_t buffer_;
 
-[endsect]
 
 
 [endsect]
 
 
-[section:dispatch common::basic_protocol_service::dispatch]
 
-[indexterm2 dispatch..common::basic_protocol_service] Dispatch a handler through an available io_service.
+[section:buffer_type common::form_part::buffer_type]
 
- template<
- typename Handler >
- void dispatch(
- Handler handler);
+[indexterm2 buffer_type..common::form_part]
 
+ typedef string_type buffer_type;
 
 
-[endsect]
 
 
+[endsect]
 
-[section:io_service common::basic_protocol_service::io_service]
 
-[indexterm2 io_service..common::basic_protocol_service] Return an available io_service from the IoServiceProvider.
 
- ::cgi::common::io_service & io_service();
+[section:c_str common::form_part::c_str]
 
+[indexterm2 c_str..common::form_part]
+
+ const char_type * c_str() const;
 
-The order in which the underlying io\_services are returned is determined by what policy the IoServiceProvider uses.
 
 
 [endsect]
 
 
 
-[section:ios_provider_type common::basic_protocol_service::ios_provider_type]
+[section:char_type common::form_part::char_type]
 
-[indexterm2 ios_provider_type..common::basic_protocol_service]
+[indexterm2 char_type..common::form_part]
 
- typedef IoServiceProvider ios_provider_type;
+ typedef char char_type;
 
 
 
@@ -8654,11 +8733,11 @@
 
 
 
-[section:is_cgi common::basic_protocol_service::is_cgi]
+[section:content_disposition common::form_part::content_disposition]
 
-[indexterm2 is_cgi..common::basic_protocol_service]
+[indexterm2 content_disposition..common::form_part]
 
- bool is_cgi();
+ string_type content_disposition;
 
 
 
@@ -8666,14 +8745,11 @@
 
 
 
-[section:post common::basic_protocol_service::post]
+[section:content_type common::form_part::content_type]
 
-[indexterm2 post..common::basic_protocol_service] Post the handler through an available io_service.
+[indexterm2 content_type..common::form_part]
 
- template<
- typename Handler >
- void post(
- Handler handler);
+ string_type content_type;
 
 
 
@@ -8681,12 +8757,11 @@
 
 
 
-[section:protocol_type common::basic_protocol_service::protocol_type]
-
-[indexterm2 protocol_type..common::basic_protocol_service]
+[section:empty common::form_part::empty]
 
- typedef Protocol protocol_type;
+[indexterm2 empty..common::form_part] TODO: Check that the uploaded file isn't empty too.
 
+ bool empty() const;
 
 
 
@@ -8694,12 +8769,11 @@
 
 
 
-[section:queue_type common::basic_protocol_service::queue_type]
-
-[indexterm2 queue_type..common::basic_protocol_service]
+[section:filename common::form_part::filename]
 
- typedef std::queue< request_ptr > queue_type;
+[indexterm2 filename..common::form_part]
 
+ boost::filesystem::path filename;
 
 
 
@@ -8707,11 +8781,11 @@
 
 
 
-[section:request_ptr common::basic_protocol_service::request_ptr]
+[section:iter_t common::form_part::iter_t]
 
-[indexterm2 request_ptr..common::basic_protocol_service]
+[indexterm2 iter_t..common::form_part]
 
- typedef boost::shared_ptr< request_type > request_ptr;
+ typedef buffer_type::iterator iter_t;
 
 
 
@@ -8720,12 +8794,11 @@
 
 
 
-[section:request_type common::basic_protocol_service::request_type]
-
-[indexterm2 request_type..common::basic_protocol_service]
+[section:meta_data_ common::form_part::meta_data_]
 
- typedef traits::request_type request_type;
+[indexterm2 meta_data_..common::form_part]
 
+ meta_data_map_type meta_data_;
 
 
 
@@ -8733,40 +8806,36 @@
 
 
 
-[section:reset common::basic_protocol_service::reset]
+[section:meta_data_map_type common::form_part::meta_data_map_type]
 
-[indexterm2 reset..common::basic_protocol_service] Reset all the io_services contained by this service.
+[indexterm2 meta_data_map_type..common::form_part]
 
- void reset();
+ typedef std::map< string_type, pair_t > meta_data_map_type;
 
 
-This deletes the request queue(s), aborts all running requests and then calls reset() on each of the io\_services held by ios\_provider\_. There is no guarantee that requests will terminate immediately.
 
 
 [endsect]
 
 
 
-[section:run common::basic_protocol_service::run]
-
-[indexterm2 run..common::basic_protocol_service] Run all the io_services contained by this service.
+[section:name common::form_part::name]
 
- void run();
+[indexterm2 name..common::form_part]
 
+ string_type name;
 
-This is equivalent to calling run() on each of the io\_services held by ios\_provider\_
 
 
 [endsect]
 
 
 
-[section:set_type common::basic_protocol_service::set_type]
-
-[indexterm2 set_type..common::basic_protocol_service]
+[section:operator_const_char_type_* common::form_part::operator const char_type *]
 
- typedef std::set< request_ptr > set_type;
+[indexterm2 operator const char_type *..common::form_part]
 
+ operator const char_type *() const;
 
 
 
@@ -8774,26 +8843,25 @@
 
 
 
-[section:stop common::basic_protocol_service::stop]
-
-[indexterm2 stop..common::basic_protocol_service] Stop all the io_services contained by this service.
+[section:operator_std__basic_string_lt__T__gt_ common::form_part::operator std::basic_string< T >]
 
- void stop();
+[indexterm2 operator std::basic_string< T >..common::form_part]
 
+ template<
+ typename T >
+ operator std::basic_string< T >();
 
-This is equivalent to calling stop() on each of the io\_services held by ios\_provider\_
 
 
 [endsect]
 
 
 
-[section:traits common::basic_protocol_service::traits]
-
-[indexterm2 traits..common::basic_protocol_service]
+[section:operator_string_type common::form_part::operator string_type]
 
- typedef detail::protocol_traits< Protocol >::type traits;
+[indexterm2 operator string_type..common::form_part]
 
+ operator string_type() const;
 
 
 
@@ -8801,11 +8869,11 @@
 
 
 
-[section:_basic_protocol_service common::basic_protocol_service::~basic_protocol_service]
+[section:operator_string_type_const_& common::form_part::operator string_type const &]
 
-[indexterm2 ~basic_protocol_service..common::basic_protocol_service]
+[indexterm2 operator string_type const &..common::form_part]
 
- ~basic_protocol_service();
+ operator string_type const &() const;
 
 
 
@@ -8813,12499 +8881,38 @@
 
 
 
-[endsect]
+[section:operator_lt__lt_ common::form_part::operator<<]
 
-[section:common__basic_request_acceptor common::basic_request_acceptor]
+[indexterm2 operator<<..common::form_part]
 
-The interface class for any *cgiacceptor.
+ friend std::ostream & operator<<(
+ std::ostream & os,
+ form_part const & part);
 
- template<
- typename RequestAcceptorService >
- class basic_request_acceptor
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.common__basic_request_acceptor.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.native_type [*native_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.next_layer_type [*next_layer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.port_number_type [*port_number_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.service_type [*service_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.accept [*accept]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.assign [*assign]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.async_accept [*async_accept]]]
- [Asynchronously accept one request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor [*basic_request_acceptor]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.bind [*bind]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.close [*close]]]
- [Close the acceptor. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.is_open [*is_open]]]
- [Check if the acceptor is open. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.listen [*listen]]]
- [Set the acceptor to listen. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.local_endpoint [*local_endpoint]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.native [*native]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.open [*open]]]
- [Open the acceptor. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.protocol_service [*protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor._basic_request_acceptor [*~basic_request_acceptor]]]
- []
- ]
-
-]
-
-[section:accept common::basic_request_acceptor::accept]
-
-[indexterm2 accept..common::basic_request_acceptor]
-
- template<
- typename CommonGatewayRequest >
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.accept.overload1 accept]``(
- CommonGatewayRequest & request,
- endpoint_type & ep,
- boost::system::error_code & ec);
-
- template<
- typename CommonGatewayRequest >
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.accept.overload2 accept]``(
- CommonGatewayRequest & request,
- boost::system::error_code & ec);
-
- template<
- typename CommonGatewayRequest >
- void ``[link cgi.reference.common__basic_request_acceptor.accept.overload3 accept]``(
- CommonGatewayRequest & request);
-
-
-[section:overload1 common::basic_request_acceptor::accept (1 of 3 overloads)]
-
-
-
- template<
- typename CommonGatewayRequest >
- boost::system::error_code accept(
- CommonGatewayRequest & request,
- endpoint_type & ep,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::accept (2 of 3 overloads)]
-
-Accept one request.
-
- template<
- typename CommonGatewayRequest >
- boost::system::error_code accept(
- CommonGatewayRequest & request,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload3 common::basic_request_acceptor::accept (3 of 3 overloads)]
-
-Accept one request.
-
- template<
- typename CommonGatewayRequest >
- void accept(
- CommonGatewayRequest & request);
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:assign common::basic_request_acceptor::assign]
-
-[indexterm2 assign..common::basic_request_acceptor]
-
- template<
- typename Protocol >
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.assign.overload1 assign]``(
- Protocol protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
-
- template<
- typename Protocol >
- void ``[link cgi.reference.common__basic_request_acceptor.assign.overload2 assign]``(
- Protocol protocol,
- const native_type & native_acceptor);
-
-
-[section:overload1 common::basic_request_acceptor::assign (1 of 2 overloads)]
-
-
-
- template<
- typename Protocol >
- boost::system::error_code assign(
- Protocol protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::assign (2 of 2 overloads)]
-
-
-
- template<
- typename Protocol >
- void assign(
- Protocol protocol,
- const native_type & native_acceptor);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:async_accept common::basic_request_acceptor::async_accept]
-
-[indexterm2 async_accept..common::basic_request_acceptor] Asynchronously accept one request.
-
- template<
- typename CommonGatewayRequest ,
- typename Handler >
- void async_accept(
- CommonGatewayRequest & request,
- Handler handler);
-
-
-
-[endsect]
-
-
-[section:basic_request_acceptor common::basic_request_acceptor::basic_request_acceptor]
-
-[indexterm2 basic_request_acceptor..common::basic_request_acceptor]
-
- template<
- typename IoServiceProvider ,
- typename InternetProtocol >
- ``[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor.overload1 basic_request_acceptor]``(
- common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
- const InternetProtocol & ip,
- const native_type & native_acceptor);
-
- template<
- typename IoServiceProvider ,
- typename InternetProtocol >
- ``[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor.overload2 basic_request_acceptor]``(
- common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
- const boost::asio::ip::basic_endpoint< InternetProtocol > & endpoint,
- bool reuse_addr = true);
-
- template<
- typename IoServiceProvider >
- ``[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor.overload3 basic_request_acceptor]``(
- common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
- port_number_type port_num = 0);
-
-
-[section:overload1 common::basic_request_acceptor::basic_request_acceptor (1 of 3 overloads)]
-
-
-
- template<
- typename IoServiceProvider ,
- typename InternetProtocol >
- basic_request_acceptor(
- common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
- const InternetProtocol & ip,
- const native_type & native_acceptor);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::basic_request_acceptor (2 of 3 overloads)]
-
-
-
- template<
- typename IoServiceProvider ,
- typename InternetProtocol >
- basic_request_acceptor(
- common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
- const boost::asio::ip::basic_endpoint< InternetProtocol > & endpoint,
- bool reuse_addr = true);
-
-
-
-[endsect]
-
-
-
-[section:overload3 common::basic_request_acceptor::basic_request_acceptor (3 of 3 overloads)]
-
-
-
- template<
- typename IoServiceProvider >
- basic_request_acceptor(
- common::basic_protocol_service< protocol_type, IoServiceProvider > & ps,
- port_number_type port_num = 0);
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:bind common::basic_request_acceptor::bind]
-
-[indexterm2 bind..common::basic_request_acceptor]
-
- template<
- typename Endpoint >
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.bind.overload1 bind]``(
- Endpoint & ep,
- boost::system::error_code & ec);
-
- template<
- typename Endpoint >
- void ``[link cgi.reference.common__basic_request_acceptor.bind.overload2 bind]``(
- Endpoint & ep);
-
-
-[section:overload1 common::basic_request_acceptor::bind (1 of 2 overloads)]
-
-
-
- template<
- typename Endpoint >
- boost::system::error_code bind(
- Endpoint & ep,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::bind (2 of 2 overloads)]
-
-
-
- template<
- typename Endpoint >
- void bind(
- Endpoint & ep);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:cancel common::basic_request_acceptor::cancel]
-
-[indexterm2 cancel..common::basic_request_acceptor] Cancel all asynchronous operations associated with the acceptor.
-
- boost::system::error_code cancel();
-
-
-
-[endsect]
-
-
-[section:close common::basic_request_acceptor::close]
-
-[indexterm2 close..common::basic_request_acceptor] Close the acceptor.
-
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.close.overload1 close]``(
- boost::system::error_code & ec);
-
- void ``[link cgi.reference.common__basic_request_acceptor.close.overload2 close]``();
-
-
-[section:overload1 common::basic_request_acceptor::close (1 of 2 overloads)]
-
-Close the acceptor.
-
- boost::system::error_code close(
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::close (2 of 2 overloads)]
-
-Close the acceptor.
-
- void close();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:endpoint_type common::basic_request_acceptor::endpoint_type]
-
-[indexterm2 endpoint_type..common::basic_request_acceptor]
-
- typedef service_type::endpoint_type endpoint_type;
-
-
-
-
-[endsect]
-
-
-
-[section:is_cgi common::basic_request_acceptor::is_cgi]
-
-[indexterm2 is_cgi..common::basic_request_acceptor]
-
- bool is_cgi();
-
-
-
-[endsect]
-
-
-
-[section:is_open common::basic_request_acceptor::is_open]
-
-[indexterm2 is_open..common::basic_request_acceptor] Check if the acceptor is open.
-
- bool is_open();
-
-
-
-[endsect]
-
-
-[section:listen common::basic_request_acceptor::listen]
-
-[indexterm2 listen..common::basic_request_acceptor] Set the acceptor to listen.
-
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.listen.overload1 listen]``(
- int backlog,
- boost::system::error_code & ec);
-
- void ``[link cgi.reference.common__basic_request_acceptor.listen.overload2 listen]``(
- int backlog = boost::asio::socket_base::max_connections);
-
-
-[section:overload1 common::basic_request_acceptor::listen (1 of 2 overloads)]
-
-Set the acceptor to listen.
-
- boost::system::error_code listen(
- int backlog,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::listen (2 of 2 overloads)]
-
-Set the acceptor to listen.
-
- void listen(
- int backlog = boost::asio::socket_base::max_connections);
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:local_endpoint common::basic_request_acceptor::local_endpoint]
-
-[indexterm2 local_endpoint..common::basic_request_acceptor]
-
- endpoint_type ``[link cgi.reference.common__basic_request_acceptor.local_endpoint.overload1 local_endpoint]``(
- boost::system::error_code & ec) const;
-
- endpoint_type ``[link cgi.reference.common__basic_request_acceptor.local_endpoint.overload2 local_endpoint]``();
-
-
-[section:overload1 common::basic_request_acceptor::local_endpoint (1 of 2 overloads)]
-
-
-
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::local_endpoint (2 of 2 overloads)]
-
-
-
- endpoint_type local_endpoint();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:native common::basic_request_acceptor::native]
-
-[indexterm2 native..common::basic_request_acceptor]
-
- native_type native();
-
-
-
-[endsect]
-
-
-
-[section:native_type common::basic_request_acceptor::native_type]
-
-[indexterm2 native_type..common::basic_request_acceptor]
-
- typedef service_type::native_type native_type;
-
-
-
-
-[endsect]
-
-
-
-[section:next_layer_type common::basic_request_acceptor::next_layer_type]
-
-[indexterm2 next_layer_type..common::basic_request_acceptor]
-
- typedef service_type::implementation_type::acceptor_service_type next_layer_type;
-
-
-
-
-[endsect]
-
-
-[section:open common::basic_request_acceptor::open]
-
-[indexterm2 open..common::basic_request_acceptor] Open the acceptor.
-
- template<
- typename Protocol >
- boost::system::error_code ``[link cgi.reference.common__basic_request_acceptor.open.overload1 open]``(
- const Protocol & protocol,
- boost::system::error_code & ec);
-
- template<
- typename Protocol >
- void ``[link cgi.reference.common__basic_request_acceptor.open.overload2 open]``(
- const Protocol & protocol);
-
-
-[section:overload1 common::basic_request_acceptor::open (1 of 2 overloads)]
-
-Open the acceptor.
-
- template<
- typename Protocol >
- boost::system::error_code open(
- const Protocol & protocol,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_request_acceptor::open (2 of 2 overloads)]
-
-Open the acceptor.
-
- template<
- typename Protocol >
- void open(
- const Protocol & protocol);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:port_number_type common::basic_request_acceptor::port_number_type]
-
-[indexterm2 port_number_type..common::basic_request_acceptor]
-
- typedef service_type::implementation_type::port_number_type port_number_type;
-
-
-
-
-[endsect]
-
-
-
-[section:protocol_service common::basic_request_acceptor::protocol_service]
-
-[indexterm2 protocol_service..common::basic_request_acceptor]
-
- protocol_service_type & protocol_service() const;
-
-
-
-[endsect]
-
-
-
-[section:protocol_service_type common::basic_request_acceptor::protocol_service_type]
-
-[indexterm2 protocol_service_type..common::basic_request_acceptor]
-
- typedef service_type::service_impl_type::protocol_service_type protocol_service_type;
-
-
-
-
-[endsect]
-
-
-
-[section:protocol_type common::basic_request_acceptor::protocol_type]
-
-[indexterm2 protocol_type..common::basic_request_acceptor]
-
- typedef service_type::protocol_type protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:service_type common::basic_request_acceptor::service_type]
-
-[indexterm2 service_type..common::basic_request_acceptor]
-
- typedef RequestAcceptorService service_type;
-
-
-
-
-[endsect]
-
-
-
-[section:_basic_request_acceptor common::basic_request_acceptor::~basic_request_acceptor]
-
-[indexterm2 ~basic_request_acceptor..common::basic_request_acceptor]
-
- ~basic_request_acceptor();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__basic_response common::basic_response]
-
-The response class: a helper for responding to requests.
-
- template<
- typename T>
- class basic_response
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_response.char_type [*char_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_response.ostream_type [*ostream_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_response.self_type [*self_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_response.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_response.async_send [*async_send]]]
- [Asynchronously send the data through the supplied request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.basic_response [*basic_response]]]
- [Construct with a particular buffer. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.charset [*charset]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.clear [*clear]]]
- [Clear the response buffer. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.clear_headers [*clear_headers]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.content_length [*content_length]]]
- [Get the length of the body of the response (ie. not including the headers). ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.do_async_send [*do_async_send]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.end_headers [*end_headers]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.flush [*flush]]]
- [Synchronously flush the data via the supplied request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.header_value [*header_value]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers [*headers]]]
- [Get the headers. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers_terminated [*headers_terminated]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.ostream [*ostream]]]
- [Get the ostream containing the response body. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.rdbuf [*rdbuf]]]
- [Get the buffer associated with the stream. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.resend [*resend]]]
- [Resend headers + content regardless of value of `headers_terminated_`. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.reset [*reset]]]
- [Return the response to the 'just constructed' state. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.reset_headers [*reset_headers]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.send [*send]]]
- [Synchronously send the data via the supplied request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.set_header [*set_header]]]
- [Format and add a header given name and value, appending CRLF. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.set_status [*set_status]]]
- [Set the status code associated with the response. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.status [*status]]]
- [Get the status code associated with the response. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.str [*str]]]
- [Get the contents of the response as a string. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.unterminate_headers [*unterminate_headers]]]
- [Allow more headers to be added (WARNING: avoid using this). ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.write [*write]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response._basic_response [*~basic_response]]]
- []
- ]
-
-]
-
-[heading Protected Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_response.buffer_ [*buffer_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.charset_ [*charset_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers_ [*headers_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers_terminated_ [*headers_terminated_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.http_status_ [*http_status_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.ostream_ [*ostream_]]]
- []
- ]
-
-]
-
-
-[section:async_send common::basic_response::async_send]
-
-[indexterm2 async_send..common::basic_response] Asynchronously send the data through the supplied request.
-
- template<
- typename AsyncWriteStream ,
- typename Handler >
- void async_send(
- AsyncWriteStream & aws,
- Handler handler);
-
-
-Note: This is quite crude at the moment and not as asynchronous as it could/should be. The data in the stream isn't cleared after this call.
-
-
-[endsect]
-
-
-[section:basic_response common::basic_response::basic_response]
-
-[indexterm2 basic_response..common::basic_response] Construct with a particular buffer.
-
- ``[link cgi.reference.common__basic_response.basic_response.overload1 basic_response]``(
- ::cgi::common::streambuf * buf,
- common::http::status_code sc = common::http::ok);
-
- ``[link cgi.reference.common__basic_response.basic_response.overload2 basic_response]``(
- common::http::status_code sc = common::http::ok);
-
-
-[section:overload1 common::basic_response::basic_response (1 of 2 overloads)]
-
-Construct with a particular buffer.
-
- basic_response(
- ::cgi::common::streambuf * buf,
- common::http::status_code sc = common::http::ok);
-
-
-Takes the buffer and uses it internally, does nothing with it on destruction.
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_response::basic_response (2 of 2 overloads)]
-
-
-
- basic_response(
- common::http::status_code sc = common::http::ok);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:buffer_ common::basic_response::buffer_]
-
-[indexterm2 buffer_..common::basic_response]
-
- boost::shared_ptr< common::streambuf > buffer_;
-
-
-
-[endsect]
-
-
-
-[section:char_type common::basic_response::char_type]
-
-[indexterm2 char_type..common::basic_response]
-
- typedef T char_type;
-
-
-
-
-[endsect]
-
-
-
-[section:charset common::basic_response::charset]
-
-[indexterm2 charset..common::basic_response]
-
- string_type & charset();
-
-
-
-[endsect]
-
-
-
-[section:charset_ common::basic_response::charset_]
-
-[indexterm2 charset_..common::basic_response]
-
- string_type charset_;
-
-
-
-[endsect]
-
-
-
-[section:clear common::basic_response::clear]
-
-[indexterm2 clear..common::basic_response] Clear the response buffer.
-
- void clear();
-
-
-
-[endsect]
-
-
-
-[section:clear_headers common::basic_response::clear_headers]
-
-[indexterm2 clear_headers..common::basic_response]
-
- void clear_headers();
-
-
-
-[endsect]
-
-
-
-[section:content_length common::basic_response::content_length]
-
-[indexterm2 content_length..common::basic_response] Get the length of the body of the response (ie. not including the headers).
-
- std::size_t content_length();
-
-
-Get the length of the body of the response.
-
-
-[endsect]
-
-
-
-[section:do_async_send common::basic_response::do_async_send]
-
-[indexterm2 do_async_send..common::basic_response]
-
- template<
- typename AsyncWriteStream ,
- typename Handler >
- void do_async_send(
- AsyncWriteStream & aws,
- Handler handler);
-
-
-
-[endsect]
-
-
-
-[section:end_headers common::basic_response::end_headers]
-
-[indexterm2 end_headers..common::basic_response]
-
- void end_headers();
-
-
-
-[endsect]
-
-
-[section:flush common::basic_response::flush]
-
-[indexterm2 flush..common::basic_response] Synchronously flush the data via the supplied request.
-
- template<
- typename SyncWriteStream >
- boost::system::error_code ``[link cgi.reference.common__basic_response.flush.overload1 flush]``(
- SyncWriteStream & sws,
- boost::system::error_code & ec);
-
- template<
- typename SyncWriteStream >
- void ``[link cgi.reference.common__basic_response.flush.overload2 flush]``(
- SyncWriteStream & sws);
-
-
-[section:overload1 common::basic_response::flush (1 of 2 overloads)]
-
-Synchronously flush the data via the supplied request.
-
- template<
- typename SyncWriteStream >
- boost::system::error_code flush(
- SyncWriteStream & sws,
- boost::system::error_code & ec);
-
-
-This call uses error\_code semantics. ie. ec is set if an error occurs. If there is no error, the buffer is cleared.
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_response::flush (2 of 2 overloads)]
-
-Synchronously flush the data to the supplied SyncWriteStream.
-
- template<
- typename SyncWriteStream >
- void flush(
- SyncWriteStream & sws);
-
-
-This call uses throwing semantics. ie. an exception will be thrown on any failure. If there is no error, the buffer is cleared.
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:header_value common::basic_response::header_value]
-
-[indexterm2 header_value..common::basic_response]
-
- string_type header_value(
- string_type const & name);
-
-
-
-[endsect]
-
-
-
-[section:headers common::basic_response::headers]
-
-[indexterm2 headers..common::basic_response] Get the headers.
-
- std::vector< string_type > & headers();
-
-
-Get the ostream containing the response body.
-
-
-[endsect]
-
-
-
-[section:headers_ common::basic_response::headers_]
-
-[indexterm2 headers_..common::basic_response]
-
- std::vector< string_type > headers_;
-
-
-
-[endsect]
-
-
-
-[section:headers_terminated common::basic_response::headers_terminated]
-
-[indexterm2 headers_terminated..common::basic_response]
-
- bool headers_terminated() const;
-
-
-
-[endsect]
-
-
-
-[section:headers_terminated_ common::basic_response::headers_terminated_]
-
-[indexterm2 headers_terminated_..common::basic_response]
-
- bool headers_terminated_;
-
-
-
-[endsect]
-
-
-
-[section:http_status_ common::basic_response::http_status_]
-
-[indexterm2 http_status_..common::basic_response]
-
- http::status_code http_status_;
-
-
-
-[endsect]
-
-
-
-[section:ostream common::basic_response::ostream]
-
-[indexterm2 ostream..common::basic_response] Get the ostream containing the response body.
-
- ostream_type & ostream();
-
-
-
-[endsect]
-
-
-
-[section:ostream_ common::basic_response::ostream_]
-
-[indexterm2 ostream_..common::basic_response]
-
- ostream_type ostream_;
-
-
-
-[endsect]
-
-
-
-[section:ostream_type common::basic_response::ostream_type]
-
-[indexterm2 ostream_type..common::basic_response]
-
- typedef std::basic_ostream< T > ostream_type;
-
-
-
-
-[endsect]
-
-
-
-[section:rdbuf common::basic_response::rdbuf]
-
-[indexterm2 rdbuf..common::basic_response] Get the buffer associated with the stream.
-
- common::streambuf * rdbuf();
-
-
-
-[endsect]
-
-
-
-[section:resend common::basic_response::resend]
-
-[indexterm2 resend..common::basic_response] Resend headers + content regardless of value of `headers_terminated_`.
-
- template<
- typename SyncWriteStream >
- void resend(
- SyncWriteStream & sws);
-
-
-
-[endsect]
-
-
-
-[section:reset common::basic_response::reset]
-
-[indexterm2 reset..common::basic_response] Return the response to the 'just constructed' state.
-
- void reset();
-
-
-
-[endsect]
-
-
-
-[section:reset_headers common::basic_response::reset_headers]
-
-[indexterm2 reset_headers..common::basic_response]
-
- void reset_headers();
-
-
-
-[endsect]
-
-
-
-[section:self_type common::basic_response::self_type]
-
-[indexterm2 self_type..common::basic_response]
-
- typedef basic_response< T > self_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_response.char_type [*char_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_response.ostream_type [*ostream_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_response.self_type [*self_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_response.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_response.async_send [*async_send]]]
- [Asynchronously send the data through the supplied request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.basic_response [*basic_response]]]
- [Construct with a particular buffer. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.charset [*charset]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.clear [*clear]]]
- [Clear the response buffer. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.clear_headers [*clear_headers]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.content_length [*content_length]]]
- [Get the length of the body of the response (ie. not including the headers). ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.do_async_send [*do_async_send]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.end_headers [*end_headers]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.flush [*flush]]]
- [Synchronously flush the data via the supplied request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.header_value [*header_value]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers [*headers]]]
- [Get the headers. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers_terminated [*headers_terminated]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.ostream [*ostream]]]
- [Get the ostream containing the response body. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.rdbuf [*rdbuf]]]
- [Get the buffer associated with the stream. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.resend [*resend]]]
- [Resend headers + content regardless of value of `headers_terminated_`. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.reset [*reset]]]
- [Return the response to the 'just constructed' state. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.reset_headers [*reset_headers]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.send [*send]]]
- [Synchronously send the data via the supplied request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.set_header [*set_header]]]
- [Format and add a header given name and value, appending CRLF. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.set_status [*set_status]]]
- [Set the status code associated with the response. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.status [*status]]]
- [Get the status code associated with the response. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.str [*str]]]
- [Get the contents of the response as a string. ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.unterminate_headers [*unterminate_headers]]]
- [Allow more headers to be added (WARNING: avoid using this). ]
- ]
-
- [
- [[link cgi.reference.common__basic_response.write [*write]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response._basic_response [*~basic_response]]]
- []
- ]
-
-]
-
-[heading Protected Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_response.buffer_ [*buffer_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.charset_ [*charset_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers_ [*headers_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.headers_terminated_ [*headers_terminated_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.http_status_ [*http_status_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_response.ostream_ [*ostream_]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:send common::basic_response::send]
-
-[indexterm2 send..common::basic_response] Synchronously send the data via the supplied request.
-
- template<
- typename SyncWriteStream >
- boost::system::error_code ``[link cgi.reference.common__basic_response.send.overload1 send]``(
- SyncWriteStream & sws,
- boost::system::error_code & ec);
-
- template<
- typename SyncWriteStream >
- void ``[link cgi.reference.common__basic_response.send.overload2 send]``(
- SyncWriteStream & sws);
-
-
-[section:overload1 common::basic_response::send (1 of 2 overloads)]
-
-Synchronously send the data via the supplied request.
-
- template<
- typename SyncWriteStream >
- boost::system::error_code send(
- SyncWriteStream & sws,
- boost::system::error_code & ec);
-
-
-This call will not throw, but will set `ec` such that `ec == true` if an error occurs. Details of the error are held in the `error\_code` object.
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_response::send (2 of 2 overloads)]
-
-Synchronously send the data via the supplied request.
-
- template<
- typename SyncWriteStream >
- void send(
- SyncWriteStream & sws);
-
-
-This call uses throwing semantics. ie. an exception will be thrown on any failure. Note: The data in the stream isn't cleared after this call.
-
-
-[endsect]
-
-
-[endsect]
-
-[section:set_header common::basic_response::set_header]
-
-[indexterm2 set_header..common::basic_response] Format and add a header given name and value, appending CRLF.
-
- basic_response< char_type > & ``[link cgi.reference.common__basic_response.set_header.overload1 set_header]``(
- string_type const & name,
- string_type const & value);
-
- basic_response< char_type > & ``[link cgi.reference.common__basic_response.set_header.overload2 set_header]``(
- const string_type & value);
-
-
-[section:overload1 common::basic_response::set_header (1 of 2 overloads)]
-
-Format and add a header given name and value, appending CRLF.
-
- basic_response< char_type > & set_header(
- string_type const & name,
- string_type const & value);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_response::set_header (2 of 2 overloads)]
-
-Add a header after appending the CRLF sequence.
-
- basic_response< char_type > & set_header(
- const string_type & value);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:set_status common::basic_response::set_status]
-
-[indexterm2 set_status..common::basic_response] Set the status code associated with the response.
-
- basic_response< char_type > & set_status(
- const http::status_code & num);
-
-
-
-[endsect]
-
-
-
-[section:status common::basic_response::status]
-
-[indexterm2 status..common::basic_response] Get the status code associated with the response.
-
- http::status_code & status();
-
-
-
-[endsect]
-
-
-
-[section:str common::basic_response::str]
-
-[indexterm2 str..common::basic_response] Get the contents of the response as a string.
-
- string_type str() const;
-
-
-Get the response as a string.
-
-This copies the contents of the response into a string. Headers aren't included in the dump.
-
-
-[endsect]
-
-
-
-[section:string_type common::basic_response::string_type]
-
-[indexterm2 string_type..common::basic_response]
-
- typedef std::basic_string< T > string_type;
-
-
-
-
-[endsect]
-
-
-
-[section:unterminate_headers common::basic_response::unterminate_headers]
-
-[indexterm2 unterminate_headers..common::basic_response] Allow more headers to be added (WARNING: avoid using this).
-
- void unterminate_headers();
-
-
-
-[endsect]
-
-
-[section:write common::basic_response::write]
-
-[indexterm2 write..common::basic_response]
-
- template<
- typename T >
- BOOST_CGI_INLINE std::size_t ``[link cgi.reference.common__basic_response.write.overload1 write]``(
- std::basic_string< T > const & str);
-
- template<
- typename ConstBufferSequence >
- std::size_t ``[link cgi.reference.common__basic_response.write.overload2 write]``(
- const ConstBufferSequence & buf);
-
- std::size_t ``[link cgi.reference.common__basic_response.write.overload3 write]``(
- string_type const & str);
-
- std::size_t ``[link cgi.reference.common__basic_response.write.overload4 write]``(
- const char_type * str,
- std::size_t len);
-
-
-[section:overload1 common::basic_response::write (1 of 4 overloads)]
-
-
-
- template<
- typename T >
- BOOST_CGI_INLINE std::size_t write(
- std::basic_string< T > const & str);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::basic_response::write (2 of 4 overloads)]
-
-
-
- template<
- typename ConstBufferSequence >
- std::size_t write(
- const ConstBufferSequence & buf);
-
-
-
-[endsect]
-
-
-
-[section:overload3 common::basic_response::write (3 of 4 overloads)]
-
-
-
- std::size_t write(
- string_type const & str);
-
-
-
-[endsect]
-
-
-
-[section:overload4 common::basic_response::write (4 of 4 overloads)]
-
-
-
- std::size_t write(
- const char_type * str,
- std::size_t len);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:_basic_response common::basic_response::~basic_response]
-
-[indexterm2 ~basic_response..common::basic_response]
-
- ~basic_response();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__charset_header common::charset_header]
-
-
-
- template<
- typename ``[link cgi.reference.CharT CharT]``>
- struct charset_header
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__charset_header.char_type [*char_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__charset_header.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__charset_header.charset_header [*charset_header]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__charset_header.content [*content]]]
- []
- ]
-
-]
-
-
-[section:char_type common::charset_header::char_type]
-
-[indexterm2 char_type..common::charset_header]
-
- typedef CharT char_type;
-
-
-
-
-[endsect]
-
-
-
-[section:charset_header common::charset_header::charset_header]
-
-[indexterm2 charset_header..common::charset_header]
-
- charset_header(
- const string_type & _content);
-
-
-
-[endsect]
-
-
-
-[section:content common::charset_header::content]
-
-[indexterm2 content..common::charset_header]
-
- string_type content;
-
-
-
-[endsect]
-
-
-
-[section:string_type common::charset_header::string_type]
-
-[indexterm2 string_type..common::charset_header]
-
- typedef std::basic_string< CharT > string_type;
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:common__client_status common::client_status]
-
-[indexterm1 common::client_status]
-
- enum client_status
-
-[heading Values]
-[variablelist
-
- [
- [none_]
- []
- ]
-
- [
- [constructed]
- []
- ]
-
- [
- [params_read]
- []
- ]
-
- [
- [stdin_read]
- []
- ]
-
- [
- [end_request_sent]
- []
- ]
-
- [
- [closed_]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:common__connection__stderr common::connection::stderr]
-
-[indexterm1 common::connection::stderr]
-
- typedef basic_connection< tags::stderr > stderr;
-
-
-
-
-[endsect]
-
-
-
-[section:common__cookie_data_type common::cookie_data_type]
-
-[indexterm1 common::cookie_data_type]
-
- enum cookie_data_type
-
-[heading Values]
-[variablelist
-
- [
- [cookies]
- []
- ]
-
- [
- [cookie_data]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:common__env_data_type common::env_data_type]
-
-[indexterm1 common::env_data_type] Types of data sources and related enums.
-
- enum env_data_type
-
-[heading Values]
-[variablelist
-
- [
- [env]
- []
- ]
-
- [
- [env_data]
- []
- ]
-
-]
-
-
-Each data source is given a unique type. This is so the accessor operators on a `basic\_request<>` are compile-time aliases to the internal data maps.
-
-If you want to add a new data type to a request you need to: > Update this file > Update map.hpp with a new map type > Update `data\_map\_type` in the `request\_base` class > Use the `BOOST\_CGI\_DETAIL\_MAP\_ACCESS` macro in `basic\_request<>`, next to the other uses of it.
-
-
-[endsect]
-
-
-
-[section:common__error__cgi_errors common::error::cgi_errors]
-
-[indexterm1 common::error::cgi_errors]
-
- enum cgi_errors
-
-[heading Values]
-[variablelist
-
- [
- [client_closed]
- []
- ]
-
- [
- [duplicate_request]
- []
- ]
-
- [
- [accepting_on_an_open_request]
- []
- ]
-
- [
- [invalid_socket]
- []
- ]
-
- [
- [invalid_form_type]
- []
- ]
-
- [
- [broken_pipe]
- []
- ]
-
- [
- [bad_read]
- []
- ]
-
- [
- [client_not_open]
- []
- ]
-
- [
- [eof]
- []
- ]
-
- [
- [multipart_form_boundary_not_found]
- []
- ]
-
- [
- [multipart_meta_data_not_terminated]
- []
- ]
-
- [
- [no_boundary_marker]
- []
- ]
-
- [
- [max_post_exceeded]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:common__fcgi_ common::fcgi_]
-
-FastCGI.
-
- struct fcgi_
-
-
-
-[endsect]
-
-
-[section:common__form_data_type common::form_data_type]
-
-[indexterm1 common::form_data_type]
-
- enum form_data_type
-
-[heading Values]
-[variablelist
-
- [
- [form]
- []
- ]
-
- [
- [form_data]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:common__form_part common::form_part]
-
-
-
- struct form_part
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__form_part.buffer_type [*buffer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__form_part.iter_t [*iter_t]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__form_part.meta_data_map_type [*meta_data_map_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__form_part.pair_t [*pair_t]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__form_part.range_type [*range_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__form_part.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__form_part.form_part [*form_part]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.operator_eq__eq_ [*operator==]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__form_part.boundary_marker_ [*boundary_marker_]]]
- [The boundary marker that's needed. ]
- ]
-
- [
- [[link cgi.reference.common__form_part.buffer_ [*buffer_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.content_disposition [*content_disposition]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.content_type [*content_type]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.filename [*filename]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.meta_data_ [*meta_data_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.name [*name]]]
- []
- ]
-
- [
- [[link cgi.reference.common__form_part.path [*path]]]
- []
- ]
-
-]
-
-
-[section:boundary_marker_ common::form_part::boundary_marker_]
-
-[indexterm2 boundary_marker_..common::form_part] The boundary marker that's needed.
-
- string_type boundary_marker_;
-
-
-
-[endsect]
-
-
-
-[section:buffer_ common::form_part::buffer_]
-
-[indexterm2 buffer_..common::form_part]
-
- pair_t buffer_;
-
-
-
-[endsect]
-
-
-
-[section:buffer_type common::form_part::buffer_type]
-
-[indexterm2 buffer_type..common::form_part]
-
- typedef string_type buffer_type;
-
-
-
-
-[endsect]
-
-
-
-[section:content_disposition common::form_part::content_disposition]
-
-[indexterm2 content_disposition..common::form_part]
-
- string_type content_disposition;
-
-
-
-[endsect]
-
-
-
-[section:content_type common::form_part::content_type]
-
-[indexterm2 content_type..common::form_part]
-
- string_type content_type;
-
-
-
-[endsect]
-
-
-
-[section:filename common::form_part::filename]
-
-[indexterm2 filename..common::form_part]
-
- string_type filename;
-
-
-
-[endsect]
-
-
-
-[section:form_part common::form_part::form_part]
-
-[indexterm2 form_part..common::form_part]
-
- form_part();
-
-
-
-[endsect]
-
-
-
-[section:iter_t common::form_part::iter_t]
-
-[indexterm2 iter_t..common::form_part]
-
- typedef buffer_type::iterator iter_t;
-
-
-
-
-[endsect]
-
-
-
-[section:meta_data_ common::form_part::meta_data_]
-
-[indexterm2 meta_data_..common::form_part]
-
- meta_data_map_type meta_data_;
-
-
-
-[endsect]
-
-
-
-[section:meta_data_map_type common::form_part::meta_data_map_type]
-
-[indexterm2 meta_data_map_type..common::form_part]
-
- typedef std::map< string_type, pair_t > meta_data_map_type;
-
-
-
-
-[endsect]
-
-
-
-[section:name common::form_part::name]
-
-[indexterm2 name..common::form_part]
-
- string_type name;
-
-
-
-[endsect]
-
-
-
-[section:operator_eq__eq_ common::form_part::operator==]
-
-[indexterm2 operator==..common::form_part]
-
- bool operator==(
- form_part & other);
-
-
-
-[endsect]
-
-
-
-[section:pair_t common::form_part::pair_t]
-
-[indexterm2 pair_t..common::form_part]
-
- typedef std::pair< iter_t, iter_t > pair_t;
-
-
-
-
-[endsect]
-
-
-
-[section:path common::form_part::path]
-
-[indexterm2 path..common::form_part]
-
- string_type path;
-
-
-
-[endsect]
-
-
-
-[section:range_type common::form_part::range_type]
-
-[indexterm2 range_type..common::form_part]
-
- typedef boost::iterator_range< buffer_type::const_iterator > range_type;
-
-
-
-
-[endsect]
-
-
-
-[section:string_type common::form_part::string_type]
-
-[indexterm2 string_type..common::form_part]
-
- typedef std::string string_type;
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:common__get_data_type common::get_data_type]
-
-[indexterm1 common::get_data_type]
-
- enum get_data_type
-
-[heading Values]
-[variablelist
-
- [
- [get]
- []
- ]
-
- [
- [get_data]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:common__http__status_code common::http::status_code]
-
-[indexterm1 common::http::status_code] Standard HTTP status codes.
-
- enum status_code
-
-[heading Values]
-[variablelist
-
- [
- [continue_]
- [Informational codes. ]
- ]
-
- [
- [switching_protocols]
- []
- ]
-
- [
- [processing]
- []
- ]
-
- [
- [ok]
- [Success codes. ]
- ]
-
- [
- [created]
- []
- ]
-
- [
- [accepted]
- []
- ]
-
- [
- [non_authorative_information]
- []
- ]
-
- [
- [no_content]
- []
- ]
-
- [
- [reset_content]
- []
- ]
-
- [
- [partial_content]
- []
- ]
-
- [
- [multi_status]
- []
- ]
-
- [
- [multiple_choices]
- [Redirect codes. ]
- ]
-
- [
- [moved_permanently]
- []
- ]
-
- [
- [found]
- []
- ]
-
- [
- [see_other]
- []
- ]
-
- [
- [not_modified]
- []
- ]
-
- [
- [use_proxy]
- []
- ]
-
- [
- [switch_proxy]
- []
- ]
-
- [
- [temporary_redirect]
- []
- ]
-
- [
- [bad_request]
- [Domain error codes. ]
- ]
-
- [
- [unauthorized]
- []
- ]
-
- [
- [payment_required]
- []
- ]
-
- [
- [forbidden]
- []
- ]
-
- [
- [not_found]
- []
- ]
-
- [
- [method_not_allowed]
- []
- ]
-
- [
- [not_acceptable]
- []
- ]
-
- [
- [proxy_authentication_required]
- []
- ]
-
- [
- [request_timeout]
- []
- ]
-
- [
- [conflict]
- []
- ]
-
- [
- [gone]
- []
- ]
-
- [
- [length_required]
- []
- ]
-
- [
- [precondition_failed]
- []
- ]
-
- [
- [request_entity_too_large]
- []
- ]
-
- [
- [request_uri_too_long]
- []
- ]
-
- [
- [unsupported_media_type]
- []
- ]
-
- [
- [request_range_not_satisfiable]
- []
- ]
-
- [
- [expectation_failed]
- []
- ]
-
- [
- [unprocessable_entity]
- []
- ]
-
- [
- [locked]
- []
- ]
-
- [
- [failed_dependency]
- []
- ]
-
- [
- [unordered_collection]
- []
- ]
-
- [
- [upgrade_required]
- []
- ]
-
- [
- [retry_with]
- []
- ]
-
- [
- [internal_server_error]
- [Internal error codes. ]
- ]
-
- [
- [not_implemented]
- []
- ]
-
- [
- [bad_gateway]
- []
- ]
-
- [
- [service_unavailable]
- []
- ]
-
- [
- [gateway_timeout]
- []
- ]
-
- [
- [http_version_not_supported]
- []
- ]
-
- [
- [insufficient_storage]
- []
- ]
-
- [
- [bandwidth_limit_exceeded]
- []
- ]
-
-]
-
-
-See http://tools.ietf.org/html/rfc2616#section-10
-
-
-[endsect]
-
-
-[section:common__ichar_traits common::ichar_traits]
-
-
-
- template<
- typename CharT >
- struct ichar_traits
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__ichar_traits.compare [*compare]]]
- []
- ]
-
- [
- [[link cgi.reference.common__ichar_traits.eq [*eq]]]
- []
- ]
-
- [
- [[link cgi.reference.common__ichar_traits.find [*find]]]
- []
- ]
-
- [
- [[link cgi.reference.common__ichar_traits.lt [*lt]]]
- []
- ]
-
- [
- [[link cgi.reference.common__ichar_traits.ne [*ne]]]
- []
- ]
-
-]
-
-
-[section:compare common::ichar_traits::compare]
-
-[indexterm2 compare..common::ichar_traits]
-
- static int compare(
- const char * str1,
- const char * str2,
- std::size_t num);
-
-
-
-[endsect]
-
-
-
-[section:eq common::ichar_traits::eq]
-
-[indexterm2 eq..common::ichar_traits]
-
- static bool eq(
- char c1,
- char c2);
-
-
-
-[endsect]
-
-
-
-[section:find common::ichar_traits::find]
-
-[indexterm2 find..common::ichar_traits]
-
- static const char * find(
- const char * str,
- int n,
- char a);
-
-
-
-[endsect]
-
-
-
-[section:lt common::ichar_traits::lt]
-
-[indexterm2 lt..common::ichar_traits]
-
- static bool lt(
- char c1,
- char c2);
-
-
-
-[endsect]
-
-
-
-[section:ne common::ichar_traits::ne]
-
-[indexterm2 ne..common::ichar_traits]
-
- static bool ne(
- char c1,
- char c2);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__io_service_provider common::io_service_provider]
-
-Hold a set number of io_services and return them based on the Policy.
-
- template<
- typename PoolingPolicy >
- class io_service_provider
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__io_service_provider.get_io_service [*get_io_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__io_service_provider.io_service_provider [*io_service_provider]]]
- []
- ]
-
- [
- [[link cgi.reference.common__io_service_provider.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.common__io_service_provider.run [*run]]]
- []
- ]
-
- [
- [[link cgi.reference.common__io_service_provider.stop [*stop]]]
- []
- ]
-
-]
-
-Contains six member functions: io\_service() - returns a reference to an io\_service stop() - stops all io\_services run() - runs all io\_services reset() - resets all io\_services
-
-(strike) stop\_one() - stops one (running) io\_service (strike) run\_one() - runs one (not-yet-started/reset) io\_service
-
-It can also be set up so that only required io\_services are run: each call to io\_service() can get an io\_service, call io\_service::run() on it and then return it.
-
-
-[section:get_io_service common::io_service_provider::get_io_service]
-
-[indexterm2 get_io_service..common::io_service_provider]
-
- ::cgi::common::io_service & get_io_service();
-
-
-
-[endsect]
-
-
-[section:io_service_provider common::io_service_provider::io_service_provider]
-
-[indexterm2 io_service_provider..common::io_service_provider]
-
- ``[link cgi.reference.common__io_service_provider.io_service_provider.overload1 io_service_provider]``();
-
- ``[link cgi.reference.common__io_service_provider.io_service_provider.overload2 io_service_provider]``(
- int );
-
-
-[section:overload1 common::io_service_provider::io_service_provider (1 of 2 overloads)]
-
-
-
- io_service_provider();
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::io_service_provider::io_service_provider (2 of 2 overloads)]
-
-
-
- io_service_provider(
- int );
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:reset common::io_service_provider::reset]
-
-[indexterm2 reset..common::io_service_provider]
-
- void reset();
-
-
-
-[endsect]
-
-
-
-[section:run common::io_service_provider::run]
-
-[indexterm2 run..common::io_service_provider]
-
- void run();
-
-
-
-[endsect]
-
-
-
-[section:stop common::io_service_provider::stop]
-
-[indexterm2 stop..common::io_service_provider]
-
- void stop();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__is_async common::is_async]
-
-
-
- template<
- typename Protocol >
- struct is_async
-
-
-
-[endsect]
-
-[section:common__is_async_lt__tags__cgi__gt_ common::is_async< tags::cgi >]
-
-
-
- template<>
- struct is_async< tags::cgi >
-
-
-
-[endsect]
-
-
-[section:common__parse_options common::parse_options]
-
-[indexterm1 common::parse_options]
-
- enum parse_options
-
-[heading Values]
-[variablelist
-
- [
- [parse_none]
- []
- ]
-
- [
- [parse_env]
- []
- ]
-
- [
- [parse_get_only]
- []
- ]
-
- [
- [parse_get]
- []
- ]
-
- [
- [parse_post_only]
- []
- ]
-
- [
- [parse_post]
- []
- ]
-
- [
- [parse_form]
- []
- ]
-
- [
- [parse_cookie_only]
- []
- ]
-
- [
- [parse_cookie]
- []
- ]
-
- [
- [parse_cookies_only]
- []
- ]
-
- [
- [parse_cookies]
- []
- ]
-
- [
- [parse_all]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:common__path_info common::path_info]
-
-
-
- struct path_info
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__path_info.const_iterator [*const_iterator]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__path_info.iterator [*iterator]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__path_info.value_type [*value_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__path_info.vector_type [*vector_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__path_info.begin [*begin]]]
- []
- ]
-
- [
- [[link cgi.reference.common__path_info.end [*end]]]
- []
- ]
-
- [
- [[link cgi.reference.common__path_info.operator[] [*operator[]]]]
- []
- ]
-
- [
- [[link cgi.reference.common__path_info.path_info [*path_info]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__path_info.parts [*parts]]]
- []
- ]
-
- [
- [[link cgi.reference.common__path_info.value [*value]]]
- []
- ]
-
-]
-
-[section:begin common::path_info::begin]
-
-[indexterm2 begin..common::path_info]
-
- const_iterator ``[link cgi.reference.common__path_info.begin.overload1 begin]``() const;
-
- iterator ``[link cgi.reference.common__path_info.begin.overload2 begin]``();
-
-
-[section:overload1 common::path_info::begin (1 of 2 overloads)]
-
-
-
- const_iterator begin() const;
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::path_info::begin (2 of 2 overloads)]
-
-
-
- iterator begin();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:const_iterator common::path_info::const_iterator]
-
-[indexterm2 const_iterator..common::path_info]
-
- typedef vector_type::const_iterator const_iterator;
-
-
-
-
-[endsect]
-
-
-[section:end common::path_info::end]
-
-[indexterm2 end..common::path_info]
-
- const_iterator ``[link cgi.reference.common__path_info.end.overload1 end]``() const;
-
- iterator ``[link cgi.reference.common__path_info.end.overload2 end]``();
-
-
-[section:overload1 common::path_info::end (1 of 2 overloads)]
-
-
-
- const_iterator end() const;
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::path_info::end (2 of 2 overloads)]
-
-
-
- iterator end();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:iterator common::path_info::iterator]
-
-[indexterm2 iterator..common::path_info]
-
- typedef vector_type::iterator iterator;
-
-
-
-
-[endsect]
-
-
-
-[section:operator[] common::path_info::operator[]]
-
-[indexterm2 operator[]..common::path_info]
-
- value_type & operator[](
- int i);
-
-
-
-[endsect]
-
-
-
-[section:parts common::path_info::parts]
-
-[indexterm2 parts..common::path_info]
-
- vector_type parts;
-
-
-
-[endsect]
-
-
-[section:path_info common::path_info::path_info]
-
-[indexterm2 path_info..common::path_info]
-
- ``[link cgi.reference.common__path_info.path_info.overload1 path_info]``(
- value_type const & str);
-
- template<
- typename S ,
- typename P ,
- typename A >
- ``[link cgi.reference.common__path_info.path_info.overload2 path_info]``(
- basic_request< S, P, A > & request);
-
-
-[section:overload1 common::path_info::path_info (1 of 2 overloads)]
-
-
-
- path_info(
- value_type const & str);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::path_info::path_info (2 of 2 overloads)]
-
-
-
- template<
- typename S ,
- typename P ,
- typename A >
- path_info(
- basic_request< S, P, A > & request);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:value common::path_info::value]
-
-[indexterm2 value..common::path_info]
-
- value_type value;
-
-
-
-[endsect]
-
-
-
-[section:value_type common::path_info::value_type]
-
-[indexterm2 value_type..common::path_info]
-
- typedef std::string value_type;
-
-
-
-
-[endsect]
-
-
-
-[section:vector_type common::path_info::vector_type]
-
-[indexterm2 vector_type..common::path_info]
-
- typedef std::vector< value_type > vector_type;
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:common__post_data_type common::post_data_type]
-
-[indexterm1 common::post_data_type]
-
- enum post_data_type
-
-[heading Values]
-[variablelist
-
- [
- [post]
- []
- ]
-
- [
- [post_data]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:common__request_base common::request_base]
-
-ABC that defines the common interface for basic_request<>s.
-
- template<
- typename T>
- class request_base
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base [*impl_base]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__request_base.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.common__request_base.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
-]
-
-This class provides generic member functions that can be used by any request type.
-
-
-[section:is_file common::request_base::is_file]
-
-[indexterm2 is_file..common::request_base] Check if a given POST variable represents a file upload.
-
- template<
- typename ImplType >
- bool is_file(
- ImplType & impl,
- typename ImplType::string_type const & key);
-
-
-
-[endsect]
-
-
-
-[section:load common::request_base::load]
-
-[indexterm2 load..common::request_base] Synchronously read/parse the request meta-data.
-
- template<
- typename ImplType >
- boost::system::error_code load(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:load_environment common::request_base::load_environment]
-
-[indexterm2 load_environment..common::request_base] Load the base_environment into the current environment.
-
- template<
- typename ImplType >
- void load_environment(
- ImplType & impl,
- char ** base_environment,
- bool is_command_line);
-
-
-Parsed the base\_environment and add it to the current request's environment. This overwrites any environment variables with the existing key.
-
-If `is\_command\_line` is true, then the first argument is skipped as this is the name of the program and ignored. Using it actually causes a crash on Windows (MSVC 9) anyway: I'm not exactly sure why.
-
-
-[endsect]
-
-
-
-[section:parse_cookie_vars common::request_base::parse_cookie_vars]
-
-[indexterm2 parse_cookie_vars..common::request_base] Read and parse the HTTP_COOKIE meta variable.
-
- template<
- typename ImplType >
- boost::system::error_code parse_cookie_vars(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:parse_get_vars common::request_base::parse_get_vars]
-
-[indexterm2 parse_get_vars..common::request_base] Read and parse the cgi GET meta variables.
-
- template<
- typename ImplType >
- boost::system::error_code parse_get_vars(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-[section:read_some common::request_base::read_some]
-
-[indexterm2 read_some..common::request_base] Read some data from the client into the supplied buffer.
-
- template<
- typename ImplType ,
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.common__request_base.read_some.overload1 read_some]``(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
- template<
- typename ImplType >
- std::size_t ``[link cgi.reference.common__request_base.read_some.overload2 read_some]``(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-[section:overload1 common::request_base::read_some (1 of 2 overloads)]
-
-Read some data from the client into the supplied buffer.
-
- template<
- typename ImplType ,
- typename MutableBufferSequence >
- std::size_t read_some(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::request_base::read_some (2 of 2 overloads)]
-
-Read some data into the internal buffer.
-
- template<
- typename ImplType >
- std::size_t read_some(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:request_id common::request_base::request_id]
-
-[indexterm2 request_id..common::request_base] Get the request ID of a FastCGI request, or 1.
-
- template<
- typename ImplType >
- boost::uint16_t const & request_id(
- ImplType & impl) const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__request_base__impl_base common::request_base::impl_base]
-
-
-
- struct impl_base
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base.buffer_type [*buffer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base.char_type [*char_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base.string_type [*string_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_base__impl_base.var_map_type [*var_map_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__request_base__impl_base.impl_base [*impl_base]]]
- [Construct. ]
- ]
-
- [
- [[link cgi.reference.common__request_base__impl_base.prepare [*prepare]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__request_base__impl_base.env_parsed_ [*env_parsed_]]]
- [Whether the environment has been parsed yet. ]
- ]
-
- [
- [[link cgi.reference.common__request_base__impl_base.form_parts_ [*form_parts_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_base__impl_base.get_parsed_ [*get_parsed_]]]
- [Whether the get data has been parsed yet. ]
- ]
-
- [
- [[link cgi.reference.common__request_base__impl_base.post_buffer_ [*post_buffer_]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_base__impl_base.vars_ [*vars_]]]
- []
- ]
-
-]
-
-
-[section:buffer_type common::request_base::impl_base::buffer_type]
-
-[indexterm2 buffer_type..common::request_base::impl_base]
-
- typedef string_type buffer_type;
-
-
-
-
-[endsect]
-
-
-
-[section:char_type common::request_base::impl_base::char_type]
-
-[indexterm2 char_type..common::request_base::impl_base]
-
- typedef char char_type;
-
-
-
-
-[endsect]
-
-
-
-[section:const_buffers_type common::request_base::impl_base::const_buffers_type]
-
-[indexterm2 const_buffers_type..common::request_base::impl_base]
-
- typedef boost::asio::const_buffers_1 const_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:env_parsed_ common::request_base::impl_base::env_parsed_]
-
-[indexterm2 env_parsed_..common::request_base::impl_base] Whether the environment has been parsed yet.
-
- bool env_parsed_;
-
-
-
-[endsect]
-
-
-
-[section:form_parts_ common::request_base::impl_base::form_parts_]
-
-[indexterm2 form_parts_..common::request_base::impl_base]
-
- std::vector< common::form_part > form_parts_;
-
-
-
-[endsect]
-
-
-
-[section:get_parsed_ common::request_base::impl_base::get_parsed_]
-
-[indexterm2 get_parsed_..common::request_base::impl_base] Whether the get data has been parsed yet.
-
- bool get_parsed_;
-
-
-
-[endsect]
-
-
-
-[section:impl_base common::request_base::impl_base::impl_base]
-
-[indexterm2 impl_base..common::request_base::impl_base] Construct.
-
- impl_base();
-
-
-
-[endsect]
-
-
-
-[section:mutable_buffers_type common::request_base::impl_base::mutable_buffers_type]
-
-[indexterm2 mutable_buffers_type..common::request_base::impl_base]
-
- typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:post_buffer_ common::request_base::impl_base::post_buffer_]
-
-[indexterm2 post_buffer_..common::request_base::impl_base]
-
- buffer_type post_buffer_;
-
-
-
-[endsect]
-
-
-
-[section:prepare common::request_base::impl_base::prepare]
-
-[indexterm2 prepare..common::request_base::impl_base]
-
- mutable_buffers_type prepare(
- std::size_t size);
-
-
-
-[endsect]
-
-
-
-[section:string_type common::request_base::impl_base::string_type]
-
-[indexterm2 string_type..common::request_base::impl_base]
-
- typedef std::basic_string< char_type > string_type;
-
-
-
-
-[endsect]
-
-
-
-[section:var_map_type common::request_base::impl_base::var_map_type]
-
-[indexterm2 var_map_type..common::request_base::impl_base]
-
- typedef boost::fusion::vector< common::env_map, common::get_map, common::post_map, common::cookie_map, common::session_map > var_map_type;
-
-
-
-If you want to add a new data type to a request you need to: > Update this file (just below) > Update source_enums.hpp > Update map.hpp with a new map type > Use the `BOOST\_CGI\_DETAIL\_MAP\_ACCESS` macro in `basic\_request<>`, next to the other uses of it.
-
-
-[endsect]
-
-
-
-[section:vars_ common::request_base::impl_base::vars_]
-
-[indexterm2 vars_..common::request_base::impl_base]
-
- var_map_type vars_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:common__request_service common::request_service]
-
-The generic service class for basic_request<>s.
-
- template<
- typename Protocol >
- class request_service
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__request_service.impl_type [*impl_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_service.implementation_type [*implementation_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_service.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__request_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__request_service.async_load [*async_load]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.load [*load]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.null [*null]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.request_service [*request_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.set_header [*set_header]]]
- []
- ]
-
- [
- [[link cgi.reference.common__request_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__request_service.id [*id]]]
- []
- ]
-
-]
-
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
-
-
-[section:async_load common::request_service::async_load]
-
-[indexterm2 async_load..common::request_service]
-
- template<
- typename Handler >
- void async_load(
- impl_type & impl,
- bool parse_stdin,
- Handler handler);
-
-
-
-[endsect]
-
-
-
-[section:construct common::request_service::construct]
-
-[indexterm2 construct..common::request_service]
-
- void construct(
- impl_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:destroy common::request_service::destroy]
-
-[indexterm2 destroy..common::request_service]
-
- void destroy(
- impl_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:id common::request_service::id]
-
-[indexterm2 id..common::request_service]
-
- static boost::asio::detail::service_id< request_service< Protocol > > id;
-
-
-
-[endsect]
-
-
-
-[section:impl_type common::request_service::impl_type]
-
-[indexterm2 impl_type..common::request_service]
-
- typedef service_impl_type::impl_type impl_type;
-
-
-
-
-[endsect]
-
-
-
-[section:implementation_type common::request_service::implementation_type]
-
-[indexterm2 implementation_type..common::request_service]
-
- typedef service_impl_type::implementation_type implementation_type;
-
-
-
-
-[endsect]
-
-
-
-[section:is_open common::request_service::is_open]
-
-[indexterm2 is_open..common::request_service]
-
- bool is_open(
- impl_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:load common::request_service::load]
-
-[indexterm2 load..common::request_service]
-
- boost::system::error_code & load(
- impl_type & impl,
- bool parse_stdin,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:null common::request_service::null]
-
-[indexterm2 null..common::request_service]
-
- impl_type null() const;
-
-
-
-[endsect]
-
-
-
-[section:protocol_service_type common::request_service::protocol_service_type]
-
-[indexterm2 protocol_service_type..common::request_service]
-
- typedef common::basic_protocol_service< Protocol > protocol_service_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
- []
- ]
-
-]
-
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
-
-
-
-[endsect]
-
-
-
-[section:protocol_type common::request_service::protocol_type]
-
-[indexterm2 protocol_type..common::request_service]
-
- typedef Protocol protocol_type;
-
-
-
-
-[endsect]
-
-
-[section:request_service common::request_service::request_service]
-
-[indexterm2 request_service..common::request_service]
-
- ``[link cgi.reference.common__request_service.request_service.overload1 request_service]``(
- protocol_service_type & ps);
-
- ``[link cgi.reference.common__request_service.request_service.overload2 request_service]``(
- ::cgi::common::io_service & ios);
-
-
-[section:overload1 common::request_service::request_service (1 of 2 overloads)]
-
-
-
- request_service(
- protocol_service_type & ps);
-
-
-
-[endsect]
-
-
-
-[section:overload2 common::request_service::request_service (2 of 2 overloads)]
-
-
-
- request_service(
- ::cgi::common::io_service & ios);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:set_header common::request_service::set_header]
-
-[indexterm2 set_header..common::request_service]
-
- boost::system::error_code & set_header(
- impl_type & impl,
- const std::string & name,
- const std::string & value,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:shutdown_service common::request_service::shutdown_service]
-
-[indexterm2 shutdown_service..common::request_service]
-
- void shutdown_service();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:common__request_status common::request_status]
-
-[indexterm1 common::request_status]
-
- enum request_status
-
-[heading Values]
-[variablelist
-
- [
- [null]
- []
- ]
-
- [
- [unloaded]
- []
- ]
-
- [
- [activated]
- []
- ]
-
- [
- [accepted]
- []
- ]
-
- [
- [env_read]
- []
- ]
-
- [
- [loaded]
- []
- ]
-
- [
- [ok]
- []
- ]
-
- [
- [aborted]
- []
- ]
-
- [
- [closed]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:common__scgi_ common::scgi_]
-
-SCGI (note, this must be removed).
-
- struct scgi_
-
-
-
-[endsect]
-
-
-[section:common__session_data_type common::session_data_type]
-
-[indexterm1 common::session_data_type]
-
- enum session_data_type
-
-[heading Values]
-[variablelist
-
- [
- [session]
- []
- ]
-
- [
- [session_data]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:common__tags__acgi common::tags::acgi]
-
-
-
- struct acgi
-
-
-
-[endsect]
-
-[section:common__tags__async_cgi common::tags::async_cgi]
-
-
-
- struct async_cgi
-
-
-
-[endsect]
-
-[section:common__tags__async_stdio common::tags::async_stdio]
-
-
-
- struct async_stdio
-
-
-
-[endsect]
-
-[section:common__tags__cgi common::tags::cgi]
-
-
-
- struct cgi
-
-
-
-[endsect]
-
-[section:common__tags__fcgi common::tags::fcgi]
-
-
-
- struct fcgi
-
-
-
-[endsect]
-
-[section:common__tags__null common::tags::null]
-
-
-
- struct null
-
-
-
-[endsect]
-
-[section:common__tags__round_robin common::tags::round_robin]
-
-
-
- struct round_robin
-
-
-
-[endsect]
-
-[section:common__tags__scgi common::tags::scgi]
-
-
-
- struct scgi
-
-
-
-[endsect]
-
-[section:common__tags__service_pool common::tags::service_pool]
-
-
-
- struct service_pool
-
-
-
-[endsect]
-
-[section:common__tags__shareable_tcp_socket common::tags::shareable_tcp_socket]
-
-
-
- struct shareable_tcp_socket
-
-
-
-[endsect]
-
-[section:common__tags__single_service common::tags::single_service]
-
-
-
- struct single_service
-
-
-
-[endsect]
-
-[section:common__tags__stdio common::tags::stdio]
-
-
-
- struct stdio
-
-
-
-[endsect]
-
-[section:common__tags__tcp_socket common::tags::tcp_socket]
-
-
-
- struct tcp_socket
-
-
-
-[endsect]
-
-[section:connection_base connection_base]
-
-Abstract Base Class for all connection types.
-
- class connection_base
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.connection_base._connection_base [*~connection_base]]]
- []
- ]
-
-]
-
-
-[section:_connection_base connection_base::~connection_base]
-
-[indexterm2 ~connection_base..connection_base]
-
- ~connection_base();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:connections__async_stdio connections::async_stdio]
-
-[indexterm1 connections::async_stdio]
-
- typedef common::basic_connection< common::tags::async_stdio > async_stdio;
-
-
-
-
-[endsect]
-
-
-
-[section:connections__shareable_tcp connections::shareable_tcp]
-
-[indexterm1 connections::shareable_tcp]
-
- typedef common::basic_connection< common::tags::shareable_tcp_socket > shareable_tcp;
-
-
-
-
-[endsect]
-
-
-
-[section:connections__stdio connections::stdio]
-
-[indexterm1 connections::stdio]
-
- typedef common::basic_connection< common::tags::stdio > stdio;
-
-
-
-
-[endsect]
-
-
-
-[section:connections__tcp connections::tcp]
-
-[indexterm1 connections::tcp]
-
- typedef common::basic_connection< common::tags::tcp_socket > tcp;
-
-
-
-
-[endsect]
-
-
-
-[section:error__fcgi_errors error::fcgi_errors]
-
-[indexterm1 error::fcgi_errors]
-
- enum fcgi_errors
-
-[heading Values]
-[variablelist
-
- [
- [bad_header_type]
- []
- ]
-
- [
- [bad_request_id]
- [A packet arrived for a request id that doesn't exist and the packet wasn't a BEGIN_REQUEST record. ]
- ]
-
- [
- [couldnt_write_complete_packet]
- [When trying to write a packet, the client::write_some() call didn't. ]
- ]
-
- [
- [client_closed]
- []
- ]
-
- [
- [abort_request_record_recieved_for_invalid_request]
- []
- ]
-
- [
- [multiplexed_request_incoming]
- []
- ]
-
- [
- [duplicate_request]
- []
- ]
-
- [
- [accepting_on_an_open_request]
- []
- ]
-
- [
- [invalid_socket]
- []
- ]
-
- [
- [invalid_form_type]
- []
- ]
-
- [
- [broken_pipe]
- []
- ]
-
- [
- [bad_read]
- []
- ]
-
- [
- [bad_write]
- []
- ]
-
- [
- [client_not_open]
- []
- ]
-
- [
- [multiplexing_not_supported]
- []
- ]
-
- [
- [eof]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fcgi__acceptor fcgi::acceptor]
-
-[indexterm1 fcgi::acceptor] Typedef for common usage (FCGI).
-
- typedef ::cgi::common::basic_request_acceptor< fcgi_request_acceptor_service<> > acceptor;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.native_type [*native_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.next_layer_type [*next_layer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.port_number_type [*port_number_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_request_acceptor.service_type [*service_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.accept [*accept]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.assign [*assign]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.async_accept [*async_accept]]]
- [Asynchronously accept one request. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.basic_request_acceptor [*basic_request_acceptor]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.bind [*bind]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.close [*close]]]
- [Close the acceptor. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.is_open [*is_open]]]
- [Check if the acceptor is open. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.listen [*listen]]]
- [Set the acceptor to listen. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.local_endpoint [*local_endpoint]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.native [*native]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.open [*open]]]
- [Open the acceptor. ]
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor.protocol_service [*protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_request_acceptor._basic_request_acceptor [*~basic_request_acceptor]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:fcgi__acceptor_service_impl fcgi::acceptor_service_impl]
-
-The service_impl class for FCGI basic_request_acceptor<>s.
-
- template<
- typename Protocol_ = ::cgi::common::fcgi_>
- class acceptor_service_impl
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type [*implementation_type]]]
- [The unique service identifier. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.native_protocol_type [*native_protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.native_type [*native_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.type [*type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.accept [*accept]]]
- [Accepts one request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_impl [*acceptor_service_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.assign [*assign]]]
- [Assign an existing native acceptor to a *socket* acceptor. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.async_accept [*async_accept]]]
- [Asynchronously accepts one request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.bind [*bind]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.check_for_waiting_request [*check_for_waiting_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.close [*close]]]
- [Close the acceptor (not implemented yet). ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.default_init [*default_init]]]
- [Default-initialize the acceptor. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.get_protocol_service [*get_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.is_open [*is_open]]]
- [Check if the given implementation is open. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.listen [*listen]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.local_endpoint [*local_endpoint]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.native [*native]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.open [*open]]]
- [Open a new *socket* acceptor implementation. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.service [*service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.set_protocol_service [*set_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.shutdown_service [*shutdown_service]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_ [*acceptor_service_]]]
- [The underlying socket acceptor service. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.id [*id]]]
- []
- ]
-
-]
-
-Note: this is near enough to being generic. It will hopefully translate directly to the fcgi\_acceptor\_service\_impl. In other words you would then have one acceptor\_service\_impl<>, so you'd use acceptor\_service\_impl<scgi> acceptor\_service\_impl\_; // and acceptor\_service\_impl<fcgi> acceptor\_service\_impl\_; // etc...
-
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
-
-
-[section:accept fcgi::acceptor_service_impl::accept]
-
-[indexterm2 accept..fcgi::acceptor_service_impl] Accepts one request.
-
- template<
- typename CommonGatewayRequest >
- boost::system::error_code accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- endpoint_type * endpoint,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:acceptor_service_ fcgi::acceptor_service_impl::acceptor_service_]
-
-[indexterm2 acceptor_service_..fcgi::acceptor_service_impl] The underlying socket acceptor service.
-
- acceptor_service_type & acceptor_service_;
-
-
-
-[endsect]
-
-
-
-[section:acceptor_service_impl fcgi::acceptor_service_impl::acceptor_service_impl]
-
-[indexterm2 acceptor_service_impl..fcgi::acceptor_service_impl]
-
- acceptor_service_impl(
- ::cgi::common::io_service & ios);
-
-
-
-[endsect]
-
-
-
-[section:acceptor_service_type fcgi::acceptor_service_impl::acceptor_service_type]
-
-[indexterm2 acceptor_service_type..fcgi::acceptor_service_impl]
-
- typedef type::implementation_type::acceptor_service_type acceptor_service_type;
-
-
-
-
-[endsect]
-
-
-
-[section:assign fcgi::acceptor_service_impl::assign]
-
-[indexterm2 assign..fcgi::acceptor_service_impl] Assign an existing native acceptor to a *socket* acceptor.
-
- boost::system::error_code assign(
- implementation_type & impl,
- const native_protocol_type & protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:async_accept fcgi::acceptor_service_impl::async_accept]
-
-[indexterm2 async_accept..fcgi::acceptor_service_impl] Asynchronously accepts one request.
-
- template<
- typename Handler >
- void async_accept(
- implementation_type & impl,
- typename implementation_type::request_type & request,
- Handler handler);
-
-
-
-[endsect]
-
-
-
-[section:bind fcgi::acceptor_service_impl::bind]
-
-[indexterm2 bind..fcgi::acceptor_service_impl]
-
- template<
- typename Endpoint >
- boost::system::error_code bind(
- implementation_type & impl,
- const Endpoint & endpoint,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:check_for_waiting_request fcgi::acceptor_service_impl::check_for_waiting_request]
-
-[indexterm2 check_for_waiting_request..fcgi::acceptor_service_impl]
-
- template<
- typename CommonGatewayRequest ,
- typename Handler >
- int check_for_waiting_request(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Handler handler);
-
-
-
-[endsect]
-
-
-
-[section:close fcgi::acceptor_service_impl::close]
-
-[indexterm2 close..fcgi::acceptor_service_impl] Close the acceptor (not implemented yet).
-
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:construct fcgi::acceptor_service_impl::construct]
-
-[indexterm2 construct..fcgi::acceptor_service_impl]
-
- void construct(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:default_init fcgi::acceptor_service_impl::default_init]
-
-[indexterm2 default_init..fcgi::acceptor_service_impl] Default-initialize the acceptor.
-
- boost::system::error_code default_init(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:destroy fcgi::acceptor_service_impl::destroy]
-
-[indexterm2 destroy..fcgi::acceptor_service_impl]
-
- void destroy(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:endpoint_type fcgi::acceptor_service_impl::endpoint_type]
-
-[indexterm2 endpoint_type..fcgi::acceptor_service_impl]
-
- typedef type::implementation_type::endpoint_type endpoint_type;
-
-
-
-
-[endsect]
-
-
-
-[section:get_protocol_service fcgi::acceptor_service_impl::get_protocol_service]
-
-[indexterm2 get_protocol_service..fcgi::acceptor_service_impl]
-
- protocol_service_type & get_protocol_service(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:id fcgi::acceptor_service_impl::id]
-
-[indexterm2 id..fcgi::acceptor_service_impl]
-
- static boost::asio::detail::service_id< ::cgi::fcgi::acceptor_service_impl< Protocol_ > > id;
-
-
-
-[endsect]
-
-
-
-[section:is_cgi fcgi::acceptor_service_impl::is_cgi]
-
-[indexterm2 is_cgi..fcgi::acceptor_service_impl]
-
- bool is_cgi(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:is_open fcgi::acceptor_service_impl::is_open]
-
-[indexterm2 is_open..fcgi::acceptor_service_impl] Check if the given implementation is open.
-
- bool is_open(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:listen fcgi::acceptor_service_impl::listen]
-
-[indexterm2 listen..fcgi::acceptor_service_impl]
-
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:local_endpoint fcgi::acceptor_service_impl::local_endpoint]
-
-[indexterm2 local_endpoint..fcgi::acceptor_service_impl]
-
- implementation_type::endpoint_type local_endpoint(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:native fcgi::acceptor_service_impl::native]
-
-[indexterm2 native..fcgi::acceptor_service_impl]
-
- native_type native(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:native_protocol_type fcgi::acceptor_service_impl::native_protocol_type]
-
-[indexterm2 native_protocol_type..fcgi::acceptor_service_impl]
-
- typedef type::implementation_type::native_protocol_type native_protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:native_type fcgi::acceptor_service_impl::native_type]
-
-[indexterm2 native_type..fcgi::acceptor_service_impl]
-
- typedef acceptor_service_type::native_type native_type;
-
-
-
-
-[endsect]
-
-
-
-[section:open fcgi::acceptor_service_impl::open]
-
-[indexterm2 open..fcgi::acceptor_service_impl] Open a new *socket* acceptor implementation.
-
- boost::system::error_code open(
- implementation_type & impl,
- const native_protocol_type & protocol,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:protocol_service_type fcgi::acceptor_service_impl::protocol_service_type]
-
-[indexterm2 protocol_service_type..fcgi::acceptor_service_impl]
-
- typedef type::implementation_type::protocol_service_type protocol_service_type;
-
-
-
-
-[endsect]
-
-
-
-[section:protocol_type fcgi::acceptor_service_impl::protocol_type]
-
-[indexterm2 protocol_type..fcgi::acceptor_service_impl]
-
- typedef type::implementation_type::protocol_type protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:service fcgi::acceptor_service_impl::service]
-
-[indexterm2 service..fcgi::acceptor_service_impl]
-
- protocol_service_type & service(
- implementation_type const & impl) const;
-
-
-
-[endsect]
-
-
-
-[section:set_protocol_service fcgi::acceptor_service_impl::set_protocol_service]
-
-[indexterm2 set_protocol_service..fcgi::acceptor_service_impl]
-
- void set_protocol_service(
- implementation_type & impl,
- protocol_service_type & ps);
-
-
-
-[endsect]
-
-
-
-[section:shutdown_service fcgi::acceptor_service_impl::shutdown_service]
-
-[indexterm2 shutdown_service..fcgi::acceptor_service_impl]
-
- void shutdown_service();
-
-
-
-[endsect]
-
-
-
-[section:type fcgi::acceptor_service_impl::type]
-
-[indexterm2 type..fcgi::acceptor_service_impl]
-
- typedef acceptor_service_impl< Protocol_ > type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type [*implementation_type]]]
- [The unique service identifier. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.native_protocol_type [*native_protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.native_type [*native_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.type [*type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.accept [*accept]]]
- [Accepts one request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_impl [*acceptor_service_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.assign [*assign]]]
- [Assign an existing native acceptor to a *socket* acceptor. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.async_accept [*async_accept]]]
- [Asynchronously accepts one request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.bind [*bind]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.check_for_waiting_request [*check_for_waiting_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.close [*close]]]
- [Close the acceptor (not implemented yet). ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.default_init [*default_init]]]
- [Default-initialize the acceptor. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.get_protocol_service [*get_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.is_open [*is_open]]]
- [Check if the given implementation is open. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.listen [*listen]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.local_endpoint [*local_endpoint]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.native [*native]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.open [*open]]]
- [Open a new *socket* acceptor implementation. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.service [*service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.set_protocol_service [*set_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.shutdown_service [*shutdown_service]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_ [*acceptor_service_]]]
- [The underlying socket acceptor service. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.id [*id]]]
- []
- ]
-
-]
-
-Note: this is near enough to being generic. It will hopefully translate directly to the fcgi\_acceptor\_service\_impl. In other words you would then have one acceptor\_service\_impl<>, so you'd use acceptor\_service\_impl<scgi> acceptor\_service\_impl\_; // and acceptor\_service\_impl<fcgi> acceptor\_service\_impl\_; // etc...
-
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__acceptor_service_impl__implementation_type fcgi::acceptor_service_impl::implementation_type]
-
-The unique service identifier.
-
- struct implementation_type
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.native_protocol_type [*native_protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.port_number_type [*port_number_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.request_type [*request_type]]]
- []
-
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.acceptor_ [*acceptor_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.endpoint_ [*endpoint_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.mutex_ [*mutex_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.port_num_ [*port_num_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.service_ [*service_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.waiting_requests_ [*waiting_requests_]]]
- []
- ]
-
-]
-
-
-[section:acceptor_ fcgi::acceptor_service_impl::implementation_type::acceptor_]
-
-[indexterm2 acceptor_..fcgi::acceptor_service_impl::implementation_type]
-
- acceptor_service_type::implementation_type acceptor_;
-
-
-
-[endsect]
-
-
-
-[section:acceptor_service_type fcgi::acceptor_service_impl::implementation_type::acceptor_service_type]
-
-[indexterm2 acceptor_service_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef boost::asio::socket_acceptor_service< native_protocol_type > acceptor_service_type;
-
-
-
-
-[endsect]
-
-
-
-[section:endpoint_ fcgi::acceptor_service_impl::implementation_type::endpoint_]
-
-[indexterm2 endpoint_..fcgi::acceptor_service_impl::implementation_type]
-
- endpoint_type endpoint_;
-
-
-
-[endsect]
-
-
-
-[section:endpoint_type fcgi::acceptor_service_impl::implementation_type::endpoint_type]
-
-[indexterm2 endpoint_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef boost::asio::ip::tcp::endpoint endpoint_type;
-
-
-
-
-[endsect]
-
-
-
-[section:mutex_ fcgi::acceptor_service_impl::implementation_type::mutex_]
-
-[indexterm2 mutex_..fcgi::acceptor_service_impl::implementation_type]
-
- boost::mutex mutex_;
-
-
-
-[endsect]
-
-
-
-[section:native_protocol_type fcgi::acceptor_service_impl::implementation_type::native_protocol_type]
-
-[indexterm2 native_protocol_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef boost::asio::ip::tcp native_protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:port_num_ fcgi::acceptor_service_impl::implementation_type::port_num_]
-
-[indexterm2 port_num_..fcgi::acceptor_service_impl::implementation_type]
-
- port_number_type port_num_;
-
-
-
-[endsect]
-
-
-
-[section:port_number_type fcgi::acceptor_service_impl::implementation_type::port_number_type]
-
-[indexterm2 port_number_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef unsigned short port_number_type;
-
-
-
-
-[endsect]
-
-
-
-[section:protocol_service_type fcgi::acceptor_service_impl::implementation_type::protocol_service_type]
-
-[indexterm2 protocol_service_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef common::basic_protocol_service< protocol_type > protocol_service_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
- []
- ]
-
-]
-
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
-
-
-
-[endsect]
-
-
-
-[section:protocol_type fcgi::acceptor_service_impl::implementation_type::protocol_type]
-
-[indexterm2 protocol_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef Protocol_ protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:request_type fcgi::acceptor_service_impl::implementation_type::request_type]
-
-[indexterm2 request_type..fcgi::acceptor_service_impl::implementation_type]
-
- typedef fcgi::request request_type;
-
-
-
-
-[endsect]
-
-
-
-[section:service_ fcgi::acceptor_service_impl::implementation_type::service_]
-
-[indexterm2 service_..fcgi::acceptor_service_impl::implementation_type]
-
- protocol_service_type * service_;
-
-
-
-[endsect]
-
-
-
-[section:waiting_requests_ fcgi::acceptor_service_impl::implementation_type::waiting_requests_]
-
-[indexterm2 waiting_requests_..fcgi::acceptor_service_impl::implementation_type]
-
- std::queue< boost::shared_ptr< request_type > > waiting_requests_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:fcgi__client fcgi::client]
-
-[indexterm1 fcgi::client]
-
- typedef common::basic_client< connections::shareable_tcp,::cgi::common::fcgi_ > client;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
- [Asynchronously read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
- [Asynchronously write some data to the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.connection [*connection]]]
- [Get a shared_ptr of the connection associated with the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.read_some [*read_some]]]
- [Read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
- [Associate a connection with this client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.write_some [*write_some]]]
- [Write some data to the client. ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
- []
- ]
-
-]
-
-A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
-
-
-
-[endsect]
-
-
-[section:fcgi__fcgi_request_service fcgi::fcgi_request_service]
-
-The IoObjectService class for a FCGI basic_request<>s.
-
- class fcgi_request_service :
- public common::request_base< fcgi_request_service >
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__callback_functor [*callback_functor]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an FCGI request. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.full_type [*full_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.proc_func_t [*proc_func_t]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.self_type [*self_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.async_load [*async_load]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.begin_request_helper [*begin_request_helper]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.clear [*clear]]]
- [Clear all request data (object is then safe to remove). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.client [*client]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.close [*close]]]
- [Close the request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.fcgi_request_service [*fcgi_request_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_admin_request [*handle_admin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_other_request_header [*handle_other_request_header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.params_read [*params_read]]]
- [Returns true if the request environment params have been read. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_body [*parse_body]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_header [*parse_header]]]
- [Parse the current header. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_packet [*parse_packet]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_abort_request [*process_abort_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_begin_request [*process_begin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_params [*process_params]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_stdin [*process_stdin]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_body [*read_body]]]
- [Read the body of the current packet; do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_env_vars [*read_env_vars]]]
- [Read in the FastCGI (env) params. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_header [*read_header]]]
- [Read a single header, buf do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_service [*set_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_status [*set_status]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service._fcgi_request_service [*~fcgi_request_service]]]
- []
- ]
-
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.id [*id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.proc_funcs [*proc_funcs]]]
- []
- ]
-
-]
-
-
-[section:async_load fcgi::fcgi_request_service::async_load]
-
-[indexterm2 async_load..fcgi::fcgi_request_service]
-
- template<
- typename Handler >
- void async_load(
- implementation_type & impl,
- bool parse_stdin,
- Handler handler);
-
-
-
-[endsect]
-
-
-
-[section:clear fcgi::fcgi_request_service::clear]
-
-[indexterm2 clear..fcgi::fcgi_request_service] Clear all request data (object is then safe to remove).
-
- void clear(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:client fcgi::fcgi_request_service::client]
-
-[indexterm2 client..fcgi::fcgi_request_service]
-
- implementation_type::client_type & client(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-[section:close fcgi::fcgi_request_service::close]
-
-[indexterm2 close..fcgi::fcgi_request_service] Close the request.
-
- int ``[link cgi.reference.fcgi__fcgi_request_service.close.overload1 close]``(
- implementation_type & impl,
- ::cgi::common::http::status_code & hsc,
- int program_status,
- boost::system::error_code & ec);
-
- int ``[link cgi.reference.fcgi__fcgi_request_service.close.overload2 close]``(
- implementation_type & impl,
- ::cgi::common::http::status_code & hsc,
- int program_status);
-
-
-[section:overload1 fcgi::fcgi_request_service::close (1 of 2 overloads)]
-
-Close the request.
-
- int close(
- implementation_type & impl,
- ::cgi::common::http::status_code & hsc,
- int program_status,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::fcgi_request_service::close (2 of 2 overloads)]
-
-Close the request.
-
- int close(
- implementation_type & impl,
- ::cgi::common::http::status_code & hsc,
- int program_status);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:construct fcgi::fcgi_request_service::construct]
-
-[indexterm2 construct..fcgi::fcgi_request_service]
-
- void construct(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:destroy fcgi::fcgi_request_service::destroy]
-
-[indexterm2 destroy..fcgi::fcgi_request_service]
-
- void destroy(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:fcgi_request_service fcgi::fcgi_request_service::fcgi_request_service]
-
-[indexterm2 fcgi_request_service..fcgi::fcgi_request_service]
-
- fcgi_request_service(
- ::cgi::common::io_service & ios);
-
-
-
-[endsect]
-
-
-
-[section:full_type fcgi::fcgi_request_service::full_type]
-
-[indexterm2 full_type..fcgi::fcgi_request_service]
-
- typedef fcgi_request_service full_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__callback_functor [*callback_functor]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an FCGI request. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.full_type [*full_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.proc_func_t [*proc_func_t]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.self_type [*self_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.async_load [*async_load]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.begin_request_helper [*begin_request_helper]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.clear [*clear]]]
- [Clear all request data (object is then safe to remove). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.client [*client]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.close [*close]]]
- [Close the request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.fcgi_request_service [*fcgi_request_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_admin_request [*handle_admin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_other_request_header [*handle_other_request_header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.params_read [*params_read]]]
- [Returns true if the request environment params have been read. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_body [*parse_body]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_header [*parse_header]]]
- [Parse the current header. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_packet [*parse_packet]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_abort_request [*process_abort_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_begin_request [*process_begin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_params [*process_params]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_stdin [*process_stdin]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_body [*read_body]]]
- [Read the body of the current packet; do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_env_vars [*read_env_vars]]]
- [Read in the FastCGI (env) params. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_header [*read_header]]]
- [Read a single header, buf do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_service [*set_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_status [*set_status]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service._fcgi_request_service [*~fcgi_request_service]]]
- []
- ]
-
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.id [*id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.proc_funcs [*proc_funcs]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:get_role fcgi::fcgi_request_service::get_role]
-
-[indexterm2 get_role..fcgi::fcgi_request_service]
-
- role_type get_role(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:handle_admin_request fcgi::fcgi_request_service::handle_admin_request]
-
-[indexterm2 handle_admin_request..fcgi::fcgi_request_service]
-
- void handle_admin_request(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:handle_other_request_header fcgi::fcgi_request_service::handle_other_request_header]
-
-[indexterm2 handle_other_request_header..fcgi::fcgi_request_service]
-
- void handle_other_request_header(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:id fcgi::fcgi_request_service::id]
-
-[indexterm2 id..fcgi::fcgi_request_service]
-
- static boost::asio::detail::service_id< fcgi_request_service > id;
-
-
-
-[endsect]
-
-
-
-[section:is_file fcgi::fcgi_request_service::is_file]
-
-
-['Inherited from common::request_base.]
-
-[indexterm2 is_file..fcgi::fcgi_request_service] Check if a given POST variable represents a file upload.
-
- bool is_file(
- ImplType & impl,
- typename ImplType::string_type const & key);
-
-
-
-[endsect]
-
-
-
-[section:is_open fcgi::fcgi_request_service::is_open]
-
-[indexterm2 is_open..fcgi::fcgi_request_service]
-
- bool is_open(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-[section:load fcgi::fcgi_request_service::load]
-
-[indexterm2 load..fcgi::fcgi_request_service] Synchronously read/parse the request meta-data.
-
- boost::system::error_code ``[link cgi.reference.fcgi__fcgi_request_service.load.overload1 load]``(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
-
- boost::system::error_code ``[link cgi.reference.fcgi__fcgi_request_service.load.overload2 load]``(
- implementation_type & impl,
- common::parse_options opts,
- boost::system::error_code & ec);
-
-
-[section:overload1 fcgi::fcgi_request_service::load (1 of 2 overloads)]
-
-
-['Inherited from common::request_base.]
-
-Synchronously read/parse the request meta-data.
-
- boost::system::error_code load(
- ImplType & impl,
- common::parse_options parse_opts,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::fcgi_request_service::load (2 of 2 overloads)]
-
-Load the request to a point where it can be usefully used.
-
- boost::system::error_code load(
- implementation_type & impl,
- common::parse_options opts,
- boost::system::error_code & ec);
-
-
-FastCGI: --------
-
-
-* Calls client::construct() to claim a request id from the server.
-
-* Reads, parses and handles all packets until the closing `PARAMS` packet for this request arrives from the server.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:load_environment fcgi::fcgi_request_service::load_environment]
-
-
-['Inherited from common::request_base.]
-
-[indexterm2 load_environment..fcgi::fcgi_request_service] Load the base_environment into the current environment.
-
- void load_environment(
- ImplType & impl,
- char ** base_environment,
- bool is_command_line);
-
-
-Parsed the base\_environment and add it to the current request's environment. This overwrites any environment variables with the existing key.
-
-If `is\_command\_line` is true, then the first argument is skipped as this is the name of the program and ignored. Using it actually causes a crash on Windows (MSVC 9) anyway: I'm not exactly sure why.
-
-
-[endsect]
-
-
-
-[section:params_read fcgi::fcgi_request_service::params_read]
-
-[indexterm2 params_read..fcgi::fcgi_request_service] Returns true if the request environment params have been read.
-
- bool params_read(
- implementation_type & impl);
-
-
-Check if the params have been read (ie. FCGI\_PARAMS packets).
-
-
-[endsect]
-
-
-
-[section:parse_body fcgi::fcgi_request_service::parse_body]
-
-[indexterm2 parse_body..fcgi::fcgi_request_service]
-
- template<
- typename MutableBuffersType >
- boost::system::error_code parse_body(
- implementation_type & impl,
- const MutableBuffersType & buffer,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:parse_cookie_vars fcgi::fcgi_request_service::parse_cookie_vars]
-
-
-['Inherited from common::request_base.]
-
-[indexterm2 parse_cookie_vars..fcgi::fcgi_request_service] Read and parse the HTTP_COOKIE meta variable.
-
- boost::system::error_code parse_cookie_vars(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:parse_get_vars fcgi::fcgi_request_service::parse_get_vars]
-
-
-['Inherited from common::request_base.]
-
-[indexterm2 parse_get_vars..fcgi::fcgi_request_service] Read and parse the cgi GET meta variables.
-
- boost::system::error_code parse_get_vars(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:parse_header fcgi::fcgi_request_service::parse_header]
-
-[indexterm2 parse_header..fcgi::fcgi_request_service] Parse the current header.
-
- boost::tribool parse_header(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
-
-[section:parse_one_post_var fcgi::fcgi_request_service::parse_one_post_var]
-
-[indexterm2 parse_one_post_var..fcgi::fcgi_request_service] Read and parse a single cgi POST meta variable (greedily).
-
- template<
- typename RequestImpl >
- boost::system::error_code & parse_one_post_var(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:parse_packet fcgi::fcgi_request_service::parse_packet]
-
-[indexterm2 parse_packet..fcgi::fcgi_request_service]
-
- boost::system::error_code parse_packet(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:parse_post_vars fcgi::fcgi_request_service::parse_post_vars]
-
-[indexterm2 parse_post_vars..fcgi::fcgi_request_service] Read and parse the cgi POST meta variables (greedily).
-
- boost::system::error_code & parse_post_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:proc_func_t fcgi::fcgi_request_service::proc_func_t]
-
-[indexterm2 proc_func_t..fcgi::fcgi_request_service]
-
- typedef boost::system::error_code(full_type::* proc_func_t;
-
-
-
-
-[endsect]
-
-
-
-[section:proc_funcs fcgi::fcgi_request_service::proc_funcs]
-
-[indexterm2 proc_funcs..fcgi::fcgi_request_service]
-
- static const proc_func_t proc_funcs =
- { 0
- , &fcgi_request_service::process_begin_request
- , &fcgi_request_service::process_abort_request
- , 0
- , &fcgi_request_service::process_params
- , &fcgi_request_service::process_stdin
- , 0
- , 0
- };
-
-
-
-[endsect]
-
-
-
-[section:process_abort_request fcgi::fcgi_request_service::process_abort_request]
-
-[indexterm2 process_abort_request..fcgi::fcgi_request_service]
-
- boost::system::error_code process_abort_request(
- implementation_type & impl,
- boost::uint16_t id,
- const unsigned char * buf,
- boost::uint32_t ,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:process_begin_request fcgi::fcgi_request_service::process_begin_request]
-
-[indexterm2 process_begin_request..fcgi::fcgi_request_service]
-
- boost::system::error_code process_begin_request(
- implementation_type & impl,
- boost::uint16_t id,
- const unsigned char * buf,
- boost::uint32_t ,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:process_params fcgi::fcgi_request_service::process_params]
-
-[indexterm2 process_params..fcgi::fcgi_request_service]
-
- boost::system::error_code process_params(
- implementation_type & impl,
- boost::uint16_t id,
- const unsigned char * buf,
- boost::uint32_t len,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:process_stdin fcgi::fcgi_request_service::process_stdin]
-
-[indexterm2 process_stdin..fcgi::fcgi_request_service]
-
- boost::system::error_code process_stdin(
- implementation_type & impl,
- boost::uint16_t id,
- const unsigned char * buf,
- boost::uint32_t len,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:protocol_type fcgi::fcgi_request_service::protocol_type]
-
-[indexterm2 protocol_type..fcgi::fcgi_request_service]
-
- typedef self_type::implementation_type::protocol_type protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:read_body fcgi::fcgi_request_service::read_body]
-
-[indexterm2 read_body..fcgi::fcgi_request_service] Read the body of the current packet; do nothing with it.
-
- template<
- typename MutableBuffersType >
- boost::system::error_code read_body(
- implementation_type & impl,
- const MutableBuffersType & buffer,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:read_env_vars fcgi::fcgi_request_service::read_env_vars]
-
-[indexterm2 read_env_vars..fcgi::fcgi_request_service] Read in the FastCGI (env) params.
-
- boost::system::error_code read_env_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:read_header fcgi::fcgi_request_service::read_header]
-
-[indexterm2 read_header..fcgi::fcgi_request_service] Read a single header, buf do nothing with it.
-
- boost::system::error_code read_header(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-Read a single header, but do nothing with it.
-
-
-[endsect]
-
-
-[section:read_some fcgi::fcgi_request_service::read_some]
-
-[indexterm2 read_some..fcgi::fcgi_request_service] Read some data from the client into the supplied buffer.
-
- std::size_t ``[link cgi.reference.fcgi__fcgi_request_service.read_some.overload1 read_some]``(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
- std::size_t ``[link cgi.reference.fcgi__fcgi_request_service.read_some.overload2 read_some]``(
- ImplType & impl,
- boost::system::error_code & ec);
-
- template<
- typename MutableBufferSequence >
- std::size_t ``[link cgi.reference.fcgi__fcgi_request_service.read_some.overload3 read_some]``(
- implementation_type & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
- std::size_t ``[link cgi.reference.fcgi__fcgi_request_service.read_some.overload4 read_some]``(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-[section:overload1 fcgi::fcgi_request_service::read_some (1 of 4 overloads)]
-
-
-['Inherited from common::request_base.]
-
-Read some data from the client into the supplied buffer.
-
- std::size_t read_some(
- ImplType & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::fcgi_request_service::read_some (2 of 4 overloads)]
-
-
-['Inherited from common::request_base.]
-
-Read some data into the internal buffer.
-
- std::size_t read_some(
- ImplType & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload3 fcgi::fcgi_request_service::read_some (3 of 4 overloads)]
-
-Read some data from the client into the supplied buffer.
-
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- implementation_type & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
-
-Read some data from the client.
-
-
-[endsect]
-
-
-
-[section:overload4 fcgi::fcgi_request_service::read_some (4 of 4 overloads)]
-
-Read some data from the client into the internal buffer.
-
- std::size_t read_some(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:request_id fcgi::fcgi_request_service::request_id]
-
-
-['Inherited from common::request_base.]
-
-[indexterm2 request_id..fcgi::fcgi_request_service] Get the request ID of a FastCGI request, or 1.
-
- boost::uint16_t const & request_id(
- ImplType & impl) const;
-
-
-
-[endsect]
-
-
-
-[section:request_type fcgi::fcgi_request_service::request_type]
-
-[indexterm2 request_type..fcgi::fcgi_request_service]
-
- typedef self_type::implementation_type::request_type request_type;
-
-
-
-
-[endsect]
-
-
-
-[section:self_type fcgi::fcgi_request_service::self_type]
-
-[indexterm2 self_type..fcgi::fcgi_request_service]
-
- typedef fcgi_request_service self_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__callback_functor [*callback_functor]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an FCGI request. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.full_type [*full_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.proc_func_t [*proc_func_t]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.self_type [*self_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.async_load [*async_load]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.begin_request_helper [*begin_request_helper]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.clear [*clear]]]
- [Clear all request data (object is then safe to remove). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.client [*client]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.close [*close]]]
- [Close the request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.fcgi_request_service [*fcgi_request_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_admin_request [*handle_admin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_other_request_header [*handle_other_request_header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.params_read [*params_read]]]
- [Returns true if the request environment params have been read. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_body [*parse_body]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_header [*parse_header]]]
- [Parse the current header. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_packet [*parse_packet]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_abort_request [*process_abort_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_begin_request [*process_begin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_params [*process_params]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_stdin [*process_stdin]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_body [*read_body]]]
- [Read the body of the current packet; do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_env_vars [*read_env_vars]]]
- [Read in the FastCGI (env) params. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_header [*read_header]]]
- [Read a single header, buf do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_service [*set_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_status [*set_status]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service._fcgi_request_service [*~fcgi_request_service]]]
- []
- ]
-
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.id [*id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.proc_funcs [*proc_funcs]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:set_service fcgi::fcgi_request_service::set_service]
-
-[indexterm2 set_service..fcgi::fcgi_request_service]
-
- void set_service(
- implementation_type & impl,
- implementation_type::protocol_service_type & ps);
-
-
-
-[endsect]
-
-
-
-[section:set_status fcgi::fcgi_request_service::set_status]
-
-[indexterm2 set_status..fcgi::fcgi_request_service]
-
- void set_status(
- implementation_type & impl,
- common::request_status status);
-
-
-
-[endsect]
-
-
-
-[section:shutdown_service fcgi::fcgi_request_service::shutdown_service]
-
-[indexterm2 shutdown_service..fcgi::fcgi_request_service]
-
- void shutdown_service();
-
-
-
-[endsect]
-
-
-
-[section:string_type fcgi::fcgi_request_service::string_type]
-
-[indexterm2 string_type..fcgi::fcgi_request_service]
-
- typedef self_type::implementation_type::string_type string_type;
-
-
-
-
-[endsect]
-
-
-
-[section:_fcgi_request_service fcgi::fcgi_request_service::~fcgi_request_service]
-
-[indexterm2 ~fcgi_request_service..fcgi::fcgi_request_service]
-
- ~fcgi_request_service();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__fcgi_request_service__callback_functor fcgi::fcgi_request_service::callback_functor]
-
-
-
- template<
- typename Service >
- struct callback_functor
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__callback_functor.callback_functor [*callback_functor]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__callback_functor.operator() [*operator()]]]
- []
- ]
-
-]
-
-
-[section:callback_functor fcgi::fcgi_request_service::callback_functor::callback_functor]
-
-[indexterm2 callback_functor..fcgi::fcgi_request_service::callback_functor]
-
- callback_functor(
- implementation_type & impl,
- Service * service);
-
-
-
-[endsect]
-
-
-
-[section:operator() fcgi::fcgi_request_service::callback_functor::operator()]
-
-[indexterm2 operator()..fcgi::fcgi_request_service::callback_functor]
-
- std::size_t operator()(
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__fcgi_request_service__implementation_type fcgi::fcgi_request_service::implementation_type]
-
-The actual implementation date for an FCGI request.
-
- struct implementation_type :
- public common::request_base< T >::impl_base
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.buffer_type [*buffer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.char_type [*char_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.client_type [*client_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.connection_type [*connection_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.form_parser_type [*form_parser_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.header_buffer_type [*header_buffer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.header_type [*header_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.string_type [*string_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.var_map_type [*var_map_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.implementation_type [*implementation_type]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.prepare [*prepare]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.prepare_misc [*prepare_misc]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.all_done_ [*all_done_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.characters_left_ [*characters_left_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.client_ [*client_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.env_parsed_ [*env_parsed_]]]
- [Whether the environment has been parsed yet. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.form_parts_ [*form_parts_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.fp_ [*fp_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.get_parsed_ [*get_parsed_]]]
- [Whether the get data has been parsed yet. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.header_ [*header_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.header_buf_ [*header_buf_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.http_status_ [*http_status_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.id_ [*id_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.param_buffer_ [*param_buffer_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.post_buffer_ [*post_buffer_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.request_role_ [*request_role_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.request_status_ [*request_status_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.service_ [*service_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.stdin_parsed_ [*stdin_parsed_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type.vars_ [*vars_]]]
- []
- ]
-
-]
-
-
-[section:all_done_ fcgi::fcgi_request_service::implementation_type::all_done_]
-
-[indexterm2 all_done_..fcgi::fcgi_request_service::implementation_type]
-
- bool all_done_;
-
-
-
-[endsect]
-
-
-
-[section:buffer_type fcgi::fcgi_request_service::implementation_type::buffer_type]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 buffer_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef string_type buffer_type;
-
-
-
-
-[endsect]
-
-
-
-[section:char_type fcgi::fcgi_request_service::implementation_type::char_type]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 char_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef char char_type;
-
-
-
-
-[endsect]
-
-
-
-[section:characters_left_ fcgi::fcgi_request_service::implementation_type::characters_left_]
-
-[indexterm2 characters_left_..fcgi::fcgi_request_service::implementation_type]
-
- std::size_t characters_left_;
-
-
-
-[endsect]
-
-
-
-[section:client_ fcgi::fcgi_request_service::implementation_type::client_]
-
-[indexterm2 client_..fcgi::fcgi_request_service::implementation_type]
-
- client_type client_;
-
-
-
-[endsect]
-
-
-
-[section:client_type fcgi::fcgi_request_service::implementation_type::client_type]
-
-[indexterm2 client_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef ::cgi::fcgi::client client_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
- [Asynchronously read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
- [Asynchronously write some data to the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.connection [*connection]]]
- [Get a shared_ptr of the connection associated with the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.read_some [*read_some]]]
- [Read some data from the client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
- [Associate a connection with this client. ]
- ]
-
- [
- [[link cgi.reference.common__basic_client.write_some [*write_some]]]
- [Write some data to the client. ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
- []
- ]
-
-]
-
-A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
-
-
-
-[endsect]
-
-
-
-[section:connection_type fcgi::fcgi_request_service::implementation_type::connection_type]
-
-[indexterm2 connection_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef client_type::connection_type connection_type;
-
-
-
-
-[endsect]
-
-
-
-[section:const_buffers_type fcgi::fcgi_request_service::implementation_type::const_buffers_type]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 const_buffers_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef boost::asio::const_buffers_1 const_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:env_parsed_ fcgi::fcgi_request_service::implementation_type::env_parsed_]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 env_parsed_..fcgi::fcgi_request_service::implementation_type] Whether the environment has been parsed yet.
-
- bool env_parsed_;
-
-
-
-[endsect]
-
-
-
-[section:form_parser_type fcgi::fcgi_request_service::implementation_type::form_parser_type]
-
-[indexterm2 form_parser_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef detail::form_parser form_parser_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.detail__form_parser.buffer_type [*buffer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.detail__form_parser.callback_type [*callback_type]]]
- [The callback functor to read more data. ]
-
- ]
-
- [
-
- [[link cgi.reference.detail__form_parser__context [*context]]]
- [The context used for parsing. ]
-
- ]
-
- [
-
- [[link cgi.reference.detail__form_parser.map_type [*map_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.detail__form_parser.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.detail__form_parser.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.detail__form_parser.buffer_string [*buffer_string]]]
- []
- ]
-
- [
- [[link cgi.reference.detail__form_parser.form_parser [*form_parser]]]
- []
- ]
-
- [
- [[link cgi.reference.detail__form_parser.move_to_start_of_first_part [*move_to_start_of_first_part]]]
- [Erase any front-cruft on the form data. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse [*parse]]]
- [Run the parser on the given `context`. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_boundary_marker [*parse_boundary_marker]]]
- [Get the boundary marker from the CONTENT_TYPE header. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_form_part [*parse_form_part]]]
- [Parse a single form part. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_multipart_form [*parse_multipart_form]]]
- [Parse a multipart form. ]
- ]
-
- [
- [[link cgi.reference.detail__form_parser.parse_url_encoded_form [*parse_url_encoded_form]]]
- [URL-encoded forms. ]
- ]
-
-]
-
-Construct this and then call `form\_parserparse` with an instance of form_parser::context (or compatible struct).
-
-This is minimal and doesn't extract all meta-data yet, but is known to work on Windows XP with MSVC9.0 and Ubuntu linux with gcc 4.2.x and 4.3.x.
-
-Valid Form Encodings > `application/x-www-form-urlencoded` > `multipart/form-data`
-
-File uploads (ie. in `multipart/form-data` forms) are saved to disk. See the `BOOST\_CGI\_UPLOAD\_DIRECTORY` macro.
-
-Should also work for HTTP POST data.
-
-
-
-[endsect]
-
-
-
-[section:form_parts_ fcgi::fcgi_request_service::implementation_type::form_parts_]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 form_parts_..fcgi::fcgi_request_service::implementation_type]
-
- std::vector< common::form_part > form_parts_;
-
-
-
-[endsect]
-
-
-
-[section:fp_ fcgi::fcgi_request_service::implementation_type::fp_]
-
-[indexterm2 fp_..fcgi::fcgi_request_service::implementation_type]
-
- boost::scoped_ptr< form_parser_type > fp_;
-
-
-
-[endsect]
-
-
-
-[section:get_parsed_ fcgi::fcgi_request_service::implementation_type::get_parsed_]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 get_parsed_..fcgi::fcgi_request_service::implementation_type] Whether the get data has been parsed yet.
-
- bool get_parsed_;
-
-
-
-[endsect]
-
-
-
-[section:header_ fcgi::fcgi_request_service::implementation_type::header_]
-
-[indexterm2 header_..fcgi::fcgi_request_service::implementation_type]
-
- header_type header_;
-
-
-
-[endsect]
-
-
-
-[section:header_buf_ fcgi::fcgi_request_service::implementation_type::header_buf_]
-
-[indexterm2 header_buf_..fcgi::fcgi_request_service::implementation_type]
-
- header_buffer_type header_buf_;
-
-
-
-[endsect]
-
-
-
-[section:header_buffer_type fcgi::fcgi_request_service::implementation_type::header_buffer_type]
-
-[indexterm2 header_buffer_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef client_type::header_buffer_type header_buffer_type;
-
-
-
-
-[endsect]
-
-
-
-[section:header_type fcgi::fcgi_request_service::implementation_type::header_type]
-
-[indexterm2 header_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef spec_detail::Header header_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type [*implementation_type]]]
- [The underlying type of a FastCGI header. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.Header [*Header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.body_length [*body_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.content_length [*content_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.padding_length [*padding_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.type [*type]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.version [*version]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.impl [*impl]]]
- [The underlying type of a FastCGI header. ]
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:http_status_ fcgi::fcgi_request_service::implementation_type::http_status_]
-
-[indexterm2 http_status_..fcgi::fcgi_request_service::implementation_type]
-
- ::cgi::common::http::status_code http_status_;
-
-
-
-[endsect]
-
-
-
-[section:id_ fcgi::fcgi_request_service::implementation_type::id_]
-
-[indexterm2 id_..fcgi::fcgi_request_service::implementation_type]
-
- boost::uint16_t id_;
-
-
-
-[endsect]
-
-
-
-[section:implementation_type fcgi::fcgi_request_service::implementation_type::implementation_type]
-
-[indexterm2 implementation_type..fcgi::fcgi_request_service::implementation_type]
-
- implementation_type();
-
-
-
-[endsect]
-
-
-
-[section:mutable_buffers_type fcgi::fcgi_request_service::implementation_type::mutable_buffers_type]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 mutable_buffers_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:param_buffer_ fcgi::fcgi_request_service::implementation_type::param_buffer_]
-
-[indexterm2 param_buffer_..fcgi::fcgi_request_service::implementation_type]
-
- buffer_type param_buffer_;
-
-
-
-[endsect]
-
-
-
-[section:post_buffer_ fcgi::fcgi_request_service::implementation_type::post_buffer_]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 post_buffer_..fcgi::fcgi_request_service::implementation_type]
-
- buffer_type post_buffer_;
-
-
-
-[endsect]
-
-
-
-[section:prepare fcgi::fcgi_request_service::implementation_type::prepare]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 prepare..fcgi::fcgi_request_service::implementation_type]
-
- mutable_buffers_type prepare(
- std::size_t size);
-
-
-
-[endsect]
-
-
-
-[section:prepare_misc fcgi::fcgi_request_service::implementation_type::prepare_misc]
-
-[indexterm2 prepare_misc..fcgi::fcgi_request_service::implementation_type]
-
- mutable_buffers_type prepare_misc(
- std::size_t size);
-
-
-
-[endsect]
-
-
-
-[section:protocol_service_type fcgi::fcgi_request_service::implementation_type::protocol_service_type]
-
-[indexterm2 protocol_service_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef detail::protocol_traits< protocol_type >::protocol_service_type protocol_service_type;
-
-
-
-
-[endsect]
-
-
-
-[section:protocol_type fcgi::fcgi_request_service::implementation_type::protocol_type]
-
-[indexterm2 protocol_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef ::cgi::common::fcgi_ protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:request_role_ fcgi::fcgi_request_service::implementation_type::request_role_]
-
-[indexterm2 request_role_..fcgi::fcgi_request_service::implementation_type]
-
- fcgi::spec_detail::role_types request_role_;
-
-
-
-[endsect]
-
-
-
-[section:request_status_ fcgi::fcgi_request_service::implementation_type::request_status_]
-
-[indexterm2 request_status_..fcgi::fcgi_request_service::implementation_type]
-
- common::request_status request_status_;
-
-
-
-[endsect]
-
-
-
-[section:request_type fcgi::fcgi_request_service::implementation_type::request_type]
-
-[indexterm2 request_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef detail::protocol_traits< protocol_type >::request_type request_type;
-
-
-
-
-[endsect]
-
-
-
-[section:service_ fcgi::fcgi_request_service::implementation_type::service_]
-
-[indexterm2 service_..fcgi::fcgi_request_service::implementation_type]
-
- protocol_service_type * service_;
-
-
-
-[endsect]
-
-
-
-[section:stdin_parsed_ fcgi::fcgi_request_service::implementation_type::stdin_parsed_]
-
-[indexterm2 stdin_parsed_..fcgi::fcgi_request_service::implementation_type]
-
- bool stdin_parsed_;
-
-
-
-[endsect]
-
-
-
-[section:string_type fcgi::fcgi_request_service::implementation_type::string_type]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 string_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef std::basic_string< char_type > string_type;
-
-
-
-
-[endsect]
-
-
-
-[section:var_map_type fcgi::fcgi_request_service::implementation_type::var_map_type]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 var_map_type..fcgi::fcgi_request_service::implementation_type]
-
- typedef boost::fusion::vector< common::env_map, common::get_map, common::post_map, common::cookie_map, common::session_map > var_map_type;
-
-
-
-If you want to add a new data type to a request you need to: > Update this file (just below) > Update source_enums.hpp > Update map.hpp with a new map type > Use the `BOOST\_CGI\_DETAIL\_MAP\_ACCESS` macro in `basic\_request<>`, next to the other uses of it.
-
-
-[endsect]
-
-
-
-[section:vars_ fcgi::fcgi_request_service::implementation_type::vars_]
-
-
-['Inherited from common::request_base::impl_base.]
-
-[indexterm2 vars_..fcgi::fcgi_request_service::implementation_type]
-
- var_map_type vars_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:fcgi__packet_type__packet_types fcgi::packet_type::packet_types]
-
-[indexterm1 fcgi::packet_type::packet_types]
-
- enum packet_types
-
-[heading Values]
-[variablelist
-
- [
- [get_data]
- []
- ]
-
- [
- [end_get_data]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fcgi__request fcgi::request]
-
-[indexterm1 fcgi::request]
-
- typedef common::basic_request< fcgi_request_service, service > request;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__callback_functor [*callback_functor]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an FCGI request. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.full_type [*full_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.proc_func_t [*proc_func_t]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.self_type [*self_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__fcgi_request_service.string_type [*string_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.async_load [*async_load]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.begin_request_helper [*begin_request_helper]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.clear [*clear]]]
- [Clear all request data (object is then safe to remove). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.client [*client]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.close [*close]]]
- [Close the request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.fcgi_request_service [*fcgi_request_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_admin_request [*handle_admin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.handle_other_request_header [*handle_other_request_header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_file [*is_file]]]
- [Check if a given POST variable represents a file upload. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load [*load]]]
- [Synchronously read/parse the request meta-data. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.load_environment [*load_environment]]]
- [Load the base_environment into the current environment. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.params_read [*params_read]]]
- [Returns true if the request environment params have been read. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_body [*parse_body]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_header [*parse_header]]]
- [Parse the current header. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_packet [*parse_packet]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_abort_request [*process_abort_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_begin_request [*process_begin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_params [*process_params]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.process_stdin [*process_stdin]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_body [*read_body]]]
- [Read the body of the current packet; do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_env_vars [*read_env_vars]]]
- [Read in the FastCGI (env) params. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_header [*read_header]]]
- [Read a single header, buf do nothing with it. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.read_some [*read_some]]]
- [Read some data from the client into the supplied buffer. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.request_id [*request_id]]]
- [Get the request ID of a FastCGI request, or 1. ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_service [*set_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.set_status [*set_status]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service._fcgi_request_service [*~fcgi_request_service]]]
- []
- ]
-
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.id [*id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__fcgi_request_service.proc_funcs [*proc_funcs]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fcgi__service fcgi::service]
-
-[indexterm1 fcgi::service]
-
- typedef ::cgi::common::basic_protocol_service< ::cgi::common::fcgi_ > service;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
- []
- ]
-
-]
-
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
-
-
-
-[endsect]
-
-
-
-[section:fcgi__service_t fcgi::service_t]
-
-[indexterm1 fcgi::service_t]
-
- typedef service service_t;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
- [Dispatch a handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
- [Return an available io_service from the IoServiceProvider. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.post [*post]]]
- [Post the handler through an available io_service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
- [Reset all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.run [*run]]]
- [Run all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
- [Stop all the io_services contained by this service. ]
- ]
-
- [
- [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
- []
- ]
-
-]
-
-Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
-
-
-
-[endsect]
-
-
-[section:fcgi__spec_detail__BeginRequestBody fcgi::spec_detail::BeginRequestBody]
-
-
-
- class BeginRequestBody
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestBody.flags [*flags]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestBody.role [*role]]]
- []
- ]
-
-]
-
-
-[section:flags fcgi::spec_detail::BeginRequestBody::flags]
-
-[indexterm2 flags..fcgi::spec_detail::BeginRequestBody]
-
- unsigned char flags() const;
-
-
-
-[endsect]
-
-
-
-[section:role fcgi::spec_detail::BeginRequestBody::role]
-
-[indexterm2 role..fcgi::spec_detail::BeginRequestBody]
-
- int role() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__BeginRequestBody__implementation_type fcgi::spec_detail::BeginRequestBody::implementation_type]
-
-The underlying type of a BeginRequestBody sub-header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestBody__implementation_type.flags_ [*flags_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestBody__implementation_type.reserved_ [*reserved_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestBody__implementation_type.roleB0_ [*roleB0_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestBody__implementation_type.roleB1_ [*roleB1_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:flags_ fcgi::spec_detail::BeginRequestBody::implementation_type::flags_]
-
-[indexterm2 flags_..fcgi::spec_detail::BeginRequestBody::implementation_type]
-
- unsigned char flags_;
-
-
-
-[endsect]
-
-
-
-[section:reserved_ fcgi::spec_detail::BeginRequestBody::implementation_type::reserved_]
-
-[indexterm2 reserved_..fcgi::spec_detail::BeginRequestBody::implementation_type]
-
- unsigned char reserved_;
-
-
-
-[endsect]
-
-
-
-[section:roleB0_ fcgi::spec_detail::BeginRequestBody::implementation_type::roleB0_]
-
-[indexterm2 roleB0_..fcgi::spec_detail::BeginRequestBody::implementation_type]
-
- unsigned char roleB0_;
-
-
-
-[endsect]
-
-
-
-[section:roleB1_ fcgi::spec_detail::BeginRequestBody::implementation_type::roleB1_]
-
-[indexterm2 roleB1_..fcgi::spec_detail::BeginRequestBody::implementation_type]
-
- unsigned char roleB1_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__BeginRequestRecord fcgi::spec_detail::BeginRequestRecord]
-
-
-
- struct BeginRequestRecord
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestRecord.body_ [*body_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__BeginRequestRecord.header_ [*header_]]]
- []
- ]
-
-]
-
-
-[section:body_ fcgi::spec_detail::BeginRequestRecord::body_]
-
-[indexterm2 body_..fcgi::spec_detail::BeginRequestRecord]
-
- BeginRequestBody body_;
-
-
-
-[endsect]
-
-
-
-[section:header_ fcgi::spec_detail::BeginRequestRecord::header_]
-
-[indexterm2 header_..fcgi::spec_detail::BeginRequestRecord]
-
- Header header_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__EndRequestBody fcgi::spec_detail::EndRequestBody]
-
-
-
- class EndRequestBody
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.EndRequestBody [*EndRequestBody]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.reset [*reset]]]
- []
- ]
-
-]
-
-[section:EndRequestBody fcgi::spec_detail::EndRequestBody::EndRequestBody]
-
-[indexterm2 EndRequestBody..fcgi::spec_detail::EndRequestBody]
-
- ``[link cgi.reference.fcgi__spec_detail__EndRequestBody.EndRequestBody.overload1 EndRequestBody]``(
- boost::uint64_t appStatus,
- status_types procStatus);
-
- ``[link cgi.reference.fcgi__spec_detail__EndRequestBody.EndRequestBody.overload2 EndRequestBody]``();
-
-
-[section:overload1 fcgi::spec_detail::EndRequestBody::EndRequestBody (1 of 2 overloads)]
-
-
-
- EndRequestBody(
- boost::uint64_t appStatus,
- status_types procStatus);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::spec_detail::EndRequestBody::EndRequestBody (2 of 2 overloads)]
-
-
-
- EndRequestBody();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:const_buffers_type fcgi::spec_detail::EndRequestBody::const_buffers_type]
-
-[indexterm2 const_buffers_type..fcgi::spec_detail::EndRequestBody]
-
- typedef boost::asio::const_buffers_1 const_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:data fcgi::spec_detail::EndRequestBody::data]
-
-[indexterm2 data..fcgi::spec_detail::EndRequestBody]
-
- const_buffers_type data() const;
-
-
-
-[endsect]
-
-
-
-[section:reset fcgi::spec_detail::EndRequestBody::reset]
-
-[indexterm2 reset..fcgi::spec_detail::EndRequestBody]
-
- void reset(
- boost::uint64_t appStatus,
- status_types procStatus);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__EndRequestBody__implementation_type fcgi::spec_detail::EndRequestBody::implementation_type]
-
-The underlying type of an EndRequestBody sub-header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody__implementation_type.appStatusB0_ [*appStatusB0_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody__implementation_type.appStatusB1_ [*appStatusB1_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody__implementation_type.appStatusB2_ [*appStatusB2_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody__implementation_type.appStatusB3_ [*appStatusB3_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody__implementation_type.protocolStatus_ [*protocolStatus_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody__implementation_type.reserved_ [*reserved_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:appStatusB0_ fcgi::spec_detail::EndRequestBody::implementation_type::appStatusB0_]
-
-[indexterm2 appStatusB0_..fcgi::spec_detail::EndRequestBody::implementation_type]
-
- unsigned char appStatusB0_;
-
-
-
-[endsect]
-
-
-
-[section:appStatusB1_ fcgi::spec_detail::EndRequestBody::implementation_type::appStatusB1_]
-
-[indexterm2 appStatusB1_..fcgi::spec_detail::EndRequestBody::implementation_type]
-
- unsigned char appStatusB1_;
-
-
-
-[endsect]
-
-
-
-[section:appStatusB2_ fcgi::spec_detail::EndRequestBody::implementation_type::appStatusB2_]
-
-[indexterm2 appStatusB2_..fcgi::spec_detail::EndRequestBody::implementation_type]
-
- unsigned char appStatusB2_;
-
-
-
-[endsect]
-
-
-
-[section:appStatusB3_ fcgi::spec_detail::EndRequestBody::implementation_type::appStatusB3_]
-
-[indexterm2 appStatusB3_..fcgi::spec_detail::EndRequestBody::implementation_type]
-
- unsigned char appStatusB3_;
-
-
-
-[endsect]
-
-
-
-[section:protocolStatus_ fcgi::spec_detail::EndRequestBody::implementation_type::protocolStatus_]
-
-[indexterm2 protocolStatus_..fcgi::spec_detail::EndRequestBody::implementation_type]
-
- unsigned char protocolStatus_;
-
-
-
-[endsect]
-
-
-
-[section:reserved_ fcgi::spec_detail::EndRequestBody::implementation_type::reserved_]
-
-[indexterm2 reserved_..fcgi::spec_detail::EndRequestBody::implementation_type]
-
- unsigned char reserved_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__EndRequestRecord fcgi::spec_detail::EndRequestRecord]
-
-
-
- class EndRequestRecord
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestRecord.EndRequestRecord [*EndRequestRecord]]]
- []
- ]
-
-]
-
-
-[section:EndRequestRecord fcgi::spec_detail::EndRequestRecord::EndRequestRecord]
-
-[indexterm2 EndRequestRecord..fcgi::spec_detail::EndRequestRecord]
-
- EndRequestRecord(
- boost::uint16_t id,
- boost::uint64_t appStatus,
- status_types procStatus);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__EndRequestRecord__implementation_type fcgi::spec_detail::EndRequestRecord::implementation_type]
-
-The underlying type of an EndRequestRecord sub-header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestRecord__implementation_type.body_ [*body_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestRecord__implementation_type.header_ [*header_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:body_ fcgi::spec_detail::EndRequestRecord::implementation_type::body_]
-
-[indexterm2 body_..fcgi::spec_detail::EndRequestRecord::implementation_type]
-
- EndRequestBody body_;
-
-
-
-[endsect]
-
-
-
-[section:header_ fcgi::spec_detail::EndRequestRecord::implementation_type::header_]
-
-[indexterm2 header_..fcgi::spec_detail::EndRequestRecord::implementation_type]
-
- Header header_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__Header fcgi::spec_detail::Header]
-
-
-
- struct Header
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type [*implementation_type]]]
- [The underlying type of a FastCGI header. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.Header [*Header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.body_length [*body_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.content_length [*content_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.padding_length [*padding_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.type [*type]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.version [*version]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.impl [*impl]]]
- [The underlying type of a FastCGI header. ]
- ]
-
-]
-
-[section:Header fcgi::spec_detail::Header::Header]
-
-[indexterm2 Header..fcgi::spec_detail::Header]
-
- ``[link cgi.reference.fcgi__spec_detail__Header.Header.overload1 Header]``(
- request_types t,
- int id,
- int len);
-
- ``[link cgi.reference.fcgi__spec_detail__Header.Header.overload2 Header]``();
-
-
-[section:overload1 fcgi::spec_detail::Header::Header (1 of 2 overloads)]
-
-
-
- Header(
- request_types t,
- int id,
- int len);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::spec_detail::Header::Header (2 of 2 overloads)]
-
-
-
- Header();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:body_length fcgi::spec_detail::Header::body_length]
-
-[indexterm2 body_length..fcgi::spec_detail::Header]
-
- int body_length() const;
-
-
-
-[endsect]
-
-
-
-[section:const_buffers_type fcgi::spec_detail::Header::const_buffers_type]
-
-[indexterm2 const_buffers_type..fcgi::spec_detail::Header]
-
- typedef boost::asio::const_buffers_1 const_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:content_length fcgi::spec_detail::Header::content_length]
-
-[indexterm2 content_length..fcgi::spec_detail::Header]
-
- boost::uint16_t content_length() const;
-
-
-
-[endsect]
-
-
-[section:data fcgi::spec_detail::Header::data]
-
-[indexterm2 data..fcgi::spec_detail::Header]
-
- const_buffers_type ``[link cgi.reference.fcgi__spec_detail__Header.data.overload1 data]``() const;
-
- mutable_buffers_type ``[link cgi.reference.fcgi__spec_detail__Header.data.overload2 data]``();
-
-
-[section:overload1 fcgi::spec_detail::Header::data (1 of 2 overloads)]
-
-
-
- const_buffers_type data() const;
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::spec_detail::Header::data (2 of 2 overloads)]
-
-
-
- mutable_buffers_type data();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:impl fcgi::spec_detail::Header::impl]
-
-[indexterm2 impl..fcgi::spec_detail::Header] The underlying type of a FastCGI header.
-
- struct cgi::fcgi::spec_detail::Header::implementation_type impl;
-
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[endsect]
-
-
-
-[section:mutable_buffers_type fcgi::spec_detail::Header::mutable_buffers_type]
-
-[indexterm2 mutable_buffers_type..fcgi::spec_detail::Header]
-
- typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:padding_length fcgi::spec_detail::Header::padding_length]
-
-[indexterm2 padding_length..fcgi::spec_detail::Header]
-
- boost::uint16_t padding_length() const;
-
-
-
-[endsect]
-
-
-
-[section:request_id fcgi::spec_detail::Header::request_id]
-
-[indexterm2 request_id..fcgi::spec_detail::Header]
-
- boost::uint16_t request_id() const;
-
-
-
-[endsect]
-
-
-
-[section:reset fcgi::spec_detail::Header::reset]
-
-[indexterm2 reset..fcgi::spec_detail::Header]
-
- void reset(
- request_types t,
- int id,
- int len);
-
-
-
-[endsect]
-
-
-
-[section:type fcgi::spec_detail::Header::type]
-
-[indexterm2 type..fcgi::spec_detail::Header]
-
- boost::uint16_t type() const;
-
-
-
-[endsect]
-
-
-
-[section:version fcgi::spec_detail::Header::version]
-
-[indexterm2 version..fcgi::spec_detail::Header]
-
- boost::uint16_t version() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__Header__implementation_type fcgi::spec_detail::Header::implementation_type]
-
-The underlying type of a FastCGI header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.contentLengthB0_ [*contentLengthB0_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.contentLengthB1_ [*contentLengthB1_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.paddingLength_ [*paddingLength_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.requestIdB0_ [*requestIdB0_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.requestIdB1_ [*requestIdB1_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.reserved_ [*reserved_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.type_ [*type_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type.version_ [*version_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:contentLengthB0_ fcgi::spec_detail::Header::implementation_type::contentLengthB0_]
-
-[indexterm2 contentLengthB0_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char contentLengthB0_;
-
-
-
-[endsect]
-
-
-
-[section:contentLengthB1_ fcgi::spec_detail::Header::implementation_type::contentLengthB1_]
-
-[indexterm2 contentLengthB1_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char contentLengthB1_;
-
-
-
-[endsect]
-
-
-
-[section:paddingLength_ fcgi::spec_detail::Header::implementation_type::paddingLength_]
-
-[indexterm2 paddingLength_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char paddingLength_;
-
-
-
-[endsect]
-
-
-
-[section:requestIdB0_ fcgi::spec_detail::Header::implementation_type::requestIdB0_]
-
-[indexterm2 requestIdB0_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char requestIdB0_;
-
-
-
-[endsect]
-
-
-
-[section:requestIdB1_ fcgi::spec_detail::Header::implementation_type::requestIdB1_]
-
-[indexterm2 requestIdB1_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char requestIdB1_;
-
-
-
-[endsect]
-
-
-
-[section:reserved_ fcgi::spec_detail::Header::implementation_type::reserved_]
-
-[indexterm2 reserved_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char reserved_;
-
-
-
-[endsect]
-
-
-
-[section:type_ fcgi::spec_detail::Header::implementation_type::type_]
-
-[indexterm2 type_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char type_;
-
-
-
-[endsect]
-
-
-
-[section:version_ fcgi::spec_detail::Header::implementation_type::version_]
-
-[indexterm2 version_..fcgi::spec_detail::Header::implementation_type]
-
- unsigned char version_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__UnknownTypeBody fcgi::spec_detail::UnknownTypeBody]
-
-
-
- class UnknownTypeBody
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeBody.UnknownTypeBody [*UnknownTypeBody]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeBody.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeBody.type [*type]]]
- []
- ]
-
-]
-
-[section:UnknownTypeBody fcgi::spec_detail::UnknownTypeBody::UnknownTypeBody]
-
-[indexterm2 UnknownTypeBody..fcgi::spec_detail::UnknownTypeBody]
-
- ``[link cgi.reference.fcgi__spec_detail__UnknownTypeBody.UnknownTypeBody.overload1 UnknownTypeBody]``(
- unsigned char t);
-
- ``[link cgi.reference.fcgi__spec_detail__UnknownTypeBody.UnknownTypeBody.overload2 UnknownTypeBody]``();
-
-
-[section:overload1 fcgi::spec_detail::UnknownTypeBody::UnknownTypeBody (1 of 2 overloads)]
-
-
-
- UnknownTypeBody(
- unsigned char t);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::spec_detail::UnknownTypeBody::UnknownTypeBody (2 of 2 overloads)]
-
-
-
- UnknownTypeBody();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:reset fcgi::spec_detail::UnknownTypeBody::reset]
-
-[indexterm2 reset..fcgi::spec_detail::UnknownTypeBody]
-
- void reset(
- unsigned char t);
-
-
-
-[endsect]
-
-
-
-[section:type fcgi::spec_detail::UnknownTypeBody::type]
-
-[indexterm2 type..fcgi::spec_detail::UnknownTypeBody]
-
- unsigned char type() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__UnknownTypeBody__implementation_type fcgi::spec_detail::UnknownTypeBody::implementation_type]
-
-The underlying type of an UnknownTypeBody sub-header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeBody__implementation_type.reserved_ [*reserved_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeBody__implementation_type.type_ [*type_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:reserved_ fcgi::spec_detail::UnknownTypeBody::implementation_type::reserved_]
-
-[indexterm2 reserved_..fcgi::spec_detail::UnknownTypeBody::implementation_type]
-
- unsigned char reserved_;
-
-
-
-[endsect]
-
-
-
-[section:type_ fcgi::spec_detail::UnknownTypeBody::implementation_type::type_]
-
-[indexterm2 type_..fcgi::spec_detail::UnknownTypeBody::implementation_type]
-
- unsigned char type_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__UnknownTypeRecord fcgi::spec_detail::UnknownTypeRecord]
-
-
-
- class UnknownTypeRecord
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeRecord.UnknownTypeRecord [*UnknownTypeRecord]]]
- []
- ]
-
-]
-
-
-[section:UnknownTypeRecord fcgi::spec_detail::UnknownTypeRecord::UnknownTypeRecord]
-
-[indexterm2 UnknownTypeRecord..fcgi::spec_detail::UnknownTypeRecord]
-
- UnknownTypeRecord(
- int type);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__spec_detail__UnknownTypeRecord__implementation_type fcgi::spec_detail::UnknownTypeRecord::implementation_type]
-
-The underlying type of a UnknownTypeRecord sub-header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeRecord__implementation_type.body_ [*body_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__UnknownTypeRecord__implementation_type.header_ [*header_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:body_ fcgi::spec_detail::UnknownTypeRecord::implementation_type::body_]
-
-[indexterm2 body_..fcgi::spec_detail::UnknownTypeRecord::implementation_type]
-
- UnknownTypeBody body_;
-
-
-
-[endsect]
-
-
-
-[section:header_ fcgi::spec_detail::UnknownTypeRecord::implementation_type::header_]
-
-[indexterm2 header_..fcgi::spec_detail::UnknownTypeRecord::implementation_type]
-
- Header header_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:fcgi__spec_detail__request_types fcgi::spec_detail::request_types]
-
-[indexterm1 fcgi::spec_detail::request_types]
-
- enum request_types
-
-[heading Values]
-[variablelist
-
- [
- [BEGIN_REQUEST]
- []
- ]
-
- [
- [ABORT_REQUEST]
- []
- ]
-
- [
- [END_REQUEST]
- []
- ]
-
- [
- [PARAMS]
- []
- ]
-
- [
- [STDIN]
- []
- ]
-
- [
- [STDOUT]
- []
- ]
-
- [
- [STDERR]
- []
- ]
-
- [
- [DATA]
- []
- ]
-
- [
- [GET_VALUES]
- []
- ]
-
- [
- [GET_VALUES_RESULT]
- []
- ]
-
- [
- [UNKNOWN_TYPE]
- []
- ]
-
- [
- [MAXTYPE]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fcgi__spec_detail__role_types fcgi::spec_detail::role_types]
-
-[indexterm1 fcgi::spec_detail::role_types]
-
- enum role_types
-
-[heading Values]
-[variablelist
-
- [
- [RESPONDER]
- []
- ]
-
- [
- [AUTHORIZER]
- []
- ]
-
- [
- [FILTER]
- []
- ]
-
- [
- [ANY]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fcgi__spec_detail__status_types fcgi::spec_detail::status_types]
-
-[indexterm1 fcgi::spec_detail::status_types]
-
- enum status_types
-
-[heading Values]
-[variablelist
-
- [
- [REQUEST_COMPLETE]
- []
- ]
-
- [
- [CANT_MPX_CONN]
- []
- ]
-
- [
- [OVERLOADED]
- []
- ]
-
- [
- [UNKNOWN_ROLE]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:fcgi__specification__AUX_WRAPPER_NAME fcgi::specification::AUX_WRAPPER_NAME]
-
-
-
- template<
- AUX_WRAPPER_PARAMS(N) >
- struct AUX_WRAPPER_NAME
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.tag [*tag]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.type [*type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.value_type [*value_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.AUX_WRAPPER_INST [*AUX_WRAPPER_INST]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.operator_AUX_WRAPPER_VALUE_TYPE [*operator AUX_WRAPPER_VALUE_TYPE]]]
- []
- ]
-
-]
-
-[section:AUX_WRAPPER_INST fcgi::specification::AUX_WRAPPER_NAME::AUX_WRAPPER_INST]
-
-[indexterm2 AUX_WRAPPER_INST..fcgi::specification::AUX_WRAPPER_NAME]
-
- typedef ``[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.AUX_WRAPPER_INST.overload1 AUX_WRAPPER_INST]``(
- BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE,(value-1)) );
-
- typedef ``[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.AUX_WRAPPER_INST.overload2 AUX_WRAPPER_INST]``(
- BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE,(value+1)) );
-
-
-[section:overload1 fcgi::specification::AUX_WRAPPER_NAME::AUX_WRAPPER_INST (1 of 2 overloads)]
-
-
-
- typedef AUX_WRAPPER_INST(
- BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE,(value-1)) );
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::specification::AUX_WRAPPER_NAME::AUX_WRAPPER_INST (2 of 2 overloads)]
-
-
-
- typedef AUX_WRAPPER_INST(
- BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE,(value+1)) );
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:BOOST_STATIC_CONSTANT fcgi::specification::AUX_WRAPPER_NAME::BOOST_STATIC_CONSTANT]
-
-[indexterm2 BOOST_STATIC_CONSTANT..fcgi::specification::AUX_WRAPPER_NAME]
-
- BOOST_STATIC_CONSTANT(
- AUX_WRAPPER_VALUE_TYPE ,
- value = N);
-
-
-
-[endsect]
-
-
-
-[section:operator_AUX_WRAPPER_VALUE_TYPE fcgi::specification::AUX_WRAPPER_NAME::operator AUX_WRAPPER_VALUE_TYPE]
-
-[indexterm2 operator AUX_WRAPPER_VALUE_TYPE..fcgi::specification::AUX_WRAPPER_NAME]
-
- operator AUX_WRAPPER_VALUE_TYPE() const;
-
-
-
-[endsect]
-
-
-
-[section:tag fcgi::specification::AUX_WRAPPER_NAME::tag]
-
-[indexterm2 tag..fcgi::specification::AUX_WRAPPER_NAME]
-
- typedef integral_c_tag tag;
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__integral_c_tag.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:type fcgi::specification::AUX_WRAPPER_NAME::type]
-
-[indexterm2 type..fcgi::specification::AUX_WRAPPER_NAME]
-
- typedef AUX_WRAPPER_NAME type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.tag [*tag]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.type [*type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.value_type [*value_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.AUX_WRAPPER_INST [*AUX_WRAPPER_INST]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__AUX_WRAPPER_NAME.operator_AUX_WRAPPER_VALUE_TYPE [*operator AUX_WRAPPER_VALUE_TYPE]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:value_type fcgi::specification::AUX_WRAPPER_NAME::value_type]
-
-[indexterm2 value_type..fcgi::specification::AUX_WRAPPER_NAME]
-
- typedef AUX_WRAPPER_VALUE_TYPE value_type;
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__BeginRequestBody fcgi::specification::BeginRequestBody]
-
-
-
- class BeginRequestBody
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__BeginRequestBody.flags [*flags]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__BeginRequestBody.role [*role]]]
- []
- ]
-
-]
-
-
-[section:flags fcgi::specification::BeginRequestBody::flags]
-
-[indexterm2 flags..fcgi::specification::BeginRequestBody]
-
- unsigned char flags() const;
-
-
-
-[endsect]
-
-
-
-[section:role fcgi::specification::BeginRequestBody::role]
-
-[indexterm2 role..fcgi::specification::BeginRequestBody]
-
- int role() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__BeginRequestBody__implementation_type fcgi::specification::BeginRequestBody::implementation_type]
-
-The underlying type of a BeginRequestBody sub-header.
-
- struct implementation_type
-
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__BeginRequestBody__implementation_type.flags_ [*flags_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__BeginRequestBody__implementation_type.reserved_ [*reserved_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__BeginRequestBody__implementation_type.roleB0_ [*roleB0_]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__BeginRequestBody__implementation_type.roleB1_ [*roleB1_]]]
- []
- ]
-
-]
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[section:flags_ fcgi::specification::BeginRequestBody::implementation_type::flags_]
-
-[indexterm2 flags_..fcgi::specification::BeginRequestBody::implementation_type]
-
- unsigned char flags_;
-
-
-
-[endsect]
-
-
-
-[section:reserved_ fcgi::specification::BeginRequestBody::implementation_type::reserved_]
-
-[indexterm2 reserved_..fcgi::specification::BeginRequestBody::implementation_type]
-
- unsigned char reserved_;
-
-
-
-[endsect]
-
-
-
-[section:roleB0_ fcgi::specification::BeginRequestBody::implementation_type::roleB0_]
-
-[indexterm2 roleB0_..fcgi::specification::BeginRequestBody::implementation_type]
-
- unsigned char roleB0_;
-
-
-
-[endsect]
-
-
-
-[section:roleB1_ fcgi::specification::BeginRequestBody::implementation_type::roleB1_]
-
-[indexterm2 roleB1_..fcgi::specification::BeginRequestBody::implementation_type]
-
- unsigned char roleB1_;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__begin_request fcgi::specification::begin_request]
-
-
-
- struct begin_request
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__specification__begin_request.buffer_type [*buffer_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__begin_request__body [*body]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__begin_request.begin_request [*begin_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__begin_request.flags [*flags]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__begin_request.flags [*flags]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__begin_request.role [*role]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__begin_request.role [*role]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__begin_request.impl [*impl]]]
- []
- ]
-
-]
-
-
-[section:begin_request fcgi::specification::begin_request::begin_request]
-
-[indexterm2 begin_request..fcgi::specification::begin_request]
-
- begin_request(
- buffer_type & buf);
-
-
-
-[endsect]
-
-
-
-[section:buffer_type fcgi::specification::begin_request::buffer_type]
-
-[indexterm2 buffer_type..fcgi::specification::begin_request]
-
- typedef boost::array< unsigned char, header_length::value > buffer_type;
-
-
-
-
-[endsect]
-
-
-
-[section:flags fcgi::specification::begin_request::flags]
-
-[indexterm2 flags..fcgi::specification::begin_request]
-
- unsigned char flags();
-
-
-
-[endsect]
-
-
-
-[section:flags fcgi::specification::begin_request::flags]
-
-[indexterm2 flags..fcgi::specification::begin_request]
-
- template<
- typename Array >
- static unsigned char flags(
- Array & a);
-
-
-
-[endsect]
-
-
-
-[section:impl fcgi::specification::begin_request::impl]
-
-[indexterm2 impl..fcgi::specification::begin_request]
-
- buffer_type impl;
-
-
-
-[endsect]
-
-
-
-[section:role fcgi::specification::begin_request::role]
-
-[indexterm2 role..fcgi::specification::begin_request]
-
- spec_detail::role_types role();
-
-
-
-[endsect]
-
-
-
-[section:role fcgi::specification::begin_request::role]
-
-[indexterm2 role..fcgi::specification::begin_request]
-
- template<
- typename Array >
- static spec_detail::role_types role(
- Array & a);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__begin_request__body fcgi::specification::begin_request::body]
-
-
-
- struct body
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__specification__begin_request__body.size [*size]]]
- []
-
- ]
-
-]
-
-
-[section:size fcgi::specification::begin_request::body::size]
-
-[indexterm2 size..fcgi::specification::begin_request::body]
-
- typedef boost::mpl::int_< 8 > size;
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__end_request fcgi::specification::end_request]
-
-
-
- struct end_request :
- public fcgi::spec_detail::Header,
- fcgi::spec_detail::EndRequestBody
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__specification__end_request.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__end_request.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.body_length [*body_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.content_length [*content_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.end_request [*end_request]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.padding_length [*padding_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.type [*type]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.version [*version]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__end_request.impl [*impl]]]
- [The underlying type of a FastCGI header. ]
- ]
-
-]
-
-
-[section:body_length fcgi::specification::end_request::body_length]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 body_length..fcgi::specification::end_request]
-
- int body_length() const;
-
-
-
-[endsect]
-
-
-
-[section:const_buffers_type fcgi::specification::end_request::const_buffers_type]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 const_buffers_type..fcgi::specification::end_request]
-
- typedef boost::asio::const_buffers_1 const_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:content_length fcgi::specification::end_request::content_length]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 content_length..fcgi::specification::end_request]
-
- boost::uint16_t content_length() const;
-
-
-
-[endsect]
-
-
-[section:data fcgi::specification::end_request::data]
-
-[indexterm2 data..fcgi::specification::end_request]
-
- const_buffers_type ``[link cgi.reference.fcgi__specification__end_request.data.overload1 data]``() const;
-
- mutable_buffers_type ``[link cgi.reference.fcgi__specification__end_request.data.overload2 data]``();
-
-
-[section:overload1 fcgi::specification::end_request::data (1 of 2 overloads)]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-
-
- const_buffers_type data() const;
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::specification::end_request::data (2 of 2 overloads)]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-
-
- mutable_buffers_type data();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:end_request fcgi::specification::end_request::end_request]
-
-[indexterm2 end_request..fcgi::specification::end_request]
-
- end_request(
- int request_id = 0,
- boost::uint64_t app_status = 0,
- spec_detail::status_types proc_status = spec_detail::REQUEST_COMPLETE);
-
-
-
-[endsect]
-
-
-
-[section:impl fcgi::specification::end_request::impl]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 impl..fcgi::specification::end_request] The underlying type of a FastCGI header.
-
- struct cgi::fcgi::spec_detail::Header::implementation_type impl;
-
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[endsect]
-
-
-
-[section:mutable_buffers_type fcgi::specification::end_request::mutable_buffers_type]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 mutable_buffers_type..fcgi::specification::end_request]
-
- typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:padding_length fcgi::specification::end_request::padding_length]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 padding_length..fcgi::specification::end_request]
-
- boost::uint16_t padding_length() const;
-
-
-
-[endsect]
-
-
-
-[section:request_id fcgi::specification::end_request::request_id]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 request_id..fcgi::specification::end_request]
-
- boost::uint16_t request_id() const;
-
-
-
-[endsect]
-
-
-[section:reset fcgi::specification::end_request::reset]
-
-[indexterm2 reset..fcgi::specification::end_request]
-
- void ``[link cgi.reference.fcgi__specification__end_request.reset.overload1 reset]``(
- request_types t,
- int id,
- int len);
-
- void ``[link cgi.reference.fcgi__specification__end_request.reset.overload2 reset]``(
- int request_id,
- boost::uint64_t app_status = 0,
- spec_detail::status_types proc_status = spec_detail::REQUEST_COMPLETE);
-
-
-[section:overload1 fcgi::specification::end_request::reset (1 of 2 overloads)]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-
-
- void reset(
- request_types t,
- int id,
- int len);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::specification::end_request::reset (2 of 2 overloads)]
-
-
-
- void reset(
- int request_id,
- boost::uint64_t app_status = 0,
- spec_detail::status_types proc_status = spec_detail::REQUEST_COMPLETE);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:type fcgi::specification::end_request::type]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 type..fcgi::specification::end_request]
-
- boost::uint16_t type() const;
-
-
-
-[endsect]
-
-
-
-[section:version fcgi::specification::end_request::version]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 version..fcgi::specification::end_request]
-
- boost::uint16_t version() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[section:fcgi__specification__end_request_body fcgi::specification::end_request_body]
-
-[indexterm1 fcgi::specification::end_request_body]
-
- typedef spec_detail::EndRequestBody end_request_body;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.EndRequestBody [*EndRequestBody]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__EndRequestBody.reset [*reset]]]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fcgi__specification__header fcgi::specification::header]
-
-[indexterm1 fcgi::specification::header]
-
- typedef spec_detail::Header header;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header__implementation_type [*implementation_type]]]
- [The underlying type of a FastCGI header. ]
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__spec_detail__Header.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.Header [*Header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.body_length [*body_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.content_length [*content_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.padding_length [*padding_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.type [*type]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.version [*version]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__spec_detail__Header.impl [*impl]]]
- [The underlying type of a FastCGI header. ]
- ]
-
-]
-
-
-
-[endsect]
-
-
-[section:fcgi__specification__header_length fcgi::specification::header_length]
-
-
-
- struct header_length
-
-
-
-[endsect]
-
-[section:fcgi__specification__integral_c_tag fcgi::specification::integral_c_tag]
-
-
-
- struct integral_c_tag
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__integral_c_tag.BOOST_STATIC_CONSTANT [*BOOST_STATIC_CONSTANT]]]
- []
- ]
-
-]
-
-
-[section:BOOST_STATIC_CONSTANT fcgi::specification::integral_c_tag::BOOST_STATIC_CONSTANT]
-
-[indexterm2 BOOST_STATIC_CONSTANT..fcgi::specification::integral_c_tag]
-
- BOOST_STATIC_CONSTANT(
- int ,
- value = 0);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__listensock_fileno fcgi::specification::listensock_fileno]
-
-
-
- struct listensock_fileno
-
-
-
-[endsect]
-
-[section:fcgi__specification__max_packet_size fcgi::specification::max_packet_size]
-
-Define the FastCGI spec using types.
-
- template<
- AUX_WRAPPER_PARAMS(N) >
- struct max_packet_size
-
-
-Types are better than macros.
-
-
-[endsect]
-
-[section:fcgi__specification__null_request_id fcgi::specification::null_request_id]
-
-
-
- struct null_request_id
-
-
-
-[endsect]
-
-[section:fcgi__specification__request_type fcgi::specification::request_type]
-
-
-
- struct request_type
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__request_type.to_string [*to_string]]]
- []
- ]
-
-]
-
-
-[section:to_string fcgi::specification::request_type::to_string]
-
-[indexterm2 to_string..fcgi::specification::request_type]
-
- template<
- typename Array >
- static std::string to_string(
- Array & a);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__role_type fcgi::specification::role_type]
-
-
-
- struct role_type
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__role_type.to_string [*to_string]]]
- []
- ]
-
-]
-
-
-[section:to_string fcgi::specification::role_type::to_string]
-
-[indexterm2 to_string..fcgi::specification::role_type]
-
- template<
- typename Array >
- static std::string to_string(
- Array & a);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi__specification__stdout_header fcgi::specification::stdout_header]
-
-
-
- struct stdout_header :
- public fcgi::spec_detail::Header
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi__specification__stdout_header.const_buffers_type [*const_buffers_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi__specification__stdout_header.mutable_buffers_type [*mutable_buffers_type]]]
- []
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.body_length [*body_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.content_length [*content_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.data [*data]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.padding_length [*padding_length]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.request_id [*request_id]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.reset [*reset]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.stdout_header [*stdout_header]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.type [*type]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.version [*version]]]
- []
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__specification__stdout_header.impl [*impl]]]
- [The underlying type of a FastCGI header. ]
- ]
-
-]
-
-
-[section:body_length fcgi::specification::stdout_header::body_length]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 body_length..fcgi::specification::stdout_header]
-
- int body_length() const;
-
-
-
-[endsect]
-
-
-
-[section:const_buffers_type fcgi::specification::stdout_header::const_buffers_type]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 const_buffers_type..fcgi::specification::stdout_header]
-
- typedef boost::asio::const_buffers_1 const_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:content_length fcgi::specification::stdout_header::content_length]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 content_length..fcgi::specification::stdout_header]
-
- boost::uint16_t content_length() const;
-
-
-
-[endsect]
-
-
-[section:data fcgi::specification::stdout_header::data]
-
-[indexterm2 data..fcgi::specification::stdout_header]
-
- const_buffers_type ``[link cgi.reference.fcgi__specification__stdout_header.data.overload1 data]``() const;
-
- mutable_buffers_type ``[link cgi.reference.fcgi__specification__stdout_header.data.overload2 data]``();
-
-
-[section:overload1 fcgi::specification::stdout_header::data (1 of 2 overloads)]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-
-
- const_buffers_type data() const;
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::specification::stdout_header::data (2 of 2 overloads)]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-
-
- mutable_buffers_type data();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:impl fcgi::specification::stdout_header::impl]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 impl..fcgi::specification::stdout_header] The underlying type of a FastCGI header.
-
- struct cgi::fcgi::spec_detail::Header::implementation_type impl;
-
-
-To guarantee the header is laid out exactly as we want, the structure must be a POD-type (see http://tinyurl.com/yo9eav).
-
-
-[endsect]
-
-
-
-[section:mutable_buffers_type fcgi::specification::stdout_header::mutable_buffers_type]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 mutable_buffers_type..fcgi::specification::stdout_header]
-
- typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
-
-
-
-
-[endsect]
-
-
-
-[section:padding_length fcgi::specification::stdout_header::padding_length]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 padding_length..fcgi::specification::stdout_header]
-
- boost::uint16_t padding_length() const;
-
-
-
-[endsect]
-
-
-
-[section:request_id fcgi::specification::stdout_header::request_id]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 request_id..fcgi::specification::stdout_header]
-
- boost::uint16_t request_id() const;
-
-
-
-[endsect]
-
-
-[section:reset fcgi::specification::stdout_header::reset]
-
-[indexterm2 reset..fcgi::specification::stdout_header]
-
- void ``[link cgi.reference.fcgi__specification__stdout_header.reset.overload1 reset]``(
- request_types t,
- int id,
- int len);
-
- void ``[link cgi.reference.fcgi__specification__stdout_header.reset.overload2 reset]``(
- int request_id,
- int content_len);
-
-
-[section:overload1 fcgi::specification::stdout_header::reset (1 of 2 overloads)]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-
-
- void reset(
- request_types t,
- int id,
- int len);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::specification::stdout_header::reset (2 of 2 overloads)]
-
-
-
- void reset(
- int request_id,
- int content_len);
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:stdout_header fcgi::specification::stdout_header::stdout_header]
-
-[indexterm2 stdout_header..fcgi::specification::stdout_header]
-
- ``[link cgi.reference.fcgi__specification__stdout_header.stdout_header.overload1 stdout_header]``(
- int request_id,
- int content_len);
-
- ``[link cgi.reference.fcgi__specification__stdout_header.stdout_header.overload2 stdout_header]``();
-
-
-[section:overload1 fcgi::specification::stdout_header::stdout_header (1 of 2 overloads)]
-
-
-
- stdout_header(
- int request_id,
- int content_len);
-
-
-
-[endsect]
-
-
-
-[section:overload2 fcgi::specification::stdout_header::stdout_header (2 of 2 overloads)]
-
-
-
- stdout_header();
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:type fcgi::specification::stdout_header::type]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 type..fcgi::specification::stdout_header]
-
- boost::uint16_t type() const;
-
-
-
-[endsect]
-
-
-
-[section:version fcgi::specification::stdout_header::version]
-
-
-['Inherited from fcgi::spec_detail::Header.]
-
-[indexterm2 version..fcgi::specification::stdout_header]
-
- boost::uint16_t version() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:fcgi_request_acceptor_service fcgi_request_acceptor_service]
-
-The service class for FCGI basic_request_acceptor<>s.
-
- template<
- typename Protocol_ = common::fcgi_>
- class fcgi_request_acceptor_service
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.fcgi_request_acceptor_service.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi_request_acceptor_service.implementation_type [*implementation_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi_request_acceptor_service.native_type [*native_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi_request_acceptor_service.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.fcgi_request_acceptor_service.service_impl_type [*service_impl_type]]]
- []
-
- ]
 
-]
+[section:pair_t common::form_part::pair_t]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[indexterm2 pair_t..common::form_part]
 
- [
- [[link cgi.reference.fcgi_request_acceptor_service.accept [*accept]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.assign [*assign]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.async_accept [*async_accept]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.bind [*bind]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.close [*close]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.default_init [*default_init]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.fcgi_request_acceptor_service [*fcgi_request_acceptor_service]]]
- [The unique service identifier. ]
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.is_cgi [*is_cgi]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.listen [*listen]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.local_endpoint [*local_endpoint]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.native [*native]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.open [*open]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.protocol_service [*protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.set_protocol_service [*set_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.fcgi_request_acceptor_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
-]
+ typedef std::pair< iter_t, iter_t > pair_t;
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.fcgi_request_acceptor_service.id [*id]]]
- []
- ]
 
- [
- [[link cgi.reference.fcgi_request_acceptor_service.service_impl_ [*service_impl_]]]
- []
- ]
 
-]
+[endsect]
 
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
 
 
-[section:accept fcgi_request_acceptor_service::accept]
+[section:path common::form_part::path]
 
-[indexterm2 accept..fcgi_request_acceptor_service]
+[indexterm2 path..common::form_part]
 
- template<
- typename CommonGatewayRequest >
- boost::system::error_code accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- endpoint_type * ep,
- boost::system::error_code & ec);
+ boost::filesystem::path path;
 
 
 
@@ -21313,17 +8920,12 @@
 
 
 
-[section:assign fcgi_request_acceptor_service::assign]
+[section:range_type common::form_part::range_type]
 
-[indexterm2 assign..fcgi_request_acceptor_service]
+[indexterm2 range_type..common::form_part]
+
+ typedef boost::iterator_range< buffer_type::const_iterator > range_type;
 
- template<
- typename Protocol >
- boost::system::error_code assign(
- implementation_type & impl,
- Protocol protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
 
 
 
@@ -21331,17 +8933,12 @@
 
 
 
-[section:async_accept fcgi_request_acceptor_service::async_accept]
+[section:string_type common::form_part::string_type]
+
+[indexterm2 string_type..common::form_part]
 
-[indexterm2 async_accept..fcgi_request_acceptor_service]
+ typedef std::basic_string< char_type > string_type;
 
- template<
- typename CommonGatewayRequest ,
- typename Handler >
- void async_accept(
- implementation_type & impl,
- CommonGatewayRequest & req,
- Handler handler);
 
 
 
@@ -21349,83 +8946,104 @@
 
 
 
-[section:bind fcgi_request_acceptor_service::bind]
+[section:value common::form_part::value]
 
-[indexterm2 bind..fcgi_request_acceptor_service]
+[indexterm2 value..common::form_part]
 
- template<
- typename Endpoint >
- boost::system::error_code bind(
- implementation_type & impl,
- const Endpoint & endpoint,
- boost::system::error_code & ec);
+ string_type value;
 
 
 
 [endsect]
 
 
-[section:close fcgi_request_acceptor_service::close]
 
-[indexterm2 close..fcgi_request_acceptor_service]
+[section:_form_part common::form_part::~form_part]
 
- boost::system::error_code ``[link cgi.reference.fcgi_request_acceptor_service.close.overload1 close]``(
- implementation_type & impl,
- boost::system::error_code & ec);
+[indexterm2 ~form_part..common::form_part]
 
- void ``[link cgi.reference.fcgi_request_acceptor_service.close.overload2 close]``(
- implementation_type & impl);
+ ~form_part();
 
 
-[section:overload1 fcgi_request_acceptor_service::close (1 of 2 overloads)]
 
+[endsect]
 
 
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
 
+[endsect]
+
+[section:common__has_hidden_io_service common::has_hidden_io_service]
 
 
-[endsect]
 
+ template<
+ typename Protocol >
+ struct has_hidden_io_service
 
 
-[section:overload2 fcgi_request_acceptor_service::close (2 of 2 overloads)]
 
+[endsect]
 
+[section:common__has_hidden_io_service_lt__tags__cgi__gt_ common::has_hidden_io_service< tags::cgi >]
 
- void close(
- implementation_type & impl);
 
 
+ template<>
+ struct has_hidden_io_service< tags::cgi >
 
-[endsect]
 
 
 [endsect]
 
+[section:common__ichar_traits common::ichar_traits]
 
-[section:construct fcgi_request_acceptor_service::construct]
-
-[indexterm2 construct..fcgi_request_acceptor_service]
 
- void construct(
- implementation_type & impl);
 
+ template<
+ typename CharT >
+ struct ichar_traits
 
 
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__ichar_traits.compare [*compare]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__ichar_traits.eq [*eq]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__ichar_traits.find [*find]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__ichar_traits.lt [*lt]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__ichar_traits.ne [*ne]]]
+ []
+ ]
+
+]
 
 
-[section:default_init fcgi_request_acceptor_service::default_init]
+[section:compare common::ichar_traits::compare]
 
-[indexterm2 default_init..fcgi_request_acceptor_service]
+[indexterm2 compare..common::ichar_traits]
 
- boost::system::error_code default_init(
- implementation_type & impl,
- boost::system::error_code & ec);
+ static int compare(
+ const char * str1,
+ const char * str2,
+ std::size_t num);
 
 
 
@@ -21433,12 +9051,13 @@
 
 
 
-[section:destroy fcgi_request_acceptor_service::destroy]
+[section:eq common::ichar_traits::eq]
 
-[indexterm2 destroy..fcgi_request_acceptor_service]
+[indexterm2 eq..common::ichar_traits]
 
- void destroy(
- implementation_type & impl);
+ static bool eq(
+ char c1,
+ char c2);
 
 
 
@@ -21446,12 +9065,14 @@
 
 
 
-[section:endpoint_type fcgi_request_acceptor_service::endpoint_type]
-
-[indexterm2 endpoint_type..fcgi_request_acceptor_service]
+[section:find common::ichar_traits::find]
 
- typedef implementation_type::endpoint_type endpoint_type;
+[indexterm2 find..common::ichar_traits]
 
+ static const char * find(
+ const char * str,
+ int n,
+ char a);
 
 
 
@@ -21459,12 +9080,13 @@
 
 
 
-[section:fcgi_request_acceptor_service fcgi_request_acceptor_service::fcgi_request_acceptor_service]
+[section:lt common::ichar_traits::lt]
 
-[indexterm2 fcgi_request_acceptor_service..fcgi_request_acceptor_service] The unique service identifier.
+[indexterm2 lt..common::ichar_traits]
 
- fcgi_request_acceptor_service(
- common::io_service & ios);
+ static bool lt(
+ char c1,
+ char c2);
 
 
 
@@ -21472,11 +9094,13 @@
 
 
 
-[section:id fcgi_request_acceptor_service::id]
+[section:ne common::ichar_traits::ne]
 
-[indexterm2 id..fcgi_request_acceptor_service]
+[indexterm2 ne..common::ichar_traits]
 
- static boost::asio::detail::service_id< fcgi_request_acceptor_service< Protocol_ > > id;
+ static bool ne(
+ char c1,
+ char c2);
 
 
 
@@ -21484,158 +9108,108 @@
 
 
 
-[section:implementation_type fcgi_request_acceptor_service::implementation_type]
+[endsect]
 
-[indexterm2 implementation_type..fcgi_request_acceptor_service]
+[section:common__io_service_provider common::io_service_provider]
 
- typedef service_impl_type::implementation_type implementation_type;
+Hold a set number of io_services and return them based on the Policy.
 
+ template<
+ typename PoolingPolicy >
+ class io_service_provider
 
-[heading Types]
+
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.acceptor_service_type [*acceptor_service_type]]]
+ [[link cgi.reference.common__io_service_provider.get_io_service [*get_io_service]]]
     []
-
   ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.endpoint_type [*endpoint_type]]]
- []
   
- ]
-
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.native_protocol_type [*native_protocol_type]]]
+ [[link cgi.reference.common__io_service_provider.io_service_provider [*io_service_provider]]]
     []
-
   ]
-
- [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.port_number_type [*port_number_type]]]
- []
   
- ]
-
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.protocol_service_type [*protocol_service_type]]]
+ [[link cgi.reference.common__io_service_provider.reset [*reset]]]
     []
-
   ]
-
+
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__io_service_provider.run [*run]]]
     []
-
   ]
-
+
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.request_type [*request_type]]]
+ [[link cgi.reference.common__io_service_provider.stop [*stop]]]
     []
-
   ]
-
+
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.acceptor_ [*acceptor_]]]
- []
- ]
+Contains six member functions: io\_service() - returns a reference to an io\_service stop() - stops all io\_services run() - runs all io\_services reset() - resets all io\_services
 
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.endpoint_ [*endpoint_]]]
- []
- ]
+(strike) stop\_one() - stops one (running) io\_service (strike) run\_one() - runs one (not-yet-started/reset) io\_service
 
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.mutex_ [*mutex_]]]
- []
- ]
+It can also be set up so that only required io\_services are run: each call to io\_service() can get an io\_service, call io\_service::run() on it and then return it.
 
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.port_num_ [*port_num_]]]
- []
- ]
 
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.service_ [*service_]]]
- []
- ]
+[section:get_io_service common::io_service_provider::get_io_service]
 
- [
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type.waiting_requests_ [*waiting_requests_]]]
- []
- ]
+[indexterm2 get_io_service..common::io_service_provider]
 
-]
+ ::BOOST_CGI_NAMESPACE::common::io_service & get_io_service();
 
 
 
 [endsect]
 
 
+[section:io_service_provider common::io_service_provider::io_service_provider]
 
-[section:is_cgi fcgi_request_acceptor_service::is_cgi]
+[indexterm2 io_service_provider..common::io_service_provider]
 
-[indexterm2 is_cgi..fcgi_request_acceptor_service]
+ ``[link cgi.reference.common__io_service_provider.io_service_provider.overload1 io_service_provider]``(
+ int );
 
- bool is_cgi(
- implementation_type & impl);
+ ``[link cgi.reference.common__io_service_provider.io_service_provider.overload2 io_service_provider]``();
 
 
+[section:overload1 common::io_service_provider::io_service_provider (1 of 2 overloads)]
 
-[endsect]
 
 
+ io_service_provider(
+ int );
 
-[section:is_open fcgi_request_acceptor_service::is_open]
 
-[indexterm2 is_open..fcgi_request_acceptor_service]
 
- bool is_open(
- implementation_type & impl);
+[endsect]
 
 
 
-[endsect]
+[section:overload2 common::io_service_provider::io_service_provider (2 of 2 overloads)]
 
 
 
-[section:listen fcgi_request_acceptor_service::listen]
+ io_service_provider();
 
-[indexterm2 listen..fcgi_request_acceptor_service]
 
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
- boost::system::error_code & ec);
 
+[endsect]
 
 
 [endsect]
 
 
+[section:reset common::io_service_provider::reset]
 
-[section:local_endpoint fcgi_request_acceptor_service::local_endpoint]
-
-[indexterm2 local_endpoint..fcgi_request_acceptor_service]
+[indexterm2 reset..common::io_service_provider]
 
- implementation_type::endpoint_type local_endpoint(
- implementation_type & impl,
- boost::system::error_code & ec);
+ void reset();
 
 
 
@@ -21643,12 +9217,11 @@
 
 
 
-[section:native fcgi_request_acceptor_service::native]
+[section:run common::io_service_provider::run]
 
-[indexterm2 native..fcgi_request_acceptor_service]
+[indexterm2 run..common::io_service_provider]
 
- service_impl_type::native_type native(
- implementation_type & impl);
+ void run();
 
 
 
@@ -21656,12 +9229,11 @@
 
 
 
-[section:native_type fcgi_request_acceptor_service::native_type]
-
-[indexterm2 native_type..fcgi_request_acceptor_service]
+[section:stop common::io_service_provider::stop]
 
- typedef service_impl_type::native_type native_type;
+[indexterm2 stop..common::io_service_provider]
 
+ void stop();
 
 
 
@@ -21669,42 +9241,57 @@
 
 
 
-[section:open fcgi_request_acceptor_service::open]
+[endsect]
+
+[section:common__is_async common::is_async]
+
 
-[indexterm2 open..fcgi_request_acceptor_service]
 
   template<
       typename Protocol >
- boost::system::error_code open(
- implementation_type & impl,
- const Protocol & protocol,
- boost::system::error_code & ec);
+ struct is_async
 
 
 
 [endsect]
 
+[section:common__is_async_lt__tags__cgi__gt_ common::is_async< tags::cgi >]
 
 
-[section:protocol_service fcgi_request_acceptor_service::protocol_service]
-
-[indexterm2 protocol_service..fcgi_request_acceptor_service]
 
- service_impl_type::protocol_service_type & protocol_service(
- implementation_type const & impl) const;
+ template<>
+ struct is_async< tags::cgi >
 
 
 
 [endsect]
 
+[section:common__map_read_error common::map_read_error]
+
+
+
+ template<
+ typename T >
+ struct map_read_error
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__map_read_error.map_read_error [*map_read_error]]]
+ []
+ ]
+
+]
 
-[section:protocol_type fcgi_request_acceptor_service::protocol_type]
 
-[indexterm2 protocol_type..fcgi_request_acceptor_service]
+[section:map_read_error common::map_read_error::map_read_error]
 
- typedef implementation_type::protocol_type protocol_type;
+[indexterm2 map_read_error..common::map_read_error]
 
+ map_read_error();
 
 
 
@@ -21712,188 +9299,186 @@
 
 
 
-[section:service_impl_ fcgi_request_acceptor_service::service_impl_]
-
-[indexterm2 service_impl_..fcgi_request_acceptor_service]
-
- service_impl_type service_impl_;
-
-
-
 [endsect]
 
 
+[section:common__parse_options common::parse_options]
 
-[section:service_impl_type fcgi_request_acceptor_service::service_impl_type]
-
-[indexterm2 service_impl_type..fcgi_request_acceptor_service]
-
- typedef fcgi::acceptor_service_impl service_impl_type;
+[indexterm1 common::parse_options]
 
+ enum parse_options
 
-[heading Types]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
 
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_type [*acceptor_service_type]]]
+ [parse_none]
     []
-
   ]
 
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl__implementation_type [*implementation_type]]]
- [The unique service identifier. ]
-
+ [parse_env]
+ []
   ]
 
   [
-
- [[link cgi.reference.fcgi__acceptor_service_impl.endpoint_type [*endpoint_type]]]
+ [parse_get_only]
     []
-
   ]
 
   [
+ [parse_get]
+ []
+ ]
 
- [[link cgi.reference.fcgi__acceptor_service_impl.native_protocol_type [*native_protocol_type]]]
+ [
+ [parse_post_only]
     []
-
   ]
 
   [
+ [parse_post]
+ []
+ ]
 
- [[link cgi.reference.fcgi__acceptor_service_impl.native_type [*native_type]]]
+ [
+ [parse_form]
     []
-
   ]
 
   [
+ [parse_form_only]
+ []
+ ]
 
- [[link cgi.reference.fcgi__acceptor_service_impl.protocol_service_type [*protocol_service_type]]]
+ [
+ [parse_cookie_only]
     []
-
   ]
 
   [
+ [parse_cookie]
+ []
+ ]
 
- [[link cgi.reference.fcgi__acceptor_service_impl.protocol_type [*protocol_type]]]
+ [
+ [parse_cookies_only]
     []
-
   ]
 
   [
+ [parse_cookies]
+ []
+ ]
 
- [[link cgi.reference.fcgi__acceptor_service_impl.type [*type]]]
+ [
+ [parse_all]
     []
-
   ]
 
 ]
 
-[heading Member Functions]
+
+
+[endsect]
+
+
+[section:common__path_info common::path_info]
+
+
+
+ struct path_info
+
+
+[heading Types]
 [table
   [[Name][Description]]
 
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.accept [*accept]]]
- [Accepts one request. ]
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_impl [*acceptor_service_impl]]]
+
+ [[link cgi.reference.common__path_info.const_iterator [*const_iterator]]]
     []
- ]
-
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.assign [*assign]]]
- [Assign an existing native acceptor to a *socket* acceptor. ]
- ]
   
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.async_accept [*async_accept]]]
- [Asynchronously accepts one request. ]
   ]
-
+
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.bind [*bind]]]
+
+ [[link cgi.reference.common__path_info.iterator [*iterator]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.check_for_waiting_request [*check_for_waiting_request]]]
+
+ [[link cgi.reference.common__path_info.size_type [*size_type]]]
     []
- ]
   
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.close [*close]]]
- [Close the acceptor (not implemented yet). ]
   ]
-
+
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.construct [*construct]]]
+
+ [[link cgi.reference.common__path_info.string_type [*string_type]]]
     []
- ]
   
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.default_init [*default_init]]]
- [Default-initialize the acceptor. ]
   ]
-
+
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.destroy [*destroy]]]
+
+ [[link cgi.reference.common__path_info.value_type [*value_type]]]
     []
- ]
   
- [
- [[link cgi.reference.fcgi__acceptor_service_impl.get_protocol_service [*get_protocol_service]]]
- []
   ]
-
+
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.is_cgi [*is_cgi]]]
+
+ [[link cgi.reference.common__path_info.vector_type [*vector_type]]]
     []
- ]
   
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.is_open [*is_open]]]
- [Check if the given implementation is open. ]
+ [[link cgi.reference.common__path_info.begin [*begin]]]
+ []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.listen [*listen]]]
+ [[link cgi.reference.common__path_info.end [*end]]]
     []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.local_endpoint [*local_endpoint]]]
+ [[link cgi.reference.common__path_info.extension [*extension]]]
     []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.native [*native]]]
+ [[link cgi.reference.common__path_info.operator_value_type_& [*operator value_type &]]]
     []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.open [*open]]]
- [Open a new *socket* acceptor implementation. ]
+ [[link cgi.reference.common__path_info.operator_openbrace__closebrace_ [*operator[]]]]
+ []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.service [*service]]]
+ [[link cgi.reference.common__path_info.path_info [*path_info]]]
     []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.set_protocol_service [*set_protocol_service]]]
+ [[link cgi.reference.common__path_info.stem [*stem]]]
     []
   ]
   
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.shutdown_service [*shutdown_service]]]
+ [[link cgi.reference.common__path_info.string [*string]]]
     []
   ]
   
@@ -21904,20 +9489,31 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.acceptor_service_ [*acceptor_service_]]]
- [The underlying socket acceptor service. ]
+ [[link cgi.reference.common__path_info.parts [*parts]]]
+ []
   ]
 
   [
- [[link cgi.reference.fcgi__acceptor_service_impl.id [*id]]]
+ [[link cgi.reference.common__path_info.value [*value]]]
     []
   ]
 
 ]
 
-Note: this is near enough to being generic. It will hopefully translate directly to the fcgi\_acceptor\_service\_impl. In other words you would then have one acceptor\_service\_impl<>, so you'd use acceptor\_service\_impl<scgi> acceptor\_service\_impl\_; // and acceptor\_service\_impl<fcgi> acceptor\_service\_impl\_; // etc...
+[section:begin common::path_info::begin]
 
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
+[indexterm2 begin..common::path_info]
+
+ iterator ``[link cgi.reference.common__path_info.begin.overload1 begin]``();
+
+ const_iterator ``[link cgi.reference.common__path_info.begin.overload2 begin]``() const;
+
+
+[section:overload1 common::path_info::begin (1 of 2 overloads)]
+
+
+
+ iterator begin();
 
 
 
@@ -21925,143 +9521,97 @@
 
 
 
-[section:set_protocol_service fcgi_request_acceptor_service::set_protocol_service]
+[section:overload2 common::path_info::begin (2 of 2 overloads)]
 
-[indexterm2 set_protocol_service..fcgi_request_acceptor_service]
 
- template<
- typename T >
- void set_protocol_service(
- implementation_type & impl,
- T & ps);
+
+ const_iterator begin() const;
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:shutdown_service fcgi_request_acceptor_service::shutdown_service]
 
-[indexterm2 shutdown_service..fcgi_request_acceptor_service]
+[section:const_iterator common::path_info::const_iterator]
+
+[indexterm2 const_iterator..common::path_info]
+
+ typedef vector_type::const_iterator const_iterator;
 
- void shutdown_service();
 
 
 
 [endsect]
 
 
+[section:end common::path_info::end]
+
+[indexterm2 end..common::path_info]
+
+ iterator ``[link cgi.reference.common__path_info.end.overload1 end]``();
+
+ const_iterator ``[link cgi.reference.common__path_info.end.overload2 end]``() const;
+
+
+[section:overload1 common::path_info::end (1 of 2 overloads)]
+
+
+
+ iterator end();
+
+
 
 [endsect]
 
-[section:request_acceptor_service request_acceptor_service]
 
 
+[section:overload2 common::path_info::end (2 of 2 overloads)]
 
- template<
- typename Protocol >
- class request_acceptor_service
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ const_iterator end() const;
 
- [
 
- [[link cgi.reference.request_acceptor_service.implementation_type [*implementation_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.request_acceptor_service.protocol_type [*protocol_type]]]
- []
-
- ]
 
-]
+[endsect]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.request_acceptor_service.accept [*accept]]]
- [Accept a request. ]
- ]
-
- [
- [[link cgi.reference.request_acceptor_service.async_accept [*async_accept]]]
- [Asynchronously accept a request. ]
- ]
-
- [
- [[link cgi.reference.request_acceptor_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.request_acceptor_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.request_acceptor_service.request_acceptor_service [*request_acceptor_service]]]
- []
- ]
-
- [
- [[link cgi.reference.request_acceptor_service.shutdown_service [*shutdown_service]]]
- []
- ]
-
-]
+[section:extension common::path_info::extension]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[indexterm2 extension..common::path_info]
 
- [
- [[link cgi.reference.request_acceptor_service.id [*id]]]
- []
- ]
+ string_type extension() const;
 
-]
 
 
-[section:accept request_acceptor_service::accept]
+[endsect]
 
-[indexterm2 accept..request_acceptor_service] Accept a request.
 
- template<
- typename CommonGatewayRequest >
- boost::system::error_code & accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- boost::system::error_code & ec);
+
+[section:iterator common::path_info::iterator]
+
+[indexterm2 iterator..common::path_info]
+
+ typedef vector_type::iterator iterator;
 
 
-Check if there is a waiting request in the queue. If not, accept a connection, and associate it with the request.
 
 
 [endsect]
 
 
 
-[section:async_accept request_acceptor_service::async_accept]
+[section:operator_value_type_& common::path_info::operator value_type &]
 
-[indexterm2 async_accept..request_acceptor_service] Asynchronously accept a request.
+[indexterm2 operator value_type &..common::path_info]
 
- template<
- typename CommonGatewayRequest ,
- typename Handler >
- void async_accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Handler handler);
+ operator value_type &();
 
 
 
@@ -22069,12 +9619,12 @@
 
 
 
-[section:construct request_acceptor_service::construct]
+[section:operator_openbrace__closebrace_ common::path_info::operator[]]
 
-[indexterm2 construct..request_acceptor_service]
+[indexterm2 operator[]..common::path_info]
 
- void construct(
- implementation_type & impl);
+ value_type & operator[](
+ int i);
 
 
 
@@ -22082,63 +9632,66 @@
 
 
 
-[section:destroy request_acceptor_service::destroy]
+[section:parts common::path_info::parts]
 
-[indexterm2 destroy..request_acceptor_service]
+[indexterm2 parts..common::path_info]
 
- void destroy(
- implementation_type & impl);
+ vector_type parts;
 
 
 
 [endsect]
 
 
+[section:path_info common::path_info::path_info]
 
-[section:id request_acceptor_service::id]
-
-[indexterm2 id..request_acceptor_service]
-
- static boost::asio::detail::service_id< request_acceptor_service< Protocol > > id;
+[indexterm2 path_info..common::path_info]
 
+ template<
+ typename P >
+ ``[link cgi.reference.common__path_info.path_info.overload1 path_info]``(
+ basic_request< P > & request);
 
+ ``[link cgi.reference.common__path_info.path_info.overload2 path_info]``(
+ value_type const & str);
 
-[endsect]
 
+[section:overload1 common::path_info::path_info (1 of 2 overloads)]
 
 
-[section:implementation_type request_acceptor_service::implementation_type]
 
-[indexterm2 implementation_type..request_acceptor_service]
+ template<
+ typename P >
+ path_info(
+ basic_request< P > & request);
 
- typedef service_impl_type::impl_type implementation_type;
 
 
+[endsect]
 
 
-[endsect]
 
+[section:overload2 common::path_info::path_info (2 of 2 overloads)]
 
 
-[section:protocol_type request_acceptor_service::protocol_type]
 
-[indexterm2 protocol_type..request_acceptor_service]
+ path_info(
+ value_type const & str);
 
- typedef Protocol protocol_type;
 
 
+[endsect]
 
 
 [endsect]
 
 
+[section:size_type common::path_info::size_type]
 
-[section:request_acceptor_service request_acceptor_service::request_acceptor_service]
+[indexterm2 size_type..common::path_info]
 
-[indexterm2 request_acceptor_service..request_acceptor_service]
+ typedef string_type::size_type size_type;
 
- request_acceptor_service(
- basic_protocol_service< protocol_type > & s);
 
 
 
@@ -22146,11 +9699,11 @@
 
 
 
-[section:shutdown_service request_acceptor_service::shutdown_service]
+[section:stem common::path_info::stem]
 
-[indexterm2 shutdown_service..request_acceptor_service]
+[indexterm2 stem..common::path_info]
 
- void shutdown_service();
+ string_type stem() const;
 
 
 
@@ -22158,118 +9711,87 @@
 
 
 
-[endsect]
+[section:string common::path_info::string]
 
-[section:role__authorizer role::authorizer]
+[indexterm2 string..common::path_info]
 
+ value_type & string();
 
 
- struct authorizer
 
+[endsect]
 
 
-[endsect]
 
-[section:role__filter role::filter]
+[section:string_type common::path_info::string_type]
 
+[indexterm2 string_type..common::path_info]
 
+ typedef value_type string_type;
 
- struct filter
 
 
 
 [endsect]
 
-[section:role__responder role::responder]
-
 
 
- struct responder
+[section:value common::path_info::value]
 
+[indexterm2 value..common::path_info]
 
+ value_type value;
 
-[endsect]
 
 
-[section:role_type role_type]
+[endsect]
 
-[indexterm1 role_type]
 
- enum role_type
 
-[heading Values]
-[variablelist
+[section:value_type common::path_info::value_type]
 
- [
- [none]
- []
- ]
+[indexterm2 value_type..common::path_info]
 
- [
- [responder]
- []
- ]
+ typedef std::string value_type;
 
- [
- [authorizer]
- []
- ]
 
- [
- [filter]
- []
- ]
 
-]
 
+[endsect]
 
 
-[endsect]
 
+[section:vector_type common::path_info::vector_type]
 
+[indexterm2 vector_type..common::path_info]
 
-[section:scgi__acceptor scgi::acceptor]
+ typedef std::vector< value_type > vector_type;
 
-[indexterm1 scgi::acceptor] Typedef for common usage (SCGI).
 
- typedef basic_request_acceptor< scgi_request_acceptor_service<> > acceptor;
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.scgi_request_acceptor_service.endpoint_type [*endpoint_type]]]
- []
-
- ]
 
- [
+[endsect]
 
- [[link cgi.reference.scgi_request_acceptor_service.implementation_type [*implementation_type]]]
- []
-
- ]
+[section:common__request_base common::request_base]
 
- [
+ABC that defines the common interface for basic_request<>s.
 
- [[link cgi.reference.scgi_request_acceptor_service.native_type [*native_type]]]
- []
-
- ]
+ template<
+ typename Protocol >
+ class request_base
 
- [
 
- [[link cgi.reference.scgi_request_acceptor_service.protocol_type [*protocol_type]]]
- []
-
- ]
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link cgi.reference.scgi_request_acceptor_service.service_impl_type [*service_impl_type]]]
+ [[link cgi.reference.common__request_base.base_type [*base_type]]]
     []
   
   ]
@@ -22281,107 +9803,75 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi_request_acceptor_service.accept [*accept]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_acceptor_service.assign [*assign]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_acceptor_service.async_accept [*async_accept]]]
- []
+ [[link cgi.reference.common__request_base.client [*client]]]
+ [Return the connection associated with the request. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.bind [*bind]]]
+ [[link cgi.reference.common__request_base.destroy [*destroy]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.close [*close]]]
- []
+ [[link cgi.reference.common__request_base.is_open [*is_open]]]
+ [Return if the request is still open. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.construct [*construct]]]
- []
+ [[link cgi.reference.common__request_base.load [*load]]]
+ [Synchronously read/parse the request meta-data. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.destroy [*destroy]]]
- []
+ [[link cgi.reference.common__request_base.load_environment [*load_environment]]]
+ [Load the base_environment into the current environment. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.is_open [*is_open]]]
- []
+ [[link cgi.reference.common__request_base.parse_cookie_vars [*parse_cookie_vars]]]
+ [Read and parse the HTTP_COOKIE meta variable. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.listen [*listen]]]
- []
+ [[link cgi.reference.common__request_base.parse_get_vars [*parse_get_vars]]]
+ [Read and parse the cgi GET meta variables. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.local_endpoint [*local_endpoint]]]
- []
+ [[link cgi.reference.common__request_base.parse_post_vars [*parse_post_vars]]]
+ [Read and parse the cgi POST meta variables. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.open [*open]]]
- []
+ [[link cgi.reference.common__request_base.read_some [*read_some]]]
+ [Read some data into the internal buffer. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.scgi_request_acceptor_service [*scgi_request_acceptor_service]]]
- [The unique service identifier. ]
+ [[link cgi.reference.common__request_base.request_id [*request_id]]]
+ [Get the request ID of a FastCGI request, or 1. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.set_protocol_service [*set_protocol_service]]]
+ [[link cgi.reference.common__request_base.set_service [*set_service]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.shutdown_service [*shutdown_service]]]
- []
+ [[link cgi.reference.common__request_base.status [*status]]]
+ [Get the request status. ]
   ]
   
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.scgi_request_acceptor_service.id [*id]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_acceptor_service.service_impl_ [*service_impl_]]]
- []
- ]
-
-]
-
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
-
-
-
-[endsect]
+This class provides generic member functions that can be used by any request type.
 
 
-[section:scgi__acceptor_service_impl scgi::acceptor_service_impl]
+[section:base_type common::request_base::base_type]
 
-The service_impl class for SCGI basic_request_acceptor<>s.
+[indexterm2 base_type..common::request_base]
 
- template<
- typename Protocol_ = ::cgi::scgi_>
- class acceptor_service_impl
+ typedef common::request_base< Protocol > base_type;
 
 
 [heading Types]
@@ -22390,49 +9880,7 @@
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type [*implementation_type]]]
- [The unique service identifier. ]
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.native_protocol_type [*native_protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.native_type [*native_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.type [*type]]]
+ [[link cgi.reference.common__request_base.base_type [*base_type]]]
     []
   
   ]
@@ -22444,135 +9892,113 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi__acceptor_service_impl.accept [*accept]]]
- [Accepts one request. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_impl [*acceptor_service_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.assign [*assign]]]
- [Assign an existing native acceptor to a *socket* acceptor. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.async_accept [*async_accept]]]
- [Asynchronously accepts one request. ]
+ [[link cgi.reference.common__request_base.client [*client]]]
+ [Return the connection associated with the request. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.bind [*bind]]]
+ [[link cgi.reference.common__request_base.destroy [*destroy]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.close [*close]]]
- [Close the acceptor (not implemented yet). ]
+ [[link cgi.reference.common__request_base.is_open [*is_open]]]
+ [Return if the request is still open. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.construct [*construct]]]
- []
+ [[link cgi.reference.common__request_base.load [*load]]]
+ [Synchronously read/parse the request meta-data. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.destroy [*destroy]]]
- []
+ [[link cgi.reference.common__request_base.load_environment [*load_environment]]]
+ [Load the base_environment into the current environment. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.get_protocol_service [*get_protocol_service]]]
- []
+ [[link cgi.reference.common__request_base.parse_cookie_vars [*parse_cookie_vars]]]
+ [Read and parse the HTTP_COOKIE meta variable. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.is_open [*is_open]]]
- [Check if the given implementation is open. ]
+ [[link cgi.reference.common__request_base.parse_get_vars [*parse_get_vars]]]
+ [Read and parse the cgi GET meta variables. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.listen [*listen]]]
- []
+ [[link cgi.reference.common__request_base.parse_post_vars [*parse_post_vars]]]
+ [Read and parse the cgi POST meta variables. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.local_endpoint [*local_endpoint]]]
- []
+ [[link cgi.reference.common__request_base.read_some [*read_some]]]
+ [Read some data into the internal buffer. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.open [*open]]]
- [Open a new *socket* acceptor implementation. ]
+ [[link cgi.reference.common__request_base.request_id [*request_id]]]
+ [Get the request ID of a FastCGI request, or 1. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.set_protocol_service [*set_protocol_service]]]
+ [[link cgi.reference.common__request_base.set_service [*set_service]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.shutdown_service [*shutdown_service]]]
- []
+ [[link cgi.reference.common__request_base.status [*status]]]
+ [Get the request status. ]
   ]
   
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+This class provides generic member functions that can be used by any request type.
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_ [*acceptor_service_]]]
- [The underlying socket acceptor service. ]
- ]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl.id [*id]]]
- []
- ]
 
-]
+[endsect]
 
-Note: this is near enough to being generic. It will hopefully translate directly to the fcgi\_acceptor\_service\_impl. In other words you would then have one acceptor\_service\_impl<>, so you'd use acceptor\_service\_impl<scgi> acceptor\_service\_impl\_; // and acceptor\_service\_impl<fcgi> acceptor\_service\_impl\_; // etc...
 
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
 
-[section:accept scgi::acceptor_service_impl::accept]
+[section:client common::request_base::client]
 
-[indexterm2 accept..scgi::acceptor_service_impl] Accepts one request.
+[indexterm2 client..common::request_base] Return the connection associated with the request.
 
   template<
- typename CommonGatewayRequest ,
- typename Endpoint >
- boost::system::error_code ``[link cgi.reference.scgi__acceptor_service_impl.accept.overload1 accept]``(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Endpoint * endpoint,
- boost::system::error_code & ec);
+ typename ImplType >
+ ImplType::client_type & client(
+ ImplType & impl);
+
+
+
+[endsect]
+
+
+
+[section:destroy common::request_base::destroy]
+
+[indexterm2 destroy..common::request_base]
 
   template<
- typename CommonGatewayRequest >
- boost::system::error_code ``[link cgi.reference.scgi__acceptor_service_impl.accept.overload2 accept]``(
- implementation_type & impl,
- CommonGatewayRequest & request,
- boost::system::error_code & ec);
+ typename ImplType >
+ void destroy(
+ ImplType & impl);
+
+
+
+[endsect]
 
 
-[section:overload1 scgi::acceptor_service_impl::accept (1 of 2 overloads)]
 
-Accepts one request.
+[section:is_open common::request_base::is_open]
+
+[indexterm2 is_open..common::request_base] Return if the request is still open.
 
   template<
- typename CommonGatewayRequest ,
- typename Endpoint >
- boost::system::error_code accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Endpoint * endpoint,
- boost::system::error_code & ec);
+ typename ImplType >
+ bool is_open(
+ ImplType & impl);
 
 
 
@@ -22580,15 +10006,15 @@
 
 
 
-[section:overload2 scgi::acceptor_service_impl::accept (2 of 2 overloads)]
+[section:load common::request_base::load]
 
-Accepts one request.
+[indexterm2 load..common::request_base] Synchronously read/parse the request meta-data.
 
   template<
- typename CommonGatewayRequest >
- boost::system::error_code accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
+ typename ImplType >
+ boost::system::error_code load(
+ ImplType & impl,
+ common::parse_options parse_opts,
       boost::system::error_code & ec);
 
 
@@ -22596,27 +10022,37 @@
 [endsect]
 
 
-[endsect]
 
+[section:load_environment common::request_base::load_environment]
+
+[indexterm2 load_environment..common::request_base] Load the base_environment into the current environment.
 
-[section:acceptor_service_ scgi::acceptor_service_impl::acceptor_service_]
+ template<
+ typename ImplType >
+ void load_environment(
+ ImplType & impl,
+ char ** base_environment,
+ bool is_command_line);
 
-[indexterm2 acceptor_service_..scgi::acceptor_service_impl] The underlying socket acceptor service.
 
- acceptor_service_type & acceptor_service_;
+Parsed the base\_environment and add it to the current request's environment. This overwrites any environment variables with the existing key.
 
+If `is\_command\_line` is true, then the first argument is skipped as this is the name of the program and ignored. Using it actually causes a crash on Windows (MSVC 9) anyway: I'm not exactly sure why.
 
 
 [endsect]
 
 
 
-[section:acceptor_service_impl scgi::acceptor_service_impl::acceptor_service_impl]
+[section:parse_cookie_vars common::request_base::parse_cookie_vars]
 
-[indexterm2 acceptor_service_impl..scgi::acceptor_service_impl]
+[indexterm2 parse_cookie_vars..common::request_base] Read and parse the HTTP_COOKIE meta variable.
 
- acceptor_service_impl(
- ::cgi::io_service & ios);
+ template<
+ typename ImplType >
+ boost::system::error_code parse_cookie_vars(
+ ImplType & impl,
+ boost::system::error_code & ec);
 
 
 
@@ -22624,12 +10060,15 @@
 
 
 
-[section:acceptor_service_type scgi::acceptor_service_impl::acceptor_service_type]
-
-[indexterm2 acceptor_service_type..scgi::acceptor_service_impl]
+[section:parse_get_vars common::request_base::parse_get_vars]
 
- typedef type::implementation_type::acceptor_service_type acceptor_service_type;
+[indexterm2 parse_get_vars..common::request_base] Read and parse the cgi GET meta variables.
 
+ template<
+ typename ImplType >
+ boost::system::error_code parse_get_vars(
+ ImplType & impl,
+ boost::system::error_code & ec);
 
 
 
@@ -22637,14 +10076,16 @@
 
 
 
-[section:assign scgi::acceptor_service_impl::assign]
+[section:parse_post_vars common::request_base::parse_post_vars]
 
-[indexterm2 assign..scgi::acceptor_service_impl] Assign an existing native acceptor to a *socket* acceptor.
+[indexterm2 parse_post_vars..common::request_base] Read and parse the cgi POST meta variables.
 
- boost::system::error_code assign(
- implementation_type & impl,
- const native_protocol_type & protocol,
- const native_type & native_acceptor,
+ template<
+ typename ImplType ,
+ typename Callback >
+ boost::system::error_code & parse_post_vars(
+ ImplType & impl,
+ Callback callback,
       boost::system::error_code & ec);
 
 
@@ -22652,18 +10093,33 @@
 [endsect]
 
 
+[section:read_some common::request_base::read_some]
 
-[section:async_accept scgi::acceptor_service_impl::async_accept]
+[indexterm2 read_some..common::request_base] Read some data into the internal buffer.
 
-[indexterm2 async_accept..scgi::acceptor_service_impl] Asynchronously accepts one request.
+ template<
+ typename ImplType >
+ std::size_t ``[link cgi.reference.common__request_base.read_some.overload1 read_some]``(
+ ImplType & impl,
+ boost::system::error_code & ec);
 
   template<
- typename CommonGatewayRequest ,
- typename Handler >
- void async_accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Handler handler,
+ typename ImplType ,
+ typename MutableBufferSequence >
+ std::size_t ``[link cgi.reference.common__request_base.read_some.overload2 read_some]``(
+ ImplType & impl,
+ const MutableBufferSequence & buf,
+ boost::system::error_code & ec);
+
+
+[section:overload1 common::request_base::read_some (1 of 2 overloads)]
+
+Read some data into the internal buffer.
+
+ template<
+ typename ImplType >
+ std::size_t read_some(
+ ImplType & impl,
       boost::system::error_code & ec);
 
 
@@ -22672,15 +10128,16 @@
 
 
 
-[section:bind scgi::acceptor_service_impl::bind]
+[section:overload2 common::request_base::read_some (2 of 2 overloads)]
 
-[indexterm2 bind..scgi::acceptor_service_impl]
+Read some data from the client into the supplied buffer.
 
   template<
- typename Endpoint >
- boost::system::error_code bind(
- implementation_type & impl,
- const Endpoint & endpoint,
+ typename ImplType ,
+ typename MutableBufferSequence >
+ std::size_t read_some(
+ ImplType & impl,
+ const MutableBufferSequence & buf,
       boost::system::error_code & ec);
 
 
@@ -22688,14 +10145,17 @@
 [endsect]
 
 
+[endsect]
 
-[section:close scgi::acceptor_service_impl::close]
 
-[indexterm2 close..scgi::acceptor_service_impl] Close the acceptor (not implemented yet).
+[section:request_id common::request_base::request_id]
 
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
+[indexterm2 request_id..common::request_base] Get the request ID of a FastCGI request, or 1.
+
+ template<
+ typename ImplType >
+ boost::uint16_t const & request_id(
+ ImplType & impl) const;
 
 
 
@@ -22703,25 +10163,45 @@
 
 
 
-[section:construct scgi::acceptor_service_impl::construct]
+[section:set_service common::request_base::set_service]
 
-[indexterm2 construct..scgi::acceptor_service_impl]
+[indexterm2 set_service..common::request_base]
 
- void construct(
- implementation_type & impl);
+ template<
+ typename ImplType >
+ void set_service(
+ ImplType & impl,
+ typename ImplType::protocol_service_type & ps);
 
 
 
 [endsect]
 
 
+[section:status common::request_base::status]
+
+[indexterm2 status..common::request_base] Get the request status.
+
+ template<
+ typename ImplType >
+ common::request_status ``[link cgi.reference.common__request_base.status.overload1 status]``(
+ ImplType & impl) const;
+
+ template<
+ typename ImplType >
+ void ``[link cgi.reference.common__request_base.status.overload2 status]``(
+ ImplType & impl,
+ common::request_status status);
 
-[section:destroy scgi::acceptor_service_impl::destroy]
 
-[indexterm2 destroy..scgi::acceptor_service_impl]
+[section:overload1 common::request_base::status (1 of 2 overloads)]
 
- void destroy(
- implementation_type & impl);
+Get the request status.
+
+ template<
+ typename ImplType >
+ common::request_status status(
+ ImplType & impl) const;
 
 
 
@@ -22729,37 +10209,60 @@
 
 
 
-[section:get_protocol_service scgi::acceptor_service_impl::get_protocol_service]
+[section:overload2 common::request_base::status (2 of 2 overloads)]
 
-[indexterm2 get_protocol_service..scgi::acceptor_service_impl]
+Set the request status.
 
- protocol_service_type & get_protocol_service(
- implementation_type & impl);
+ template<
+ typename ImplType >
+ void status(
+ ImplType & impl,
+ common::request_status status);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:id scgi::acceptor_service_impl::id]
 
-[indexterm2 id..scgi::acceptor_service_impl]
+[endsect]
 
- static boost::asio::detail::service_id< acceptor_service_impl< Protocol_ > > id;
+[section:common__request_base__callback_functor common::request_base::callback_functor]
 
 
 
-[endsect]
+ template<
+ typename ImplType ,
+ typename Service >
+ struct callback_functor
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__request_base__callback_functor.callback_functor [*callback_functor]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__request_base__callback_functor.operator() [*operator()]]]
+ []
+ ]
+
+]
 
 
-[section:is_open scgi::acceptor_service_impl::is_open]
+[section:callback_functor common::request_base::callback_functor::callback_functor]
 
-[indexterm2 is_open..scgi::acceptor_service_impl] Check if the given implementation is open.
+[indexterm2 callback_functor..common::request_base::callback_functor]
 
- bool is_open(
- implementation_type & impl);
+ callback_functor(
+ ImplType & impl,
+ Service * service);
 
 
 
@@ -22767,13 +10270,11 @@
 
 
 
-[section:listen scgi::acceptor_service_impl::listen]
+[section:operator() common::request_base::callback_functor::operator()]
 
-[indexterm2 listen..scgi::acceptor_service_impl]
+[indexterm2 operator()..common::request_base::callback_functor]
 
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
+ std::size_t operator()(
       boost::system::error_code & ec);
 
 
@@ -22782,80 +10283,224 @@
 
 
 
-[section:local_endpoint scgi::acceptor_service_impl::local_endpoint]
+[endsect]
 
-[indexterm2 local_endpoint..scgi::acceptor_service_impl]
+[section:common__request_base__impl_base common::request_base::impl_base]
 
- implementation_type::endpoint_type local_endpoint(
- implementation_type & impl,
- boost::system::error_code & ec);
 
 
+ struct impl_base
 
-[endsect]
 
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.base_type [*base_type]]]
+ []
+
+ ]
 
-[section:native_protocol_type scgi::acceptor_service_impl::native_protocol_type]
+ [
 
-[indexterm2 native_protocol_type..scgi::acceptor_service_impl]
+ [[link cgi.reference.common__request_base__impl_base.buffer_type [*buffer_type]]]
+ []
+
+ ]
 
- typedef type::implementation_type::native_protocol_type native_protocol_type;
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.char_type [*char_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.client_type [*client_type]]]
+ []
+
+ ]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.conn_ptr [*conn_ptr]]]
+ []
+
+ ]
 
+ [
 
-[section:native_type scgi::acceptor_service_impl::native_type]
+ [[link cgi.reference.common__request_base__impl_base.connection_type [*connection_type]]]
+ []
+
+ ]
 
-[indexterm2 native_type..scgi::acceptor_service_impl]
+ [
 
- typedef acceptor_service_type::native_type native_type;
+ [[link cgi.reference.common__request_base__impl_base.const_buffers_type [*const_buffers_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.form_parser_type [*form_parser_type]]]
+ []
+
+ ]
 
+ [
 
-[endsect]
+ [[link cgi.reference.common__request_base__impl_base.mutable_buffers_type [*mutable_buffers_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.protocol_service_type [*protocol_service_type]]]
+ []
+
+ ]
 
-[section:open scgi::acceptor_service_impl::open]
+ [
 
-[indexterm2 open..scgi::acceptor_service_impl] Open a new *socket* acceptor implementation.
+ [[link cgi.reference.common__request_base__impl_base.protocol_type [*protocol_type]]]
+ []
+
+ ]
 
- boost::system::error_code open(
- implementation_type & impl,
- const native_protocol_type & protocol,
- boost::system::error_code & ec);
+ [
+
+ [[link cgi.reference.common__request_base__impl_base.request_type [*request_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__request_base__impl_base.string_type [*string_type]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__request_base__impl_base.traits [*traits]]]
+ []
+
+ ]
+
+ [
+
+ [[link cgi.reference.common__request_base__impl_base.var_map_type [*var_map_type]]]
+ []
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.http_status [*http_status]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__request_base__impl_base.impl_base [*impl_base]]]
+ [Construct. ]
+ ]
+
+ [
+ [[link cgi.reference.common__request_base__impl_base.prepare [*prepare]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__request_base__impl_base.status [*status]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__request_base__impl_base.stdin_parsed [*stdin_parsed]]]
+ []
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
+ [[link cgi.reference.common__request_base__impl_base.all_done_ [*all_done_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.bytes_left_ [*bytes_left_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.client_ [*client_]]]
+ []
+ ]
 
-[section:protocol_service_type scgi::acceptor_service_impl::protocol_service_type]
+ [
+ [[link cgi.reference.common__request_base__impl_base.form_parts_ [*form_parts_]]]
+ []
+ ]
 
-[indexterm2 protocol_service_type..scgi::acceptor_service_impl]
+ [
+ [[link cgi.reference.common__request_base__impl_base.fp_ [*fp_]]]
+ []
+ ]
 
- typedef type::implementation_type::protocol_service_type protocol_service_type;
+ [
+ [[link cgi.reference.common__request_base__impl_base.http_status_ [*http_status_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.post_buffer_ [*post_buffer_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.request_status_ [*request_status_]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.service_ [*service_]]]
+ []
+ ]
 
-[endsect]
+ [
+ [[link cgi.reference.common__request_base__impl_base.stdin_parsed_ [*stdin_parsed_]]]
+ [Whether the post data has been parsed yet. ]
+ ]
 
+ [
+ [[link cgi.reference.common__request_base__impl_base.vars_ [*vars_]]]
+ []
+ ]
 
+]
 
-[section:protocol_type scgi::acceptor_service_impl::protocol_type]
 
-[indexterm2 protocol_type..scgi::acceptor_service_impl]
+[section:all_done_ common::request_base::impl_base::all_done_]
 
- typedef type::implementation_type::protocol_type protocol_type;
+[indexterm2 all_done_..common::request_base::impl_base]
 
+ bool all_done_;
 
 
 
@@ -22863,88 +10508,118 @@
 
 
 
-[section:set_protocol_service scgi::acceptor_service_impl::set_protocol_service]
+[section:base_type common::request_base::impl_base::base_type]
 
-[indexterm2 set_protocol_service..scgi::acceptor_service_impl]
+[indexterm2 base_type..common::request_base::impl_base]
 
- void set_protocol_service(
- implementation_type & impl,
- protocol_service_type & ps);
+ typedef impl_base base_type;
 
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.base_type [*base_type]]]
+ []
+
+ ]
 
+ [
 
-[section:shutdown_service scgi::acceptor_service_impl::shutdown_service]
+ [[link cgi.reference.common__request_base__impl_base.buffer_type [*buffer_type]]]
+ []
+
+ ]
 
-[indexterm2 shutdown_service..scgi::acceptor_service_impl]
+ [
 
- void shutdown_service();
+ [[link cgi.reference.common__request_base__impl_base.char_type [*char_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.client_type [*client_type]]]
+ []
+
+ ]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__request_base__impl_base.conn_ptr [*conn_ptr]]]
+ []
+
+ ]
 
+ [
 
-[section:type scgi::acceptor_service_impl::type]
+ [[link cgi.reference.common__request_base__impl_base.connection_type [*connection_type]]]
+ []
+
+ ]
 
-[indexterm2 type..scgi::acceptor_service_impl]
+ [
 
- typedef acceptor_service_impl< Protocol_ > type;
+ [[link cgi.reference.common__request_base__impl_base.const_buffers_type [*const_buffers_type]]]
+ []
+
+ ]
 
+ [
 
-[heading Types]
-[table
- [[Name][Description]]
+ [[link cgi.reference.common__request_base__impl_base.form_parser_type [*form_parser_type]]]
+ []
+
+ ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_type [*acceptor_service_type]]]
+ [[link cgi.reference.common__request_base__impl_base.mutable_buffers_type [*mutable_buffers_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type [*implementation_type]]]
- [The unique service identifier. ]
+ [[link cgi.reference.common__request_base__impl_base.protocol_service_type [*protocol_service_type]]]
+ []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.native_protocol_type [*native_protocol_type]]]
+ [[link cgi.reference.common__request_base__impl_base.protocol_type [*protocol_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.native_type [*native_type]]]
+ [[link cgi.reference.common__request_base__impl_base.request_type [*request_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.protocol_service_type [*protocol_service_type]]]
+ [[link cgi.reference.common__request_base__impl_base.string_type [*string_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__request_base__impl_base.traits [*traits]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl.type [*type]]]
+ [[link cgi.reference.common__request_base__impl_base.var_map_type [*var_map_type]]]
     []
   
   ]
@@ -22956,101 +10631,219 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi__acceptor_service_impl.accept [*accept]]]
- [Accepts one request. ]
+ [[link cgi.reference.common__request_base__impl_base.http_status [*http_status]]]
+ []
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_impl [*acceptor_service_impl]]]
- []
+ [[link cgi.reference.common__request_base__impl_base.impl_base [*impl_base]]]
+ [Construct. ]
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.assign [*assign]]]
- [Assign an existing native acceptor to a *socket* acceptor. ]
+ [[link cgi.reference.common__request_base__impl_base.prepare [*prepare]]]
+ []
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.async_accept [*async_accept]]]
- [Asynchronously accepts one request. ]
+ [[link cgi.reference.common__request_base__impl_base.status [*status]]]
+ []
   ]
   
   [
- [[link cgi.reference.scgi__acceptor_service_impl.bind [*bind]]]
+ [[link cgi.reference.common__request_base__impl_base.stdin_parsed [*stdin_parsed]]]
     []
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.close [*close]]]
- [Close the acceptor (not implemented yet). ]
+ [[link cgi.reference.common__request_base__impl_base.all_done_ [*all_done_]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.construct [*construct]]]
+ [[link cgi.reference.common__request_base__impl_base.bytes_left_ [*bytes_left_]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.destroy [*destroy]]]
+ [[link cgi.reference.common__request_base__impl_base.client_ [*client_]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.get_protocol_service [*get_protocol_service]]]
+ [[link cgi.reference.common__request_base__impl_base.form_parts_ [*form_parts_]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.is_open [*is_open]]]
- [Check if the given implementation is open. ]
+ [[link cgi.reference.common__request_base__impl_base.fp_ [*fp_]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.listen [*listen]]]
+ [[link cgi.reference.common__request_base__impl_base.http_status_ [*http_status_]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.local_endpoint [*local_endpoint]]]
+ [[link cgi.reference.common__request_base__impl_base.post_buffer_ [*post_buffer_]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.open [*open]]]
- [Open a new *socket* acceptor implementation. ]
+ [[link cgi.reference.common__request_base__impl_base.request_status_ [*request_status_]]]
+ []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.set_protocol_service [*set_protocol_service]]]
+ [[link cgi.reference.common__request_base__impl_base.service_ [*service_]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl.shutdown_service [*shutdown_service]]]
+ [[link cgi.reference.common__request_base__impl_base.stdin_parsed_ [*stdin_parsed_]]]
+ [Whether the post data has been parsed yet. ]
+ ]
+
+ [
+ [[link cgi.reference.common__request_base__impl_base.vars_ [*vars_]]]
     []
   ]
-
+
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_ [*acceptor_service_]]]
- [The underlying socket acceptor service. ]
- ]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl.id [*id]]]
- []
- ]
+[endsect]
+
+
+
+[section:buffer_type common::request_base::impl_base::buffer_type]
+
+[indexterm2 buffer_type..common::request_base::impl_base]
+
+ typedef traits::buffer_type buffer_type;
+
+
+
+
+[endsect]
+
+
+
+[section:bytes_left_ common::request_base::impl_base::bytes_left_]
+
+[indexterm2 bytes_left_..common::request_base::impl_base]
+
+ std::size_t bytes_left_;
+
+
+
+[endsect]
+
+
+
+[section:char_type common::request_base::impl_base::char_type]
+
+[indexterm2 char_type..common::request_base::impl_base]
+
+ typedef traits::char_type char_type;
+
+
+
+
+[endsect]
+
+
+
+[section:client_ common::request_base::impl_base::client_]
+
+[indexterm2 client_..common::request_base::impl_base]
+
+ client_type client_;
+
+
+
+[endsect]
+
+
+
+[section:client_type common::request_base::impl_base::client_type]
+
+[indexterm2 client_type..common::request_base::impl_base]
+
+ typedef traits::client_type client_type;
+
+
+
+
+[endsect]
+
+
+
+[section:conn_ptr common::request_base::impl_base::conn_ptr]
+
+[indexterm2 conn_ptr..common::request_base::impl_base]
+
+ typedef connection_type::pointer conn_ptr;
+
+
+
+
+[endsect]
+
+
+
+[section:connection_type common::request_base::impl_base::connection_type]
+
+[indexterm2 connection_type..common::request_base::impl_base]
+
+ typedef traits::connection_type connection_type;
+
+
+
+
+[endsect]
+
+
+
+[section:const_buffers_type common::request_base::impl_base::const_buffers_type]
+
+[indexterm2 const_buffers_type..common::request_base::impl_base]
+
+ typedef traits::const_buffers_type const_buffers_type;
+
+
+
+
+[endsect]
+
+
+
+[section:form_parser_type common::request_base::impl_base::form_parser_type]
+
+[indexterm2 form_parser_type..common::request_base::impl_base]
+
+ typedef traits::form_parser_type form_parser_type;
+
+
+
+
+[endsect]
+
 
-]
 
-Note: this is near enough to being generic. It will hopefully translate directly to the fcgi\_acceptor\_service\_impl. In other words you would then have one acceptor\_service\_impl<>, so you'd use acceptor\_service\_impl<scgi> acceptor\_service\_impl\_; // and acceptor\_service\_impl<fcgi> acceptor\_service\_impl\_; // etc...
+[section:form_parts_ common::request_base::impl_base::form_parts_]
 
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
+[indexterm2 form_parts_..common::request_base::impl_base]
+
+ std::vector< common::form_part > form_parts_;
 
 
 
@@ -23058,112 +10851,60 @@
 
 
 
-[endsect]
+[section:fp_ common::request_base::impl_base::fp_]
 
-[section:scgi__acceptor_service_impl__implementation_type scgi::acceptor_service_impl::implementation_type]
+[indexterm2 fp_..common::request_base::impl_base]
 
-The unique service identifier.
+ boost::scoped_ptr< form_parser_type > fp_;
 
- struct implementation_type
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
 
- [
+[section:http_status common::request_base::impl_base::http_status]
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.endpoint_type [*endpoint_type]]]
- []
-
- ]
+[indexterm2 http_status..common::request_base::impl_base]
 
- [
+ common::http::status_code & http_status();
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.native_protocol_type [*native_protocol_type]]]
- []
-
- ]
 
- [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.port_number_type [*port_number_type]]]
- []
-
- ]
+[endsect]
 
- [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
 
- [
+[section:http_status_ common::request_base::impl_base::http_status_]
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.protocol_type [*protocol_type]]]
- []
-
- ]
+[indexterm2 http_status_..common::request_base::impl_base]
 
- [
+ common::http::status_code http_status_;
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.request_type [*request_type]]]
- []
-
- ]
 
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[endsect]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.acceptor_ [*acceptor_]]]
- []
- ]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.endpoint_ [*endpoint_]]]
- []
- ]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.mutex_ [*mutex_]]]
- []
- ]
+[section:impl_base common::request_base::impl_base::impl_base]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.port_num_ [*port_num_]]]
- []
- ]
+[indexterm2 impl_base..common::request_base::impl_base] Construct.
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.service_ [*service_]]]
- []
- ]
+ impl_base();
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.waiting_requests_ [*waiting_requests_]]]
- []
- ]
 
-]
 
+[endsect]
+
+
+
+[section:mutable_buffers_type common::request_base::impl_base::mutable_buffers_type]
 
-[section:acceptor_ scgi::acceptor_service_impl::implementation_type::acceptor_]
+[indexterm2 mutable_buffers_type..common::request_base::impl_base]
 
-[indexterm2 acceptor_..scgi::acceptor_service_impl::implementation_type]
+ typedef traits::mutable_buffers_type mutable_buffers_type;
 
- acceptor_service_type::implementation_type acceptor_;
 
 
 
@@ -23171,12 +10912,24 @@
 
 
 
-[section:acceptor_service_type scgi::acceptor_service_impl::implementation_type::acceptor_service_type]
+[section:post_buffer_ common::request_base::impl_base::post_buffer_]
+
+[indexterm2 post_buffer_..common::request_base::impl_base]
+
+ buffer_type post_buffer_;
+
+
+
+[endsect]
+
+
 
-[indexterm2 acceptor_service_type..scgi::acceptor_service_impl::implementation_type]
+[section:prepare common::request_base::impl_base::prepare]
 
- typedef boost::asio::socket_acceptor_service< native_protocol_type > acceptor_service_type;
+[indexterm2 prepare..common::request_base::impl_base]
 
+ mutable_buffers_type prepare(
+ std::size_t size);
 
 
 
@@ -23184,11 +10937,12 @@
 
 
 
-[section:endpoint_ scgi::acceptor_service_impl::implementation_type::endpoint_]
+[section:protocol_service_type common::request_base::impl_base::protocol_service_type]
 
-[indexterm2 endpoint_..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 protocol_service_type..common::request_base::impl_base]
+
+ typedef traits::protocol_service_type protocol_service_type;
 
- endpoint_type endpoint_;
 
 
 
@@ -23196,11 +10950,11 @@
 
 
 
-[section:endpoint_type scgi::acceptor_service_impl::implementation_type::endpoint_type]
+[section:protocol_type common::request_base::impl_base::protocol_type]
 
-[indexterm2 endpoint_type..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 protocol_type..common::request_base::impl_base]
 
- typedef boost::asio::ip::tcp::endpoint endpoint_type;
+ typedef Protocol protocol_type;
 
 
 
@@ -23209,11 +10963,11 @@
 
 
 
-[section:mutex_ scgi::acceptor_service_impl::implementation_type::mutex_]
+[section:request_status_ common::request_base::impl_base::request_status_]
 
-[indexterm2 mutex_..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 request_status_..common::request_base::impl_base]
 
- boost::mutex mutex_;
+ common::request_status request_status_;
 
 
 
@@ -23221,11 +10975,11 @@
 
 
 
-[section:native_protocol_type scgi::acceptor_service_impl::implementation_type::native_protocol_type]
+[section:request_type common::request_base::impl_base::request_type]
 
-[indexterm2 native_protocol_type..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 request_type..common::request_base::impl_base]
 
- typedef boost::asio::ip::tcp native_protocol_type;
+ typedef traits::request_type request_type;
 
 
 
@@ -23234,50 +10988,71 @@
 
 
 
-[section:port_num_ scgi::acceptor_service_impl::implementation_type::port_num_]
+[section:service_ common::request_base::impl_base::service_]
 
-[indexterm2 port_num_..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 service_..common::request_base::impl_base]
 
- port_number_type port_num_;
+ protocol_service_type * service_;
 
 
 
 [endsect]
 
 
+[section:status common::request_base::impl_base::status]
+
+[indexterm2 status..common::request_base::impl_base]
+
+ common::request_status ``[link cgi.reference.common__request_base__impl_base.status.overload1 status]``() const;
+
+ void ``[link cgi.reference.common__request_base__impl_base.status.overload2 status]``(
+ common::request_status & st);
 
-[section:port_number_type scgi::acceptor_service_impl::implementation_type::port_number_type]
 
-[indexterm2 port_number_type..scgi::acceptor_service_impl::implementation_type]
+[section:overload1 common::request_base::impl_base::status (1 of 2 overloads)]
 
- typedef unsigned short port_number_type;
 
 
+ common::request_status status() const;
+
 
 
 [endsect]
 
 
 
-[section:protocol_service_type scgi::acceptor_service_impl::implementation_type::protocol_service_type]
+[section:overload2 common::request_base::impl_base::status (2 of 2 overloads)]
+
 
-[indexterm2 protocol_service_type..scgi::acceptor_service_impl::implementation_type]
 
- typedef basic_protocol_service< protocol_type > protocol_service_type;
+ void status(
+ common::request_status & st);
+
 
 
+[endsect]
 
 
 [endsect]
 
 
+[section:stdin_parsed common::request_base::impl_base::stdin_parsed]
+
+[indexterm2 stdin_parsed..common::request_base::impl_base]
+
+ bool stdin_parsed();
+
+
+
+[endsect]
+
 
-[section:protocol_type scgi::acceptor_service_impl::implementation_type::protocol_type]
 
-[indexterm2 protocol_type..scgi::acceptor_service_impl::implementation_type]
+[section:stdin_parsed_ common::request_base::impl_base::stdin_parsed_]
 
- typedef Protocol_ protocol_type;
+[indexterm2 stdin_parsed_..common::request_base::impl_base] Whether the post data has been parsed yet.
 
+ bool stdin_parsed_;
 
 
 
@@ -23285,11 +11060,11 @@
 
 
 
-[section:request_type scgi::acceptor_service_impl::implementation_type::request_type]
+[section:string_type common::request_base::impl_base::string_type]
 
-[indexterm2 request_type..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 string_type..common::request_base::impl_base]
 
- typedef scgi::request request_type;
+ typedef traits::string_type string_type;
 
 
 
@@ -23298,11 +11073,12 @@
 
 
 
-[section:service_ scgi::acceptor_service_impl::implementation_type::service_]
+[section:traits common::request_base::impl_base::traits]
 
-[indexterm2 service_..scgi::acceptor_service_impl::implementation_type]
+[indexterm2 traits..common::request_base::impl_base]
+
+ typedef detail::protocol_traits< Protocol > traits;
 
- protocol_service_type * service_;
 
 
 
@@ -23310,26 +11086,42 @@
 
 
 
-[section:waiting_requests_ scgi::acceptor_service_impl::implementation_type::waiting_requests_]
+[section:var_map_type common::request_base::impl_base::var_map_type]
+
+[indexterm2 var_map_type..common::request_base::impl_base]
+
+ typedef boost::fusion::vector< common::env_map, common::get_map, common::post_map, common::cookie_map, common::upload_map, common::session_map > var_map_type;
 
-[indexterm2 waiting_requests_..scgi::acceptor_service_impl::implementation_type]
 
- std::queue< boost::shared_ptr< request_type > > waiting_requests_;
 
+If you want to add a new data type to a request you need to: > Update this file (just below) > Update source_enums.hpp > Update map.hpp with a new map type > Add a member variable to basic\_request<>
 
 
 [endsect]
 
 
 
+[section:vars_ common::request_base::impl_base::vars_]
+
+[indexterm2 vars_..common::request_base::impl_base]
+
+ var_map_type vars_;
+
+
+
 [endsect]
 
 
-[section:scgi__request scgi::request]
 
-[indexterm1 scgi::request]
+[endsect]
+
+[section:common__request_service common::request_service]
+
+The generic service class for basic_request<>s.
 
- typedef basic_request< scgi_request_service, service > request;
+ template<
+ typename Protocol >
+ class request_service
 
 
 [heading Types]
@@ -23338,28 +11130,28 @@
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an SCGI request. ]
+ [[link cgi.reference.common__request_service.impl_type [*impl_type]]]
+ []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.map_type [*map_type]]]
+ [[link cgi.reference.common__request_service.implementation_type [*implementation_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__request_service.protocol_service_type [*protocol_service_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.type [*type]]]
+ [[link cgi.reference.common__request_service.protocol_type [*protocol_type]]]
     []
   
   ]
@@ -23371,193 +11163,65 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi__scgi_request_service.GET [*GET]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.POST [*POST]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.client [*client]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.close [*close]]]
- [Close the request. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.cookie [*cookie]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.env [*env]]]
- [Find the environment meta-variable matching name. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.is_open [*is_open]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.load [*load]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.scgi_request_service [*scgi_request_service]]]
+ [[link cgi.reference.common__request_service.async_load [*async_load]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.shutdown_service [*shutdown_service]]]
+ [[link cgi.reference.common__request_service.construct [*construct]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service._scgi_request_service [*~scgi_request_service]]]
+ [[link cgi.reference.common__request_service.destroy [*destroy]]]
     []
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.var [*var]]]
- [Extract the var value from. ]
- ]
-
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.scgi__scgi_request_service.id [*id]]]
+ [[link cgi.reference.common__request_service.is_open [*is_open]]]
     []
   ]
-
-]
-
-
-
-[endsect]
-
-
-[section:scgi__scgi_request_impl scgi::scgi_request_impl]
-
-The implementation_type for scgi_request_service.
-
- class scgi_request_impl
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.scgi__scgi_request_impl.client_type [*client_type]]]
- []
   
- ]
-
   [
-
- [[link cgi.reference.scgi__scgi_request_impl.connection_ptr [*connection_ptr]]]
+ [[link cgi.reference.common__request_service.load [*load]]]
     []
-
   ]
-
- [
-
- [[link cgi.reference.scgi__scgi_request_impl.connection_type [*connection_type]]]
- []
   
- ]
-
   [
-
- [[link cgi.reference.scgi__scgi_request_impl.map_type [*map_type]]]
+ [[link cgi.reference.common__request_service.null [*null]]]
     []
-
   ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_impl.connection [*connection]]]
+ [[link cgi.reference.common__request_service.request_service [*request_service]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_impl.scgi_request_impl [*scgi_request_impl]]]
+ [[link cgi.reference.common__request_service.set_header [*set_header]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_impl._scgi_request_impl [*~scgi_request_impl]]]
+ [[link cgi.reference.common__request_service.shutdown_service [*shutdown_service]]]
     []
   ]
   
 ]
 
+Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
 
-[section:client_type scgi::scgi_request_impl::client_type]
 
-[indexterm2 client_type..scgi::scgi_request_impl]
+[section:async_load common::request_service::async_load]
 
- typedef ::cgi::basic_client< connection_type > client_type;
+[indexterm2 async_load..common::request_service]
 
+ template<
+ typename Handler >
+ void async_load(
+ impl_type & impl,
+ bool parse_stdin,
+ Handler handler);
 
 
 
@@ -23565,11 +11229,12 @@
 
 
 
-[section:connection scgi::scgi_request_impl::connection]
+[section:construct common::request_service::construct]
 
-[indexterm2 connection..scgi::scgi_request_impl]
+[indexterm2 construct..common::request_service]
 
- connection_ptr connection();
+ void construct(
+ impl_type & impl);
 
 
 
@@ -23577,12 +11242,12 @@
 
 
 
-[section:connection_ptr scgi::scgi_request_impl::connection_ptr]
-
-[indexterm2 connection_ptr..scgi::scgi_request_impl]
+[section:destroy common::request_service::destroy]
 
- typedef connection_type::pointer connection_ptr;
+[indexterm2 destroy..common::request_service]
 
+ void destroy(
+ impl_type & impl);
 
 
 
@@ -23590,11 +11255,11 @@
 
 
 
-[section:connection_type scgi::scgi_request_impl::connection_type]
+[section:impl_type common::request_service::impl_type]
 
-[indexterm2 connection_type..scgi::scgi_request_impl]
+[indexterm2 impl_type..common::request_service]
 
- typedef tcp_connection connection_type;
+ typedef service_impl_type::impl_type impl_type;
 
 
 
@@ -23603,11 +11268,11 @@
 
 
 
-[section:map_type scgi::scgi_request_impl::map_type]
+[section:implementation_type common::request_service::implementation_type]
 
-[indexterm2 map_type..scgi::scgi_request_impl]
+[indexterm2 implementation_type..common::request_service]
 
- typedef cgi::map map_type;
+ typedef service_impl_type::implementation_type implementation_type;
 
 
 
@@ -23616,11 +11281,12 @@
 
 
 
-[section:scgi_request_impl scgi::scgi_request_impl::scgi_request_impl]
+[section:is_open common::request_service::is_open]
 
-[indexterm2 scgi_request_impl..scgi::scgi_request_impl]
+[indexterm2 is_open..common::request_service]
 
- scgi_request_impl();
+ bool is_open(
+ impl_type & impl);
 
 
 
@@ -23628,11 +11294,14 @@
 
 
 
-[section:_scgi_request_impl scgi::scgi_request_impl::~scgi_request_impl]
+[section:load common::request_service::load]
 
-[indexterm2 ~scgi_request_impl..scgi::scgi_request_impl]
+[indexterm2 load..common::request_service]
 
- ~scgi_request_impl();
+ boost::system::error_code & load(
+ impl_type & impl,
+ bool parse_stdin,
+ boost::system::error_code & ec);
 
 
 
@@ -23640,13 +11309,23 @@
 
 
 
+[section:null common::request_service::null]
+
+[indexterm2 null..common::request_service]
+
+ impl_type null() const;
+
+
+
 [endsect]
 
-[section:scgi__scgi_request_service scgi::scgi_request_service]
 
-The IoObjectService class for a SCGI basic_request<>s.
 
- class scgi_request_service
+[section:protocol_service_type common::request_service::protocol_service_type]
+
+[indexterm2 protocol_service_type..common::request_service]
+
+ typedef common::basic_protocol_service< Protocol > protocol_service_type;
 
 
 [heading Types]
@@ -23655,171 +11334,143 @@
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an SCGI request. ]
+ [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
+ []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.type [*type]]]
+ [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
     []
   
   ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.scgi__scgi_request_service.GET [*GET]]]
+
+ [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
     []
- ]
   
- [
- [[link cgi.reference.scgi__scgi_request_service.POST [*POST]]]
- []
   ]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_service.client [*client]]]
+
+ [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
     []
- ]
   
- [
- [[link cgi.reference.scgi__scgi_request_service.close [*close]]]
- [Close the request. ]
   ]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_service.construct [*construct]]]
+
+ [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
     []
- ]
   
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.scgi__scgi_request_service.cookie [*cookie]]]
+ [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.destroy [*destroy]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
+ [Dispatch a handler through an available io_service. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.env [*env]]]
- [Find the environment meta-variable matching name. ]
+ [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
+ [Return an available io_service from the IoServiceProvider. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.get_role [*get_role]]]
+ [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.is_open [*is_open]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.post [*post]]]
+ [Post the handler through an available io_service. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.load [*load]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
+ [Reset all the io_services contained by this service. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.scgi_request_service [*scgi_request_service]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.run [*run]]]
+ [Run all the io_services contained by this service. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.shutdown_service [*shutdown_service]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
+ [Stop all the io_services contained by this service. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service._scgi_request_service [*~scgi_request_service]]]
+ [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
     []
   ]
   
 ]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
 
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.var [*var]]]
- [Extract the var value from. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link cgi.reference.scgi__scgi_request_service.id [*id]]]
- []
- ]
+[endsect]
 
-]
 
-[section:GET scgi::scgi_request_service::GET]
 
-[indexterm2 GET..scgi::scgi_request_service]
+[section:protocol_type common::request_service::protocol_type]
 
- map_type & ``[link cgi.reference.scgi__scgi_request_service.GET.overload1 GET]``(
- implementation_type & impl);
+[indexterm2 protocol_type..common::request_service]
 
- std::string ``[link cgi.reference.scgi__scgi_request_service.GET.overload2 GET]``(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
+ typedef Protocol protocol_type;
 
 
-[section:overload1 scgi::scgi_request_service::GET (1 of 2 overloads)]
 
 
+[endsect]
 
- map_type & GET(
- implementation_type & impl);
+
+[section:request_service common::request_service::request_service]
+
+[indexterm2 request_service..common::request_service]
+
+ ``[link cgi.reference.common__request_service.request_service.overload1 request_service]``(
+ ::BOOST_CGI_NAMESPACE::common::io_service & ios);
+
+ ``[link cgi.reference.common__request_service.request_service.overload2 request_service]``(
+ protocol_service_type & ps);
+
+
+[section:overload1 common::request_service::request_service (1 of 2 overloads)]
+
+
+
+ request_service(
+ ::BOOST_CGI_NAMESPACE::common::io_service & ios);
 
 
 
@@ -23827,14 +11478,12 @@
 
 
 
-[section:overload2 scgi::scgi_request_service::GET (2 of 2 overloads)]
+[section:overload2 common::request_service::request_service (2 of 2 overloads)]
 
 
 
- std::string GET(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
+ request_service(
+ protocol_service_type & ps);
 
 
 
@@ -23843,26 +11492,28 @@
 
 [endsect]
 
-[section:POST scgi::scgi_request_service::POST]
 
-[indexterm2 POST..scgi::scgi_request_service]
+[section:set_header common::request_service::set_header]
 
- map_type & ``[link cgi.reference.scgi__scgi_request_service.POST.overload1 POST]``(
- implementation_type & impl);
+[indexterm2 set_header..common::request_service]
 
- std::string ``[link cgi.reference.scgi__scgi_request_service.POST.overload2 POST]``(
- implementation_type & impl,
+ boost::system::error_code & set_header(
+ impl_type & impl,
       const std::string & name,
- boost::system::error_code & ec,
- bool greedy = true);
+ const std::string & value,
+ boost::system::error_code & ec);
+
 
 
-[section:overload1 scgi::scgi_request_service::POST (1 of 2 overloads)]
+[endsect]
 
 
 
- map_type & POST(
- implementation_type & impl);
+[section:shutdown_service common::request_service::shutdown_service]
+
+[indexterm2 shutdown_service..common::request_service]
+
+ void shutdown_service();
 
 
 
@@ -23870,281 +11521,291 @@
 
 
 
-[section:overload2 scgi::scgi_request_service::POST (2 of 2 overloads)]
+[endsect]
 
-Find the post meta-variable matching name.
 
- std::string POST(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec,
- bool greedy = true);
+[section:common__request_status common::request_status]
+
+[indexterm1 common::request_status]
 
+ enum request_status
 
+[heading Values]
+[variablelist
 
-[heading Parameters]
-
+ [
+ [null]
+ []
+ ]
+
+ [
+ [unloaded]
+ []
+ ]
+
+ [
+ [activated]
+ []
+ ]
+
+ [
+ [accepted]
+ []
+ ]
+
+ [
+ [begin_request_found]
+ []
+ ]
+
+ [
+ [env_read]
+ []
+ ]
+
+ [
+ [get_read]
+ []
+ ]
+
+ [
+ [post_read]
+ []
+ ]
+
+ [
+ [cookies_read]
+ []
+ ]
+
+ [
+ [loaded]
+ []
+ ]
+
+ [
+ [ok]
+ []
+ ]
+
+ [
+ [aborted]
+ []
+ ]
 
-[variablelist
-
-[[greedy][This determines whether more data can be read to find the variable. The default is true to cause least surprise in the common case of having not parsed any of the POST data.]]
+ [
+ [closed]
+ []
+ ]
 
 ]
 
------------------------------------------------ Should this return a pair of iterators instead? What about url\_decoding? -----------------------------------------------
 
 
 [endsect]
 
 
-[endsect]
-
+[section:common__role__authorizer common::role::authorizer]
 
-[section:client scgi::scgi_request_service::client]
 
-[indexterm2 client..scgi::scgi_request_service]
 
- implementation_type::client_type & client(
- implementation_type & impl);
+ struct authorizer
 
 
 
 [endsect]
 
+[section:common__role__filter common::role::filter]
 
 
-[section:close scgi::scgi_request_service::close]
 
-[indexterm2 close..scgi::scgi_request_service] Close the request.
-
- int close(
- implementation_type & impl,
- http::status_code & hsc,
- int program_status);
+ struct filter
 
 
 
 [endsect]
 
+[section:common__role__responder common::role::responder]
 
 
-[section:construct scgi::scgi_request_service::construct]
 
-[indexterm2 construct..scgi::scgi_request_service]
-
- void construct(
- implementation_type & impl);
+ struct responder
 
 
 
 [endsect]
 
 
-[section:cookie scgi::scgi_request_service::cookie]
+[section:common__role_type common::role_type]
 
-[indexterm2 cookie..scgi::scgi_request_service]
+[indexterm1 common::role_type]
 
- map_type & ``[link cgi.reference.scgi__scgi_request_service.cookie.overload1 cookie]``(
- implementation_type & impl);
+ enum role_type
 
- std::string ``[link cgi.reference.scgi__scgi_request_service.cookie.overload2 cookie]``(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
+[heading Values]
+[variablelist
 
+ [
+ [none]
+ []
+ ]
 
-[section:overload1 scgi::scgi_request_service::cookie (1 of 2 overloads)]
+ [
+ [responder]
+ []
+ ]
 
+ [
+ [authorizer]
+ []
+ ]
 
+ [
+ [filter]
+ []
+ ]
 
- map_type & cookie(
- implementation_type & impl);
+]
 
 
 
 [endsect]
 
 
+[section:common__tags__async_stdio common::tags::async_stdio]
 
-[section:overload2 scgi::scgi_request_service::cookie (2 of 2 overloads)]
-
-Find the cookie meta-variable matching name.
-
- std::string cookie(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
 
 
+ struct async_stdio
 
-[endsect]
 
 
 [endsect]
 
+[section:common__tags__cgi common::tags::cgi]
 
-[section:destroy scgi::scgi_request_service::destroy]
 
-[indexterm2 destroy..scgi::scgi_request_service]
 
- void destroy(
- implementation_type & impl);
+ struct cgi
 
 
 
 [endsect]
 
+[section:common__tags__fcgi common::tags::fcgi]
 
 
-[section:env scgi::scgi_request_service::env]
-
-[indexterm2 env..scgi::scgi_request_service] Find the environment meta-variable matching name.
 
- std::string env(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
+ struct fcgi
 
 
 
 [endsect]
 
+[section:common__tags__null common::tags::null]
 
 
-[section:get_role scgi::scgi_request_service::get_role]
-
-[indexterm2 get_role..scgi::scgi_request_service]
 
- role_type get_role(
- implementation_type & impl);
+ struct null
 
 
 
 [endsect]
 
+[section:common__tags__round_robin common::tags::round_robin]
 
 
-[section:id scgi::scgi_request_service::id]
-
-[indexterm2 id..scgi::scgi_request_service]
 
- static boost::asio::detail::service_id< scgi_request_service > id;
+ struct round_robin
 
 
 
 [endsect]
 
+[section:common__tags__scgi common::tags::scgi]
 
 
-[section:is_open scgi::scgi_request_service::is_open]
-
-[indexterm2 is_open..scgi::scgi_request_service]
 
- bool is_open(
- implementation_type & impl);
+ struct scgi
 
 
 
 [endsect]
 
+[section:common__tags__service_pool common::tags::service_pool]
 
 
-[section:load scgi::scgi_request_service::load]
-
-[indexterm2 load..scgi::scgi_request_service]
 
- boost::system::error_code & load(
- implementation_type & impl,
- bool parse_stdin,
- boost::system::error_code & ec);
+ struct service_pool
 
 
 
 [endsect]
 
+[section:common__tags__shareable_tcp_socket common::tags::shareable_tcp_socket]
 
 
-[section:map_type scgi::scgi_request_service::map_type]
-
-[indexterm2 map_type..scgi::scgi_request_service]
-
- typedef type::implementation_type::map_type map_type;
 
+ struct shareable_tcp_socket
 
 
 
 [endsect]
 
+[section:common__tags__single_service common::tags::single_service]
 
 
-[section:parse_cookie_vars scgi::scgi_request_service::parse_cookie_vars]
-
-[indexterm2 parse_cookie_vars..scgi::scgi_request_service] Read and parse the HTTP_COOKIE meta variable.
 
- template<
- typename RequestImpl >
- boost::system::error_code & parse_cookie_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
+ struct single_service
 
 
 
 [endsect]
 
+[section:common__tags__stdio common::tags::stdio]
 
 
-[section:parse_get_vars scgi::scgi_request_service::parse_get_vars]
-
-[indexterm2 parse_get_vars..scgi::scgi_request_service] Read and parse the cgi GET meta variables.
 
- boost::system::error_code & parse_get_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
+ struct stdio
 
 
 
 [endsect]
 
+[section:common__tags__tcp_socket common::tags::tcp_socket]
 
 
-[section:parse_one_post_var scgi::scgi_request_service::parse_one_post_var]
-
-[indexterm2 parse_one_post_var..scgi::scgi_request_service] Read and parse a single cgi POST meta variable (greedily).
 
- template<
- typename RequestImpl >
- boost::system::error_code & parse_one_post_var(
- implementation_type & impl,
- boost::system::error_code & ec);
+ struct tcp_socket
 
 
 
 [endsect]
 
+[section:connection_base connection_base]
 
+Abstract Base Class for all connection types.
 
-[section:parse_post_vars scgi::scgi_request_service::parse_post_vars]
-
-[indexterm2 parse_post_vars..scgi::scgi_request_service] Read and parse the cgi POST meta variables (greedily).
-
- template<
- typename RequestImpl >
- boost::system::error_code & parse_post_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
+ class connection_base
 
-[endsect]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.connection_base._connection_base [*~connection_base]]]
+ []
+ ]
+
+]
 
-[section:protocol_type scgi::scgi_request_service::protocol_type]
 
-[indexterm2 protocol_type..scgi::scgi_request_service]
+[section:_connection_base connection_base::~connection_base]
 
- typedef type::implementation_type::protocol_type protocol_type;
+[indexterm2 ~connection_base..connection_base]
 
+ ~connection_base();
 
 
 
@@ -24152,24 +11813,15 @@
 
 
 
-[section:scgi_request_service scgi::scgi_request_service::scgi_request_service]
-
-[indexterm2 scgi_request_service..scgi::scgi_request_service]
-
- scgi_request_service(
- ::cgi::io_service & ios);
-
-
-
 [endsect]
 
 
+[section: fcgi__acceptor]
 
-[section:shutdown_service scgi::scgi_request_service::shutdown_service]
+Typedef for common usage (FCGI).
 
-[indexterm2 shutdown_service..scgi::scgi_request_service]
+ typedef ::BOOST_CGI_NAMESPACE::common::basic_request_acceptor< fcgi_request_acceptor_service<> > acceptor;
 
- void shutdown_service();
 
 
 
@@ -24177,11 +11829,11 @@
 
 
 
-[section:type scgi::scgi_request_service::type]
+[section: fcgi__client]
 
-[indexterm2 type..scgi::scgi_request_service]
 
- typedef scgi_request_service type;
+
+ typedef common::basic_client< connections::shareable_tcp,::BOOST_CGI_NAMESPACE::common::tags::fcgi > client;
 
 
 [heading Types]
@@ -24190,235 +11842,144 @@
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service__implementation_type [*implementation_type]]]
- [The actual implementation date for an SCGI request. ]
+ [[link cgi.reference.common__basic_client.connection_ptr [*connection_ptr]]]
+ []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_client.connection_type [*connection_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_client.header_buffer_type [*header_buffer_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__scgi_request_service.type [*type]]]
+ [[link cgi.reference.common__basic_client.io_service_type [*io_service_type]]]
     []
   
   ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.scgi__scgi_request_service.GET [*GET]]]
+
+ [[link cgi.reference.common__basic_client.map_type [*map_type]]]
     []
- ]
   
- [
- [[link cgi.reference.scgi__scgi_request_service.POST [*POST]]]
- []
   ]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_service.client [*client]]]
+
+ [[link cgi.reference.common__basic_client.mutable_buffers_type [*mutable_buffers_type]]]
     []
- ]
   
- [
- [[link cgi.reference.scgi__scgi_request_service.close [*close]]]
- [Close the request. ]
   ]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_service.construct [*construct]]]
+
+ [[link cgi.reference.common__basic_client.protocol_type [*protocol_type]]]
     []
- ]
   
- [
- [[link cgi.reference.scgi__scgi_request_service.cookie [*cookie]]]
- []
   ]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_service.destroy [*destroy]]]
+
+ [[link cgi.reference.common__basic_client.role_type [*role_type]]]
     []
- ]
   
- [
- [[link cgi.reference.scgi__scgi_request_service.env [*env]]]
- [Find the environment meta-variable matching name. ]
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.get_role [*get_role]]]
- []
   ]
-
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.scgi__scgi_request_service.is_open [*is_open]]]
- []
+ [[link cgi.reference.common__basic_client.async_read_some [*async_read_some]]]
+ [Asynchronously read some data from the client. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.load [*load]]]
- []
+ [[link cgi.reference.common__basic_client.async_write_some [*async_write_some]]]
+ [Asynchronously write some data to the client. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.scgi_request_service [*scgi_request_service]]]
+ [[link cgi.reference.common__basic_client.basic_client [*basic_client]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.shutdown_service [*shutdown_service]]]
+ [[link cgi.reference.common__basic_client.bytes_left [*bytes_left]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service._scgi_request_service [*~scgi_request_service]]]
+ [[link cgi.reference.common__basic_client.close [*close]]]
     []
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.scgi__scgi_request_service.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
   [
- [[link cgi.reference.scgi__scgi_request_service.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
+ [[link cgi.reference.common__basic_client.connection [*connection]]]
+ [Get a shared_ptr of the connection associated with the client. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
+ [[link cgi.reference.common__basic_client.construct [*construct]]]
+ [Construct the client by claiming a request id. ]
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.common__basic_client.handle_write [*handle_write]]]
+ []
   ]
   
   [
- [[link cgi.reference.scgi__scgi_request_service.var [*var]]]
- [Extract the var value from. ]
+ [[link cgi.reference.common__basic_client.is_open [*is_open]]]
+ []
   ]
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.scgi__scgi_request_service.id [*id]]]
+ [[link cgi.reference.common__basic_client.keep_connection [*keep_connection]]]
     []
   ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:var scgi::scgi_request_service::var]
-
-[indexterm2 var..scgi::scgi_request_service] Extract the var value from.
-
- std::string var(
- map_type & _data,
- const std::string & _name,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:_scgi_request_service scgi::scgi_request_service::~scgi_request_service]
-
-[indexterm2 ~scgi_request_service..scgi::scgi_request_service]
-
- ~scgi_request_service();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:scgi__scgi_request_service__implementation_type scgi::scgi_request_service::implementation_type]
-
-The actual implementation date for an SCGI request.
-
- struct implementation_type
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.client_type [*client_type]]]
- []
   
- ]
-
   [
-
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.connection_type [*connection_type]]]
+ [[link cgi.reference.common__basic_client.prepare_buffer [*prepare_buffer]]]
     []
+ ]
   
+ [
+ [[link cgi.reference.common__basic_client.read_some [*read_some]]]
+ [Read data into the supplied buffer. ]
   ]
-
+
   [
-
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.map_type [*map_type]]]
+ [[link cgi.reference.common__basic_client.request_id [*request_id]]]
     []
-
   ]
-
+
   [
-
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.protocol_type [*protocol_type]]]
- []
+ [[link cgi.reference.common__basic_client.set_connection [*set_connection]]]
+ [Associate a connection with this client. ]
+ ]
   
+ [
+ [[link cgi.reference.common__basic_client.status [*status]]]
+ [Get the status of the client. ]
   ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.implementation_type [*implementation_type]]]
- []
+ [[link cgi.reference.common__basic_client.write_some [*write_some]]]
+ [Write some data to the client. ]
   ]
   
 ]
@@ -24428,161 +11989,53 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.all_done_ [*all_done_]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.client_ [*client_]]]
+ [[link cgi.reference.common__basic_client.bytes_left_ [*bytes_left_]]]
     []
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.cookie_vars_ [*cookie_vars_]]]
- []
+ [[link cgi.reference.common__basic_client.header_ [*header_]]]
+ [Buffer used to check the header of each packet. ]
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.env_vars_ [*env_vars_]]]
+ [[link cgi.reference.common__basic_client.keep_connection_ [*keep_connection_]]]
     []
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.get_vars_ [*get_vars_]]]
- []
+ [[link cgi.reference.common__basic_client.outbuf_ [*outbuf_]]]
+ [Output buffer. ]
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.http_status_ [*http_status_]]]
+ [[link cgi.reference.common__basic_client.request_id_ [*request_id_]]]
     []
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.null_str_ [*null_str_]]]
+ [[link cgi.reference.common__basic_client.role_ [*role_]]]
     []
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.post_vars_ [*post_vars_]]]
+ [[link cgi.reference.common__basic_client.status_ [*status_]]]
     []
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.request_status_ [*request_status_]]]
+ [[link cgi.reference.common__basic_client.total_sent_bytes_ [*total_sent_bytes_]]]
     []
   ]
 
   [
- [[link cgi.reference.scgi__scgi_request_service__implementation_type.stdin_parsed_ [*stdin_parsed_]]]
+ [[link cgi.reference.common__basic_client.total_sent_packets_ [*total_sent_packets_]]]
     []
   ]
 
 ]
 
-
-[section:all_done_ scgi::scgi_request_service::implementation_type::all_done_]
-
-[indexterm2 all_done_..scgi::scgi_request_service::implementation_type]
-
- bool all_done_;
-
-
-
-[endsect]
-
-
-
-[section:client_ scgi::scgi_request_service::implementation_type::client_]
-
-[indexterm2 client_..scgi::scgi_request_service::implementation_type]
-
- client_type client_;
-
-
-
-[endsect]
-
-
-
-[section:client_type scgi::scgi_request_service::implementation_type::client_type]
-
-[indexterm2 client_type..scgi::scgi_request_service::implementation_type]
-
- typedef basic_client< connection_type, protocol_type > client_type;
-
-
-
-
-[endsect]
-
-
-
-[section:connection_type scgi::scgi_request_service::implementation_type::connection_type]
-
-[indexterm2 connection_type..scgi::scgi_request_service::implementation_type]
-
- typedef tcp_connection connection_type;
-
-
-
-
-[endsect]
-
-
-
-[section:cookie_vars_ scgi::scgi_request_service::implementation_type::cookie_vars_]
-
-[indexterm2 cookie_vars_..scgi::scgi_request_service::implementation_type]
-
- map_type cookie_vars_;
-
-
-
-[endsect]
-
-
-
-[section:env_vars_ scgi::scgi_request_service::implementation_type::env_vars_]
-
-[indexterm2 env_vars_..scgi::scgi_request_service::implementation_type]
-
- map_type env_vars_;
-
-
-
-[endsect]
-
-
-
-[section:get_vars_ scgi::scgi_request_service::implementation_type::get_vars_]
-
-[indexterm2 get_vars_..scgi::scgi_request_service::implementation_type]
-
- map_type get_vars_;
-
-
-
-[endsect]
-
-
-
-[section:http_status_ scgi::scgi_request_service::implementation_type::http_status_]
-
-[indexterm2 http_status_..scgi::scgi_request_service::implementation_type]
-
- http::status_code http_status_;
-
-
-
-[endsect]
-
-
-
-[section:implementation_type scgi::scgi_request_service::implementation_type::implementation_type]
-
-[indexterm2 implementation_type..scgi::scgi_request_service::implementation_type]
-
- implementation_type();
+A client is for two things: 1. To hold a full-duplex connection (or separate input and output connections). 2. To hold any protocol-specific data about the request. For now, this means the internal 'request number' associated by FastCGI with each request (ie. so incoming/outgoing packets can be wrapped with data noting what request it relates to). 3. Buffering. Not sure about how far this should go yet, but probably no further than minimal buffering. 4. Share a connection. Since a multiplexing connection is shared between multiple clients, the client should be responsible for taking possesion of the connection for a period of time (so it can write a complete packet). This idea could be taken quite far into genericity by making clients aware of how busy the connection is and size its output packets accordingly... But I'm not doing that.
 
 
 
@@ -24590,139 +12043,421 @@
 
 
 
-[section:map_type scgi::scgi_request_service::implementation_type::map_type]
-
-[indexterm2 map_type..scgi::scgi_request_service::implementation_type]
-
- typedef ::cgi::map map_type;
+[section: fcgi__request]
 
 
 
+ typedef common::basic_request< common::tags::fcgi > request;
 
-[endsect]
-
-
-
-[section:null_str_ scgi::scgi_request_service::implementation_type::null_str_]
 
-[indexterm2 null_str_..scgi::scgi_request_service::implementation_type]
-
- std::string null_str_;
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
+ [[link cgi.reference.common__basic_request.buffer_type [*buffer_type]]]
+ []
+
+ ]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__basic_request.char_type [*char_type]]]
+ []
+
+ ]
 
+ [
 
-[section:post_vars_ scgi::scgi_request_service::implementation_type::post_vars_]
+ [[link cgi.reference.common__basic_request.client_type [*client_type]]]
+ []
+
+ ]
 
-[indexterm2 post_vars_..scgi::scgi_request_service::implementation_type]
+ [
 
- map_type post_vars_;
+ [[link cgi.reference.common__basic_request.implementation_type [*implementation_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__basic_request.pointer [*pointer]]]
+ []
+
+ ]
 
-[endsect]
+ [
 
+ [[link cgi.reference.common__basic_request.protocol_service_type [*protocol_service_type]]]
+ []
+
+ ]
 
+ [
 
-[section:protocol_type scgi::scgi_request_service::implementation_type::protocol_type]
+ [[link cgi.reference.common__basic_request.protocol_type [*protocol_type]]]
+ []
+
+ ]
 
-[indexterm2 protocol_type..scgi::scgi_request_service::implementation_type]
+ [
 
- typedef ::cgi::scgi_ protocol_type;
+ [[link cgi.reference.common__basic_request.self_type [*self_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__basic_request.service_type [*service_type]]]
+ []
+
+ ]
 
+ [
 
-[endsect]
+ [[link cgi.reference.common__basic_request.string_type [*string_type]]]
+ []
+
+ ]
 
+ [
 
+ [[link cgi.reference.common__basic_request.traits [*traits]]]
+ []
+
+ ]
 
-[section:request_status_ scgi::scgi_request_service::implementation_type::request_status_]
+]
 
-[indexterm2 request_status_..scgi::scgi_request_service::implementation_type]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
- status_type request_status_;
+ [
+ [[link cgi.reference.common__basic_request.abort [*abort]]]
+ [Abort a request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.auth_type [*auth_type]]]
+ [Set the output for the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.basic_request [*basic_request]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.charset [*charset]]]
+ [Get the charset from the CONTENT_TYPE header. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.clear [*clear]]]
+ [Clear the data for the request, for reusing this object. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.client [*client]]]
+ [Get the client connection associated with the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.close [*close]]]
+ [Asynchronously read/parse the request meta-data. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.content_length [*content_length]]]
+ [Get the content length as a long. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.content_type [*content_type]]]
+ [The content type of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.create [*create]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.gateway_interface [*gateway_interface]]]
+ [The protocol used by the server to communicate to the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.hash [*hash]]]
+ [Get a hashed interpretation of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.http_cookie [*http_cookie]]]
+ [The cookies sent by the user making the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.http_from [*http_from]]]
+ [The email of the user making the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.id [*id]]]
+ [The id of this request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.is_open [*is_open]]]
+ [Check if the request is still open (ie. not aborted or closed). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.load [*load]]]
+ [Synchronously read/parse the request meta-data. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.method [*method]]]
+ [The method of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.path_info [*path_info]]]
+ [Additional information, appendended to the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.path_translated [*path_translated]]]
+ [The translated version of the path info. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.post_buffer [*post_buffer]]]
+ [Get the buffer containing the POST data. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.query_string [*query_string]]]
+ [The query string for the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.read_some [*read_some]]]
+ [Read some data into the request, parsing if necessary. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.referer [*referer]]]
+ [Get the web page the user came from. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.reject [*reject]]]
+ [Reject the request with a '500 Internal Server Error' error. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_addr [*remote_addr]]]
+ [The host address of the remote user. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_host [*remote_host]]]
+ [The host name of the remote user's machine. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_ident [*remote_ident]]]
+ [The user making the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.remote_user [*remote_user]]]
+ [The userid of the person accessing the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.request_method [*request_method]]]
+ [The method of the request (long-hand of `method()`). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.request_uri [*request_uri]]]
+ [Get the URI of the request (long-hand of `uri()`). ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.role [*role]]]
+ [The role that the request is playing. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_name [*script_name]]]
+ [The name of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_uri [*script_uri]]]
+ [The full URI of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.script_url [*script_url]]]
+ [The URL of the script. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_name [*server_name]]]
+ [Get the name of the server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_port [*server_port]]]
+ [Get the port the calling server is listening on. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_protocol [*server_protocol]]]
+ [Get the protocol being used by the calling server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.server_software [*server_software]]]
+ [Get a string identifying the calling server. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.set_protocol_service [*set_protocol_service]]]
+ []
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.status [*status]]]
+ [Get / Set the status of a request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request.uri [*uri]]]
+ [Get the URI of the request. ]
+ ]
+
+ [
+ [[link cgi.reference.common__basic_request._basic_request [*~basic_request]]]
+ []
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.common__basic_request.cookies [*cookies]]]
+ []
+ ]
 
-[endsect]
+ [
+ [[link cgi.reference.common__basic_request.env [*env]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_request.form [*form]]]
+ []
+ ]
 
+ [
+ [[link cgi.reference.common__basic_request.get [*get]]]
+ []
+ ]
 
-[section:stdin_parsed_ scgi::scgi_request_service::implementation_type::stdin_parsed_]
+ [
+ [[link cgi.reference.common__basic_request.post [*post]]]
+ []
+ ]
 
-[indexterm2 stdin_parsed_..scgi::scgi_request_service::implementation_type]
+ [
+ [[link cgi.reference.common__basic_request.uploads [*uploads]]]
+ []
+ ]
 
- bool stdin_parsed_;
+]
 
+Note: By default, synchronous protocols (ie. cgi) auto-load AND parse STDIN,whereas async protocols don't.
 
+Note: The alternative functions which take a boost::system::error\_code are the non-throwing versions. Instead of a boost::system::system\_error being thrown in case of an error, the passed error\_code will be set to the value of the error, s.t. if (error) evaluates to true.`
 
-[endsect]
+Note: This class isn't thread safe: carrying around a mutex-per-request seems prohibitively expensive. There could be functions which take a mutex as an argument and lock it. (Async calls could get messy if you need a protected request object).
 
 
 
 [endsect]
 
 
-[section:scgi__service scgi::service]
-
-[indexterm1 scgi::service]
 
- typedef basic_protocol_service< ::cgi::scgi_ > service;
+[section: fcgi__service]
 
 
 
-
-[endsect]
+ typedef common::basic_protocol_service< common::tags::fcgi > service;
 
 
-[section:scgi_request_acceptor_service scgi_request_acceptor_service]
+[heading Types]
+[table
+ [[Name][Description]]
 
-The service class for SCGI basic_request_acceptor<>s.
+ [
 
- template<
- typename Protocol_ = scgi_>
- class scgi_request_acceptor_service
+ [[link cgi.reference.common__basic_protocol_service.ios_provider_type [*ios_provider_type]]]
+ []
+
+ ]
 
+ [
 
-[heading Types]
-[table
- [[Name][Description]]
+ [[link cgi.reference.common__basic_protocol_service.protocol_type [*protocol_type]]]
+ []
+
+ ]
 
   [
 
- [[link cgi.reference.scgi_request_acceptor_service.endpoint_type [*endpoint_type]]]
+ [[link cgi.reference.common__basic_protocol_service.queue_type [*queue_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi_request_acceptor_service.implementation_type [*implementation_type]]]
+ [[link cgi.reference.common__basic_protocol_service.request_ptr [*request_ptr]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi_request_acceptor_service.native_type [*native_type]]]
+ [[link cgi.reference.common__basic_protocol_service.request_type [*request_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi_request_acceptor_service.protocol_type [*protocol_type]]]
+ [[link cgi.reference.common__basic_protocol_service.set_type [*set_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi_request_acceptor_service.service_impl_type [*service_impl_type]]]
+ [[link cgi.reference.common__basic_protocol_service.traits [*traits]]]
     []
   
   ]
@@ -24734,235 +12469,180 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi_request_acceptor_service.accept [*accept]]]
+ [[link cgi.reference.common__basic_protocol_service.basic_protocol_service [*basic_protocol_service]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.assign [*assign]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.dispatch [*dispatch]]]
+ [Dispatch a handler through an available io_service. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.async_accept [*async_accept]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.io_service [*io_service]]]
+ [Return an available io_service from the IoServiceProvider. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.bind [*bind]]]
+ [[link cgi.reference.common__basic_protocol_service.is_cgi [*is_cgi]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.close [*close]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.post [*post]]]
+ [Post the handler through an available io_service. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.construct [*construct]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.reset [*reset]]]
+ [Reset all the io_services contained by this service. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.destroy [*destroy]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.run [*run]]]
+ [Run all the io_services contained by this service. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.is_open [*is_open]]]
- []
+ [[link cgi.reference.common__basic_protocol_service.stop [*stop]]]
+ [Stop all the io_services contained by this service. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.listen [*listen]]]
+ [[link cgi.reference.common__basic_protocol_service._basic_protocol_service [*~basic_protocol_service]]]
     []
   ]
   
+]
+
+Holds the request queue and the connection queue. It is also a wrapper around asio::io\_service
+
+
+
+[endsect]
+
+
+[section:request_acceptor_service request_acceptor_service]
+
+
+
+ template<
+ typename Protocol >
+ class request_acceptor_service
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
   [
- [[link cgi.reference.scgi_request_acceptor_service.local_endpoint [*local_endpoint]]]
+
+ [[link cgi.reference.request_acceptor_service.implementation_type [*implementation_type]]]
     []
- ]
   
+ ]
+
   [
- [[link cgi.reference.scgi_request_acceptor_service.open [*open]]]
+
+ [[link cgi.reference.request_acceptor_service.protocol_type [*protocol_type]]]
     []
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link cgi.reference.request_acceptor_service.accept [*accept]]]
+ [Accept a request. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.scgi_request_acceptor_service [*scgi_request_acceptor_service]]]
- [The unique service identifier. ]
+ [[link cgi.reference.request_acceptor_service.async_accept [*async_accept]]]
+ [Asynchronously accept a request. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.set_protocol_service [*set_protocol_service]]]
+ [[link cgi.reference.request_acceptor_service.construct [*construct]]]
     []
   ]
   
   [
- [[link cgi.reference.scgi_request_acceptor_service.shutdown_service [*shutdown_service]]]
+ [[link cgi.reference.request_acceptor_service.destroy [*destroy]]]
     []
   ]
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link cgi.reference.scgi_request_acceptor_service.id [*id]]]
+ [[link cgi.reference.request_acceptor_service.request_acceptor_service [*request_acceptor_service]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi_request_acceptor_service.service_impl_ [*service_impl_]]]
+ [[link cgi.reference.request_acceptor_service.shutdown_service [*shutdown_service]]]
     []
   ]
-
+
 ]
 
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
-
-[section:accept scgi_request_acceptor_service::accept]
-
-[indexterm2 accept..scgi_request_acceptor_service]
-
- template<
- typename CommonGatewayRequest ,
- typename Endpoint >
- boost::system::error_code ``[link cgi.reference.scgi_request_acceptor_service.accept.overload1 accept]``(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Endpoint * ep,
- boost::system::error_code & ec);
-
- template<
- typename CommonGatewayRequest >
- boost::system::error_code ``[link cgi.reference.scgi_request_acceptor_service.accept.overload2 accept]``(
- implementation_type & impl,
- CommonGatewayRequest & request,
- boost::system::error_code & ec);
-
-
-[section:overload1 scgi_request_acceptor_service::accept (1 of 2 overloads)]
-
-
-
- template<
- typename CommonGatewayRequest ,
- typename Endpoint >
- boost::system::error_code accept(
- implementation_type & impl,
- CommonGatewayRequest & request,
- Endpoint * ep,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:overload2 scgi_request_acceptor_service::accept (2 of 2 overloads)]
 
+[section:accept request_acceptor_service::accept]
 
+[indexterm2 accept..request_acceptor_service] Accept a request.
 
   template<
       typename CommonGatewayRequest >
- boost::system::error_code accept(
+ boost::system::error_code & accept(
       implementation_type & impl,
       CommonGatewayRequest & request,
       boost::system::error_code & ec);
 
 
-
-[endsect]
-
-
-[endsect]
-
-
-[section:assign scgi_request_acceptor_service::assign]
-
-[indexterm2 assign..scgi_request_acceptor_service]
-
- template<
- typename Protocol >
- boost::system::error_code assign(
- implementation_type & impl,
- Protocol protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:async_accept scgi_request_acceptor_service::async_accept]
-
-[indexterm2 async_accept..scgi_request_acceptor_service]
-
- template<
- typename Handler >
- void async_accept(
- implementation_type & impl,
- Handler handler);
-
+Check if there is a waiting request in the queue. If not, accept a connection, and associate it with the request.
 
 
 [endsect]
 
 
 
-[section:bind scgi_request_acceptor_service::bind]
+[section:async_accept request_acceptor_service::async_accept]
 
-[indexterm2 bind..scgi_request_acceptor_service]
+[indexterm2 async_accept..request_acceptor_service] Asynchronously accept a request.
 
   template<
- typename Endpoint >
- boost::system::error_code bind(
+ typename CommonGatewayRequest ,
+ typename Handler >
+ void async_accept(
       implementation_type & impl,
- const Endpoint & endpoint,
- boost::system::error_code & ec);
+ CommonGatewayRequest & request,
+ Handler handler);
 
 
 
 [endsect]
 
 
-[section:close scgi_request_acceptor_service::close]
 
-[indexterm2 close..scgi_request_acceptor_service]
+[section:construct request_acceptor_service::construct]
 
- boost::system::error_code ``[link cgi.reference.scgi_request_acceptor_service.close.overload1 close]``(
- implementation_type & impl,
- boost::system::error_code & ec);
+[indexterm2 construct..request_acceptor_service]
 
- void ``[link cgi.reference.scgi_request_acceptor_service.close.overload2 close]``(
+ void construct(
       implementation_type & impl);
 
 
-[section:overload1 scgi_request_acceptor_service::close (1 of 2 overloads)]
-
-
-
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
 
 [endsect]
 
 
 
-[section:overload2 scgi_request_acceptor_service::close (2 of 2 overloads)]
-
+[section:destroy request_acceptor_service::destroy]
 
+[indexterm2 destroy..request_acceptor_service]
 
- void close(
+ void destroy(
       implementation_type & impl);
 
 
@@ -24970,15 +12650,13 @@
 [endsect]
 
 
-[endsect]
 
+[section:implementation_type request_acceptor_service::implementation_type]
 
-[section:construct scgi_request_acceptor_service::construct]
+[indexterm2 implementation_type..request_acceptor_service]
 
-[indexterm2 construct..scgi_request_acceptor_service]
+ typedef service_impl_type::impl_type implementation_type;
 
- void construct(
- implementation_type & impl);
 
 
 
@@ -24986,25 +12664,25 @@
 
 
 
-[section:destroy scgi_request_acceptor_service::destroy]
+[section:protocol_type request_acceptor_service::protocol_type]
 
-[indexterm2 destroy..scgi_request_acceptor_service]
+[indexterm2 protocol_type..request_acceptor_service]
 
- void destroy(
- implementation_type & impl);
+ typedef Protocol protocol_type;
 
 
 
-[endsect]
 
+[endsect]
 
 
-[section:endpoint_type scgi_request_acceptor_service::endpoint_type]
 
-[indexterm2 endpoint_type..scgi_request_acceptor_service]
+[section:request_acceptor_service request_acceptor_service::request_acceptor_service]
 
- typedef implementation_type::endpoint_type endpoint_type;
+[indexterm2 request_acceptor_service..request_acceptor_service]
 
+ request_acceptor_service(
+ basic_protocol_service< protocol_type > & s);
 
 
 
@@ -25012,11 +12690,11 @@
 
 
 
-[section:id scgi_request_acceptor_service::id]
+[section:shutdown_service request_acceptor_service::shutdown_service]
 
-[indexterm2 id..scgi_request_acceptor_service]
+[indexterm2 shutdown_service..request_acceptor_service]
 
- static boost::asio::detail::service_id< scgi_request_acceptor_service< Protocol_ > > id;
+ void shutdown_service();
 
 
 
@@ -25024,11 +12702,13 @@
 
 
 
-[section:implementation_type scgi_request_acceptor_service::implementation_type]
+[endsect]
+
+[section:stencils__dictionary stencils::dictionary]
 
-[indexterm2 implementation_type..scgi_request_acceptor_service]
+A lightweight wrapper around a ctemplate::TemplateDictionary.
 
- typedef service_impl_type::implementation_type implementation_type;
+ class dictionary
 
 
 [heading Types]
@@ -25037,132 +12717,97 @@
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.endpoint_type [*endpoint_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.native_protocol_type [*native_protocol_type]]]
+ [[link cgi.reference.stencils__dictionary.impl_type [*impl_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.port_number_type [*port_number_type]]]
+ [[link cgi.reference.stencils__dictionary.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.protocol_type [*protocol_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.request_type [*request_type]]]
+ [[link cgi.reference.stencils__dictionary.string_type [*string_type]]]
     []
   
   ]
 
 ]
 
-[heading Data Members]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.acceptor_ [*acceptor_]]]
- []
+ [[link cgi.reference.stencils__dictionary.add [*add]]]
+ [Add a section into the stencil. ]
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.endpoint_ [*endpoint_]]]
+ [[link cgi.reference.stencils__dictionary.dictionary [*dictionary]]]
     []
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.mutex_ [*mutex_]]]
- []
+ [[link cgi.reference.stencils__dictionary.include [*include]]]
+ [Include a file into the stencil. ]
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.port_num_ [*port_num_]]]
- []
+ [[link cgi.reference.stencils__dictionary.set [*set]]]
+ [Set the varible `name` to `value` in the stencil. ]
   ]
-
+
   [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.service_ [*service_]]]
- []
+ [[link cgi.reference.stencils__dictionary.show [*show]]]
+ [Show a section. ]
   ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
 
   [
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type.waiting_requests_ [*waiting_requests_]]]
+ [[link cgi.reference.stencils__dictionary.impl [*impl]]]
     []
   ]
 
 ]
 
 
+[section:add stencils::dictionary::add]
 
-[endsect]
-
-
-
-[section:is_open scgi_request_acceptor_service::is_open]
+[indexterm2 add..stencils::dictionary] Add a section into the stencil.
 
-[indexterm2 is_open..scgi_request_acceptor_service]
-
- bool is_open(
- implementation_type & impl);
+ dictionary add(
+ section const & sec);
 
 
 
 [endsect]
 
 
+[section:dictionary stencils::dictionary::dictionary]
 
-[section:listen scgi_request_acceptor_service::listen]
-
-[indexterm2 listen..scgi_request_acceptor_service]
+[indexterm2 dictionary..stencils::dictionary]
 
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
- boost::system::error_code & ec);
+ ``[link cgi.reference.stencils__dictionary.dictionary.overload1 dictionary]``();
 
+ ``[link cgi.reference.stencils__dictionary.dictionary.overload2 dictionary]``(
+ impl_type * impl);
 
 
-[endsect]
-
+[section:overload1 stencils::dictionary::dictionary (1 of 2 overloads)]
 
 
-[section:local_endpoint scgi_request_acceptor_service::local_endpoint]
 
-[indexterm2 local_endpoint..scgi_request_acceptor_service]
-
- implementation_type::endpoint_type local_endpoint(
- implementation_type & impl,
- boost::system::error_code & ec);
+ dictionary();
 
 
 
@@ -25170,42 +12815,26 @@
 
 
 
-[section:native_type scgi_request_acceptor_service::native_type]
+[section:overload2 stencils::dictionary::dictionary (2 of 2 overloads)]
 
-[indexterm2 native_type..scgi_request_acceptor_service]
 
- typedef service_impl_type::native_type native_type;
 
+ dictionary(
+ impl_type * impl);
 
 
 
 [endsect]
 
 
-
-[section:open scgi_request_acceptor_service::open]
-
-[indexterm2 open..scgi_request_acceptor_service]
-
- template<
- typename Protocol >
- boost::system::error_code open(
- implementation_type & impl,
- const Protocol & protocol,
- boost::system::error_code & ec);
-
-
-
 [endsect]
 
 
+[section:impl stencils::dictionary::impl]
 
-[section:protocol_type scgi_request_acceptor_service::protocol_type]
-
-[indexterm2 protocol_type..scgi_request_acceptor_service]
-
- typedef implementation_type::protocol_type protocol_type;
+[indexterm2 impl..stencils::dictionary]
 
+ impl_type * impl;
 
 
 
@@ -25213,235 +12842,96 @@
 
 
 
-[section:scgi_request_acceptor_service scgi_request_acceptor_service::scgi_request_acceptor_service]
-
-[indexterm2 scgi_request_acceptor_service..scgi_request_acceptor_service] The unique service identifier.
+[section:impl_type stencils::dictionary::impl_type]
 
- scgi_request_acceptor_service(
- ::cgi::io_service & ios);
+[indexterm2 impl_type..stencils::dictionary]
 
+ typedef ctemplate::TemplateDictionary impl_type;
 
 
-[endsect]
-
-
-
-[section:service_impl_ scgi_request_acceptor_service::service_impl_]
-
-[indexterm2 service_impl_..scgi_request_acceptor_service]
-
- service_impl_type service_impl_;
-
 
 
 [endsect]
 
 
+[section:include stencils::dictionary::include]
 
-[section:service_impl_type scgi_request_acceptor_service::service_impl_type]
-
-[indexterm2 service_impl_type..scgi_request_acceptor_service]
-
- typedef scgi::acceptor_service_impl service_impl_type;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_type [*acceptor_service_type]]]
- []
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl__implementation_type [*implementation_type]]]
- [The unique service identifier. ]
-
- ]
-
- [
-
- [[link cgi.reference.scgi__acceptor_service_impl.native_protocol_type [*native_protocol_type]]]
- []
-
- ]
+[indexterm2 include..stencils::dictionary] Include a file into the stencil.
 
- [
+ dictionary ``[link cgi.reference.stencils__dictionary.include.overload1 include]``(
+ string_type const & section_name,
+ string_type const & filename);
 
- [[link cgi.reference.scgi__acceptor_service_impl.native_type [*native_type]]]
- []
-
- ]
+ dictionary ``[link cgi.reference.stencils__dictionary.include.overload2 include]``(
+ section const & sec);
 
- [
 
- [[link cgi.reference.scgi__acceptor_service_impl.protocol_service_type [*protocol_service_type]]]
- []
-
- ]
+[section:overload1 stencils::dictionary::include (1 of 2 overloads)]
 
- [
+Include a file into the stencil.
 
- [[link cgi.reference.scgi__acceptor_service_impl.protocol_type [*protocol_type]]]
- []
-
- ]
+ dictionary include(
+ string_type const & section_name,
+ string_type const & filename);
 
- [
 
- [[link cgi.reference.scgi__acceptor_service_impl.type [*type]]]
- []
-
- ]
 
-]
+[heading Return Value]
+
+dictionary The returned sub-dictionary is used to set fields in an included stencil.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Parameters]
+
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl.accept [*accept]]]
- [Accepts one request. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_impl [*acceptor_service_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.assign [*assign]]]
- [Assign an existing native acceptor to a *socket* acceptor. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.async_accept [*async_accept]]]
- [Asynchronously accepts one request. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.bind [*bind]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.close [*close]]]
- [Close the acceptor (not implemented yet). ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.get_protocol_service [*get_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.is_open [*is_open]]]
- [Check if the given implementation is open. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.listen [*listen]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.local_endpoint [*local_endpoint]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.open [*open]]]
- [Open a new *socket* acceptor implementation. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.set_protocol_service [*set_protocol_service]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.shutdown_service [*shutdown_service]]]
- []
- ]
+[variablelist
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
+[[section_name][The name of the section, and of the marker in the stencil. Add {{>section\_name}} into the stencil to include a file's contents. ]]
 
- [
- [[link cgi.reference.scgi__acceptor_service_impl.acceptor_service_ [*acceptor_service_]]]
- [The underlying socket acceptor service. ]
- ]
-
- [
- [[link cgi.reference.scgi__acceptor_service_impl.id [*id]]]
- []
- ]
+[[filename][The name of the file to include. This must be set. ]]
 
 ]
 
-Note: this is near enough to being generic. It will hopefully translate directly to the fcgi\_acceptor\_service\_impl. In other words you would then have one acceptor\_service\_impl<>, so you'd use acceptor\_service\_impl<scgi> acceptor\_service\_impl\_; // and acceptor\_service\_impl<fcgi> acceptor\_service\_impl\_; // etc...
-
-Note: If the protocol is an asynchronous protocol, which means it requires access to a boost::asio::io\_service instance, then this class becomes a model of the Service concept (**LINK**) and must only use the constructor which takes a ProtocolService (**LINK**). If the protocol isn't async then the class can be used without a ProtocolService.
-
 
 
 [endsect]
 
 
 
-[section:set_protocol_service scgi_request_acceptor_service::set_protocol_service]
-
-[indexterm2 set_protocol_service..scgi_request_acceptor_service]
-
- template<
- typename T >
- void set_protocol_service(
- implementation_type & impl,
- T & ps);
+[section:overload2 stencils::dictionary::include (2 of 2 overloads)]
 
+Include a file into the stencil.
 
+ dictionary include(
+ section const & sec);
 
-[endsect]
 
 
+[heading Return Value]
+
+dictionary The returned sub-dictionary is used to set fields in an included stencil.
 
-[section:shutdown_service scgi_request_acceptor_service::shutdown_service]
+[heading Parameters]
+
 
-[indexterm2 shutdown_service..scgi_request_acceptor_service]
+[variablelist
+
+[[sec][The section to include. Be sure to set *both* the section name and filename first. ]]
 
- void shutdown_service();
+]
 
 
 
 [endsect]
 
 
-
 [endsect]
 
-[section:scgi_request_service_impl scgi_request_service_impl]
 
+[section:self_type stencils::dictionary::self_type]
 
+[indexterm2 self_type..stencils::dictionary]
 
- class scgi_request_service_impl
+ typedef dictionary self_type;
 
 
 [heading Types]
@@ -25450,21 +12940,21 @@
 
   [
 
- [[link cgi.reference.scgi_request_service_impl.implementation_type [*implementation_type]]]
+ [[link cgi.reference.stencils__dictionary.impl_type [*impl_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi_request_service_impl.map_type [*map_type]]]
+ [[link cgi.reference.stencils__dictionary.self_type [*self_type]]]
     []
   
   ]
 
   [
 
- [[link cgi.reference.scgi_request_service_impl.protocol_type [*protocol_type]]]
+ [[link cgi.reference.stencils__dictionary.string_type [*string_type]]]
     []
   
   ]
@@ -25476,99 +12966,28 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi_request_service_impl.construct [*construct]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.cookie [*cookie]]]
- [Find the cookie meta-variable matching name. ]
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.destroy [*destroy]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.get_role [*get_role]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.load [*load]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.meta_cookie [*meta_cookie]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.meta_env [*meta_env]]]
- [Find the environment meta-variable matching name. ]
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.meta_get [*meta_get]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.meta_post [*meta_post]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.read_some [*read_some]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.scgi_request_service_impl [*scgi_request_service_impl]]]
- []
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.write_some [*write_some]]]
- []
+ [[link cgi.reference.stencils__dictionary.add [*add]]]
+ [Add a section into the stencil. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_service_impl._scgi_request_service_impl [*~scgi_request_service_impl]]]
+ [[link cgi.reference.stencils__dictionary.dictionary [*dictionary]]]
     []
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link cgi.reference.scgi_request_service_impl.parse_cookie_vars [*parse_cookie_vars]]]
- [Read and parse the HTTP_COOKIE meta variable. ]
- ]
-
- [
- [[link cgi.reference.scgi_request_service_impl.parse_get_vars [*parse_get_vars]]]
- [Read and parse the cgi GET meta variables. ]
- ]
-
   [
- [[link cgi.reference.scgi_request_service_impl.parse_one_post_var [*parse_one_post_var]]]
- [Read and parse a single cgi POST meta variable (greedily). ]
+ [[link cgi.reference.stencils__dictionary.include [*include]]]
+ [Include a file into the stencil. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_service_impl.parse_post_vars [*parse_post_vars]]]
- [Read and parse the cgi POST meta variables (greedily). ]
+ [[link cgi.reference.stencils__dictionary.set [*set]]]
+ [Set the varible `name` to `value` in the stencil. ]
   ]
   
   [
- [[link cgi.reference.scgi_request_service_impl.var [*var]]]
- [Extract the var value from. ]
+ [[link cgi.reference.stencils__dictionary.show [*show]]]
+ [Show a section. ]
   ]
   
 ]
@@ -25578,60 +12997,68 @@
   [[Name][Description]]
 
   [
- [[link cgi.reference.scgi_request_service_impl.id [*id]]]
+ [[link cgi.reference.stencils__dictionary.impl [*impl]]]
     []
   ]
 
 ]
 
 
-[section:construct scgi_request_service_impl::construct]
-
-[indexterm2 construct..scgi_request_service_impl]
-
- void construct(
- implementation_type & impl);
-
-
 
 [endsect]
 
 
+[section:set stencils::dictionary::set]
 
-[section:cookie scgi_request_service_impl::cookie]
-
-[indexterm2 cookie..scgi_request_service_impl] Find the cookie meta-variable matching name.
-
- std::string cookie(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
-
-
+[indexterm2 set..stencils::dictionary] Set the varible `name` to `value` in the stencil.
 
-[endsect]
+ template<
+ typename T >
+ self_type & ``[link cgi.reference.stencils__dictionary.set.overload1 set]``(
+ string_type const & name,
+ T value);
 
+ template<
+ typename T >
+ self_type & ``[link cgi.reference.stencils__dictionary.set.overload2 set]``(
+ string_type const & name,
+ T value,
+ section const & sec);
 
+ template<>
+ dictionary & ``[link cgi.reference.stencils__dictionary.set.overload3 set]``(
+ string_type const & name,
+ string_type const & value);
 
-[section:destroy scgi_request_service_impl::destroy]
+ template<>
+ dictionary & ``[link cgi.reference.stencils__dictionary.set.overload4 set]``(
+ string_type const & name,
+ string_type const & value,
+ section const & sec);
 
-[indexterm2 destroy..scgi_request_service_impl]
 
- void destroy(
- implementation_type & impl);
+[section:overload1 stencils::dictionary::set (1 of 4 overloads)]
 
+Set the varible `name` to `value` in the stencil.
 
+ template<
+ typename T >
+ self_type & set(
+ string_type const & name,
+ T value);
 
-[endsect]
 
 
+[heading Parameters]
+
 
-[section:get_role scgi_request_service_impl::get_role]
+[variablelist
+
+[[name][The name of the variable. Use {{name}} in the stencil. ]]
 
-[indexterm2 get_role..scgi_request_service_impl]
+[[value][The value, can be any type that is supported by boost::lexical\_cast. See the docs for lexical\_cast: http://www.boost.org/libs/lexical\_cast]]
 
- role_type get_role(
- implementation_type & impl);
+]
 
 
 
@@ -25639,11 +13066,16 @@
 
 
 
-[section:id scgi_request_service_impl::id]
+[section:overload2 stencils::dictionary::set (2 of 4 overloads)]
 
-[indexterm2 id..scgi_request_service_impl]
+Set a variable and show a section in one go.
 
- static boost::asio::detail::service_id< scgi_service_impl > id;
+ template<
+ typename T >
+ self_type & set(
+ string_type const & name,
+ T value,
+ section const & sec);
 
 
 
@@ -25651,12 +13083,14 @@
 
 
 
-[section:implementation_type scgi_request_service_impl::implementation_type]
-
-[indexterm2 implementation_type..scgi_request_service_impl]
+[section:overload3 stencils::dictionary::set (3 of 4 overloads)]
 
- typedef scgi_request_impl implementation_type;
+Set the varible `name` to `value` in the stencil.
 
+ template<>
+ dictionary & set(
+ string_type const & name,
+ string_type const & value);
 
 
 
@@ -25664,40 +13098,30 @@
 
 
 
-[section:load scgi_request_service_impl::load]
+[section:overload4 stencils::dictionary::set (4 of 4 overloads)]
 
-[indexterm2 load..scgi_request_service_impl]
+Set a variable and show a section in one go.
 
- boost::system::error_code & load(
- implementation_type & impl,
- bool parse_stdin,
- boost::system::error_code & ec);
+ template<>
+ dictionary & set(
+ string_type const & name,
+ string_type const & value,
+ section const & sec);
 
 
 
 [endsect]
 
 
-
-[section:map_type scgi_request_service_impl::map_type]
-
-[indexterm2 map_type..scgi_request_service_impl]
-
- typedef cgi::map map_type;
-
-
-
-
 [endsect]
 
 
+[section:show stencils::dictionary::show]
 
-[section:meta_cookie scgi_request_service_impl::meta_cookie]
+[indexterm2 show..stencils::dictionary] Show a section.
 
-[indexterm2 meta_cookie..scgi_request_service_impl]
-
- map_type & meta_cookie(
- implementation_type & impl);
+ self_type & show(
+ section const & sec);
 
 
 
@@ -25705,128 +13129,131 @@
 
 
 
-[section:meta_env scgi_request_service_impl::meta_env]
-
-[indexterm2 meta_env..scgi_request_service_impl] Find the environment meta-variable matching name.
-
- std::string meta_env(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
-
-
+[section:string_type stencils::dictionary::string_type]
 
-[endsect]
+[indexterm2 string_type..stencils::dictionary]
 
+ typedef std::string string_type;
 
-[section:meta_get scgi_request_service_impl::meta_get]
 
-[indexterm2 meta_get..scgi_request_service_impl]
 
- map_type & ``[link cgi.reference.scgi_request_service_impl.meta_get.overload1 meta_get]``(
- implementation_type & impl);
 
- std::string ``[link cgi.reference.scgi_request_service_impl.meta_get.overload2 meta_get]``(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
+[endsect]
 
 
-[section:overload1 scgi_request_service_impl::meta_get (1 of 2 overloads)]
 
+[endsect]
 
+[section:stencils__include_error stencils::include_error]
 
- map_type & meta_get(
- implementation_type & impl);
 
 
+ class include_error
 
-[endsect]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.stencils__include_error.include_error [*include_error]]]
+ []
+ ]
+
+]
 
-[section:overload2 scgi_request_service_impl::meta_get (2 of 2 overloads)]
 
+[section:include_error stencils::include_error::include_error]
 
+[indexterm2 include_error..stencils::include_error]
 
- std::string meta_get(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec);
+ template<
+ typename Str >
+ include_error(
+ Str const & section_name,
+ Str const & filename);
 
 
 
 [endsect]
 
 
-[endsect]
 
-[section:meta_post scgi_request_service_impl::meta_post]
+[endsect]
 
-[indexterm2 meta_post..scgi_request_service_impl]
+[section:stencils__section stencils::section]
 
- map_type & ``[link cgi.reference.scgi_request_service_impl.meta_post.overload1 meta_post]``(
- implementation_type & impl);
+A class used to represent a section in the stencil.
 
- std::string ``[link cgi.reference.scgi_request_service_impl.meta_post.overload2 meta_post]``(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec,
- bool greedy = true);
+ class section
 
 
-[section:overload1 scgi_request_service_impl::meta_post (1 of 2 overloads)]
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
+ [[link cgi.reference.stencils__section.char_type [*char_type]]]
+ []
+
+ ]
 
- map_type & meta_post(
- implementation_type & impl);
+ [
 
+ [[link cgi.reference.stencils__section.string_type [*string_type]]]
+ []
+
+ ]
 
+]
 
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link cgi.reference.stencils__section.section [*section]]]
+ []
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
-[section:overload2 scgi_request_service_impl::meta_post (2 of 2 overloads)]
+ [
+ [[link cgi.reference.stencils__section.filename [*filename]]]
+ []
+ ]
 
-Find the post meta-variable matching name.
+ [
+ [[link cgi.reference.stencils__section.name [*name]]]
+ []
+ ]
 
- std::string meta_post(
- implementation_type & impl,
- const std::string & name,
- boost::system::error_code & ec,
- bool greedy = true);
+]
 
 
+[section:char_type stencils::section::char_type]
 
-[heading Parameters]
-
+[indexterm2 char_type..stencils::section]
 
-[variablelist
-
-[[greedy][This determines whether more data can be read to find the variable. The default is true to cause least surprise in the common case of having not parsed any of the POST data.]]
+ typedef char char_type;
 
-]
 
------------------------------------------------ Should this return a pair of iterators instead? What about url\_decoding? -----------------------------------------------
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:parse_cookie_vars scgi_request_service_impl::parse_cookie_vars]
+[section:filename stencils::section::filename]
 
-[indexterm2 parse_cookie_vars..scgi_request_service_impl] Read and parse the HTTP_COOKIE meta variable.
+[indexterm2 filename..stencils::section]
 
- template<
- typename RequestImpl >
- boost::system::error_code & parse_cookie_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
+ string_type filename;
 
 
 
@@ -25834,45 +13261,37 @@
 
 
 
-[section:parse_get_vars scgi_request_service_impl::parse_get_vars]
+[section:name stencils::section::name]
 
-[indexterm2 parse_get_vars..scgi_request_service_impl] Read and parse the cgi GET meta variables.
+[indexterm2 name..stencils::section]
 
- boost::system::error_code & parse_get_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
+ string_type name;
 
 
 
 [endsect]
 
 
+[section:section stencils::section::section]
 
-[section:parse_one_post_var scgi_request_service_impl::parse_one_post_var]
+[indexterm2 section..stencils::section]
 
-[indexterm2 parse_one_post_var..scgi_request_service_impl] Read and parse a single cgi POST meta variable (greedily).
+ ``[link cgi.reference.stencils__section.section.overload1 section]``();
 
- template<
- typename RequestImpl >
- boost::system::error_code & parse_one_post_var(
- implementation_type & impl,
- boost::system::error_code & ec);
+ ``[link cgi.reference.stencils__section.section.overload2 section]``(
+ const char_type * name,
+ const char_type * filename = "");
 
+ ``[link cgi.reference.stencils__section.section.overload3 section]``(
+ string_type const & name,
+ string_type const & filename = "");
 
 
-[endsect]
-
-
+[section:overload1 stencils::section::section (1 of 3 overloads)]
 
-[section:parse_post_vars scgi_request_service_impl::parse_post_vars]
 
-[indexterm2 parse_post_vars..scgi_request_service_impl] Read and parse the cgi POST meta variables (greedily).
 
- template<
- typename RequestImpl >
- boost::system::error_code & parse_post_vars(
- implementation_type & impl,
- boost::system::error_code & ec);
+ section();
 
 
 
@@ -25880,12 +13299,13 @@
 
 
 
-[section:protocol_type scgi_request_service_impl::protocol_type]
+[section:overload2 stencils::section::section (2 of 3 overloads)]
 
-[indexterm2 protocol_type..scgi_request_service_impl]
 
- typedef tags::scgi protocol_type;
 
+ section(
+ const char_type * name,
+ const char_type * filename = "");
 
 
 
@@ -25893,44 +13313,28 @@
 
 
 
-[section:read_some scgi_request_service_impl::read_some]
-
-[indexterm2 read_some..scgi_request_service_impl]
-
- template<
- typename MutableBufferSequence >
- std::size_t read_some(
- implementation_type & impl,
- const MutableBufferSequence & buf,
- boost::system::error_code & ec);
-
-
-
-[endsect]
+[section:overload3 stencils::section::section (3 of 3 overloads)]
 
 
 
-[section:scgi_request_service_impl scgi_request_service_impl::scgi_request_service_impl]
+ section(
+ string_type const & name,
+ string_type const & filename = "");
 
-[indexterm2 scgi_request_service_impl..scgi_request_service_impl]
 
- scgi_request_service_impl(
- cgi::io_service & ios);
 
+[endsect]
 
 
 [endsect]
 
 
+[section:string_type stencils::section::string_type]
 
-[section:var scgi_request_service_impl::var]
+[indexterm2 string_type..stencils::section]
 
-[indexterm2 var..scgi_request_service_impl] Extract the var value from.
+ typedef std::basic_string< char_type > string_type;
 
- std::string var(
- map_type & meta_data,
- const std::string & name,
- boost::system::error_code & ec);
 
 
 
@@ -25938,28 +13342,35 @@
 
 
 
-[section:write_some scgi_request_service_impl::write_some]
+[endsect]
 
-[indexterm2 write_some..scgi_request_service_impl]
+[section:stencils__template_error stencils::template_error]
 
- template<
- typename ConstBufferSequence >
- std::size_t write_some(
- implementation_type & impl,
- const ConstBufferSequence & buf,
- boost::system::error_code & ec);
 
 
+ class template_error
 
-[endsect]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link cgi.reference.stencils__template_error.template_error [*template_error]]]
+ []
+ ]
+
+]
 
 
-[section:_scgi_request_service_impl scgi_request_service_impl::~scgi_request_service_impl]
+[section:template_error stencils::template_error::template_error]
 
-[indexterm2 ~scgi_request_service_impl..scgi_request_service_impl]
+[indexterm2 template_error..stencils::template_error]
 
- ~scgi_request_service_impl();
+ template<
+ typename Str >
+ template_error(
+ Str const & filename);
 
 
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/doc.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/doc.qbk (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/doc.qbk 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -9,6 +9,8 @@
 
 [include cookie_game/doc.qbk]
 
+[include cookie_game2/doc.qbk]
+
 [include file_browser/doc.qbk]
 
 [include stencil/doc.qbk]

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -66,7 +66,7 @@
         << "</div>"
              "<div class=\"var_value\">"
         << iter->second
- << (req.is_file(iter->first) ? " (file)" : "")
+ << (req.uploads.count(iter->first) ? " (file)" : "")
         << "</div>"
            "</div>";
     }
@@ -100,24 +100,22 @@
              "<br />"
              "<input type=file name=user_file />"
              "<input type=hidden name=cmd value=multipart_test />"
- "<br />"
- "<input type=submit value=submit />"
- "</form><p />";
+ "<br />";
+ // Access file uploads (which are saved to disk).
+ if (req.uploads.count("user_file")) {
+ cgi::common::form_part& part = req.uploads["user_file"];
+ if (!part.filename.empty())
+ resp<< "Saved uploaded file to: " << part.path << "<br />";
+ }
+ resp<< "<input type=submit value=submit />"
+ "<br />";
+ "</form><p />";
 
   format_map(resp, req, req.env, "Environment Variables");
   //format_map(resp, req, req.get, "GET Variables");
   format_map(resp, req, req.form, "Form [" + req.method() + "] Variables");
   format_map(resp, req, req.cookies, "Cookie Variables");
-
- boost::optional<cgi::common::form_part&> part = req.get_form_part("user_file");
- if (part)
- resp<< "File path: " << (*part).path;
- else
- resp<< "File not found.";
-
- if (req.is_file("user_file"))
- resp<< " (uploaded as a file)";
-
+ format_map(resp, req, req.uploads, "Uploaded Files");
 
   // Note that this (and any other) HTTP header can go either before or after
   // the response contents.

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/Jamfile.v2 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,23 @@
+# Copyright (c) 2007 Darren Garvey
+#
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy
+# at http://www.boost.org/LICENSE_1_0.txt)
+
+project boost/cgi/example/cgi/stencil ;
+
+exe cgi_stencil
+ :
+ main.cpp /boost/regex/ /boost/cgi/
+ :
+ ;
+
+
+# Our install rule (builds binaries and copies them to <location>)
+install install
+ : cgi_stencil
+ : <location>$(cgi-bin)
+ ;
+
+# Only install example if you use `bjam install' or equivalent
+explicit install ;

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/doc.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/doc.qbk 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,11 @@
+
+[section Stencil]
+
+[import main.cpp]
+
+[cgi_stencil]
+
+See the [@../../example/cgi/stencil/main.cpp full source listing].
+
+[endsect][/ stencil]
+

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,133 @@
+// -- main.hpp --
+//
+// Copyright (c) Darren Garvey 2007-2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+////////////////////////////////////////////////////////////////
+//
+// [cgi_stencil
+//
+
+#include <iostream>
+#include <boost/cgi/cgi.hpp>
+#include <boost/cgi/utility/stencil.hpp>
+
+using namespace boost::cgi;
+
+int handle_request(request& req)
+{
+ req.load(parse_all);
+
+ // Construct a response that uses Google cTemplate. Also sets the root
+ // directory where the stencils are found.
+ stencil resp("../templates/");
+
+ //// Test 1.
+
+ // This is a minimal response. The content_type(...) may go before or after
+ // the response text.
+ // The content of the response - which is everything streamed to it - is
+ // added to a {{content}} field in the stencil.
+ resp<< content_type("text/html")
+ << "Hello there, universe!";
+
+ //// Test 2.
+
+ // Set some fields.
+ resp.set("script_name", req.script_name()); // Populates {{script_name}}.
+ resp.set("some_string", req.get["string"]); // Populates {{some_string}}.
+ // set() supports any type that Boost.Lexical_cast does.
+ resp.set("short_bits", 8 * sizeof(short)); // Populates {{short_bits}}.
+ if (req.get.count("short"))
+ {
+ // Almost any type is supported by as<>
+ // (ie. any type supported by Boost.Lexical_cast.).
+ short some_short = req.get.as<short>("short", -1);
+ resp.set("some_short", some_short);
+ }
+
+ //// Test 3.
+
+ // Show a section, conditionally.
+
+ // Use the "show" GET variable, or default to the string "show" if not set.
+ request::string_type show = req.get.pick("show", "show");
+ resp.set("show", show == "show" ? "hide" : "show");
+ if (show == "show")
+ resp.show("some_section"); // Shows {{#some_section}}...{{/some_section}}.
+
+ //// Test 4.
+
+ int num = req.get.as("count", 0);
+ if (num < 0) num = 0;
+ resp.set("show_less", num ? num - 1 : 0);
+ resp.set("show_more", num + 1);
+ stencil::section sec("section_with_variable");
+ for (int i(0); i < num; ++i)
+ {
+ // We can show a section and set one field in it in one go.
+ resp.set("some_section_variable", i + 1, sec);
+ }
+
+ //// Test 5.
+
+ resp.add(stencil::section("embedded")).set("test", "passed");
+
+ stencil::dictionary dict = resp.add("embedded");
+ dict.add("subsection") // returns a new sub-dictionary.
+ .set("test", "passed again")
+ .set("other", "(another field)");
+ dict.set("test", "passed yet again", stencil::section("subsection"));
+
+ //// Test 6.
+
+ // Include another stencil into this one at marker {{>include}}.
+ resp.include(
+ stencil::section(
+ "include",
+ "cgi_stencil.include.html"
+ )
+ );
+
+ // Short-cut for stencil includes.
+ resp.include("include", "cgi_stencil.include.html");
+
+ resp<< cookie("name", "value");
+
+ /// End Tests.
+
+ // Expand the response using the specified template.
+ // cTemplate has a cache internally, which we can choose to
+ // ignore.
+ resp.expand("cgi_stencil.html");
+
+ // Send the response and close the request.
+ return commit(req, resp);
+}
+
+int main()
+{
+try {
+
+ request req;
+ if (handle_request(req))
+ std::cerr<< "Error returned from handling request." << std::endl;
+ else
+ std::cerr<< "Successfully handled request." << std::endl;
+
+ return 0;
+
+} catch(std::exception& e) {
+ using namespace std;
+ cout<< "Content-type: text/plain\r\n\r\n"
+ << "Error: " << e.what() << endl;
+} catch(...) {
+ using namespace std;
+ cout<< "Content-type: text/plain\r\n\r\n"
+ << "Unexpected exception." << endl;
+}
+ return 1;
+}
+//]

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/stencil.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/stencil.html 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,95 @@
+{{! This is a comment. }}
+{{! Set the delimeter just for this introduction. }}
+{{=<< >>=}}
+<<! This is a comment for now.
+
+ Fields look like: {{variable}}
+ Sections look like: {{#section}}some stuff{{/section}}.
+
+ Need to reset the delimeter now, back to the default.
+>>
+<<={{ }}=>>
+{{! This is a comment again. }}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>CGI Stencils (using Google cTemplate)</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css" />
+</head>
+<body>
+
+{{!
+ The response content is set to the `content` field.
+
+ You can write to the stencil just as with a boost::cgi::response and when
+ the stencil is expanded, the body of the response is dumped into the
+ `content` field. If you don't want to display the content, simply remove
+ this field in the template.
+}}
+
+<p>Reset Tests</p>
+
+<fieldset>
+ <legend>Test 1 - Original Response Content</legend>
+ <div id="content">
+ {{! Indenting works as you'd expect. }}
+ {{content}}
+ </div>
+</fieldset>
+
+<fieldset>
+ <legend>Test 2 - GET Variables</legend>
+ Here we test using values taken from the query string. The first value shows an HTML-escaped string.
+ The second line attempts type-casting to a short: If that fails, a default value of -1 is used.
+ <ul>
+ <li>
+ String: {{some_string:h}} (examples:
+ plain string,
+ encoded string)
+ </li>
+ <li>
+ {{short_bits}}-bit integer: {{some_short}} (examples:
+ valid number,
+ invalid number)
+ </li>
+ </ul>
+</fieldset>
+
+<fieldset>
+ <legend>Test 3 - Optional Sections ({{show}})</legend>
+ {{#some_section}}
+ <div id="section">
+ This section is shown by default and has only plain text in it.
+ </div>
+ {{/some_section}}
+</fieldset>
+
+<fieldset>
+ <legend>Test 4 - Sections With a Single Field</legend>
+ Below are some variables, shown by expanding a section multiple times
+ (more | less | reset):
+ {{#section_with_variable}}
+ <div class="section">
+ &lt; Section #{{some_section_variable:h}} &gt;
+ </div>
+ {{/section_with_variable}}
+</fieldset>
+
+<fieldset>
+ <legend>Test 5 - Embedded sections</legend>
+ {{#embedded}}
+ <ul>
+ {{#subsection}}
+ <li>The embedded section.<br />Test: {{test}} {{other}}</li>
+ {{/subsection}}
+ </ul>
+ {{/embedded}}
+</fieldset>
+
+<fieldset>
+ <legend>Test 6 - Include Files</legend>
+ {{>include}}
+</fieldset>
+
+</body>
+</html>
\ No newline at end of file

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/stencil.include.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/stencil/stencil.include.html 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,3 @@
+<div>
+ Included file: <span style="font-family: monospace">cgi_stencil.include.html</span>
+</div>
\ No newline at end of file

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,53 @@
+// -- main.hpp --
+//
+// Copyright (c) Darren Garvey 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+////////////////////////////////////////////////////////////////
+//
+//[cgi_upload
+//
+
+#include <boost/cgi/cgi.hpp>
+#include <boost/cgi/utility/stencil.hpp>
+
+namespace cgi = boost::cgi;
+
+int main()
+{
+try {
+ // Construct a request. Parses all GET, POST and environment data,
+ // as well as cookies.
+ cgi::request req;
+ // Using a response is the simplest way to write data back to the client.
+ cgi::stencil resp("../templates/");
+
+ resp<< cgi::content_type("text/html");
+ resp.set("filename", req.post["file"]);
+ resp.set("path", req.uploads["file"].path.parent_path().string());
+ resp.set("filename_check", req.uploads["file"].filename);
+ resp.set("content_type", req.uploads["file"].content_type);
+ resp.set("content_disposition", req.uploads["file"].content_disposition);
+
+ resp.expand("cgi_upload.html");
+
+ // Leave this function, after sending the response and closing the request.
+ // Returns 0 on success.
+ return cgi::commit(req, resp);
+
+} catch(std::exception& e) {
+ using namespace std;
+ cout<< "Content-type: text/plain\r\n\r\n"
+ << "Error: " << e.what() << endl;
+ return 1;
+} catch(...) {
+ using namespace std;
+ cout<< "Content-type: text/plain\r\n\r\n"
+ << "Unexpected exception." << endl;
+ return 1;
+}
+}
+//]
+

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/upload.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/upload/upload.html 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>CGI Stencils (using Google cTemplate)</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css" />
+</head>
+<body>
+
+<fieldset>
+ <legend>Test 1 - Filename</legend>
+ {{filename}}<br />
+ {{path}}<br />
+ {{filename_check}}<br />
+ {{content_type}}<br />
+ {{content_disposition}}<br />
+
+ <form method="post" enctype="multipart/form-data">
+ <input type="file" name="file" value="" />
+ <input type="hidden" name="upload" value="1" />
+ <input type="submit" name="submit" value="Upload" />
+ </form>
+</fieldset>
+
+</body>
+</html>
\ No newline at end of file

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/amortization/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/amortization/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/amortization/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -42,8 +42,7 @@
 {
   dict.SetValue("LoanAmt", has_key(req.post, "LoanAmt")
       ? "$250,000" : req.post["LoanAmt"]);
- dict.SetValue("YearlyIntRate", has_key(req.post, "YearlyIntRate")
- ? "6.000" : req.post["YearlyIntRate"]);
+ dict.SetIntValue("YearlyIntRate", req.post.as("YearlyIntRate", 6.000));
 
   boost::array<std::string, 8> year_opts
     = {{ "5", "7", "10", "20", "30", "40", "50" }};
@@ -59,8 +58,8 @@
   {
     double P = boost::lexical_cast<double>(
       string_from_currency(req.post["LoanAmt"]));
- double i = boost::lexical_cast<double>(req.post["YearlyIntRate"]) / 1200;
- double n = boost::lexical_cast<double>(req.post["TermYrs"]) * 12;
+ double i = req.post.as<double>("YearlyIntRate", 1) / 1200;
+ double n = req.post.as<double>("TermYrs", 1) * 12;
     double monthly_payments = (P*i) / (1 - std::pow((1+i), -n));
     
     ctemplate::TemplateDictionary* sub_dict
@@ -113,33 +112,29 @@
   std::string h("Content-type: text/html\r\n\r\n");
   write(req.client(), buffer(h));
 
- std::string arg(req.get["arg"]);
- if (arg.empty())
- arg = "2"; // set this as default (for no particular reason).
+ int arg = req.get.as("arg", 2); // 2 is the default.
 
   // Different, but equivalent ways of writing the output.
- if (arg == "1")
+ std::string output;
+ switch (arg)
   {
- std::string output;
+ case 1:
     tmpl->Expand(&output, &dict);
     resp<< output;
- }else
- if (arg == "2")
- {
- std::string output;
+ break;
+ case 2:
     tmpl->Expand(&output, &dict);
     write(req.client(), buffer(output));
- }else
-// if (arg == "3")
-// {
+ break;
+ case 3:
 // // This requires a modified version of Google.cTemplate, so it won't work.
 // std::string s;
 // std::vector<boost::asio::const_buffer> out;
 //
 // tmpl->Expand(&s, &out, &dict);
 // write(req.client(), out);
-// }else
- {
+ break;
+ default:
     resp<< "Error!";
     return 1;
   }

Copied: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/async_echo/main.cpp (from r58566, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/async_echo/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -7,7 +7,7 @@
 //
 ////////////////////////////////////////////////////////////////
 //
-//[fcgi_echo
+//[fcgi_async_echo
 //
 // This example simply echoes all variables back to the user. ie.
 // the environment and the parsed GET, POST and cookie variables.
@@ -18,7 +18,6 @@
 #include <iostream>
 ///////////////////////////////////////////////////////////
 #include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/program_options/environment_iterator.hpp>
 ///////////////////////////////////////////////////////////
 #include "boost/cgi/fcgi.hpp"
 
@@ -28,15 +27,15 @@
 // The styling information for the page, just to make things look nicer.
 static const char* gCSS_text =
 "body { padding: 0; margin: 3%; border-color: #efe; }"
-".var_map_title"
+"ul.data-map .title"
     "{ font-weight: bold; font-size: large; }"
-".var_map"
+"ul.data-map"
     "{ border: 1px dotted; padding: 2px 3px 2px 3px; margin-bottom: 3%; }"
-".var_pair"
+"ul.data-map li"
     "{ border-top: 1px dotted; overflow: auto; padding: 0; margin: 0; }"
-".var_name"
+"ul.data-map div.name"
     "{ position: relative; float: left; width: 30%; font-weight: bold; }"
-".var_value"
+"ul.data-map div.value"
     "{ position: relative; float: left; width: 65%; left: 1%;"
      " border-left: 1px solid; padding: 0 5px 0 5px;"
      " overflow: auto; white-space: pre; }"
@@ -51,27 +50,26 @@
 template<typename OStream, typename Request, typename Map>
 void format_map(OStream& os, Request& req, Map& m, const std::string& title)
 {
- os<< "<div class=\"var_map\">"
- "<div class=\"var_map_title\">"
+ os<< "<ul class=\"data-map\">"
+ "<div class=\"title\">"
     << title
     << "</div>";
 
   if (m.empty())
- os<< "<div class=\"var_pair\">EMPTY</div>";
+ os<< "<li>EMPTY</li>";
   else
     for (typename Map::const_iterator i = m.begin(); i != m.end(); ++i)
     {
- os<< "<div class=\"var_pair\">"
- "<div class=\"var_name\">"
+ os<< "<li>"
+ "<div class=\"name\">"
         << i->first
         << "</div>"
- "<div class=\"var_value\">"
+ "<div class=\"value\">"
         << i->second
- << (req.is_file(i->first) ? " (file)" : "")
         << "</div>"
- "</div>";
+ "</li>";
     }
- os<< "<div class=\"clear\"></div></div>";
+ os<< "<div class=\"clear\"></div></ul>";
 }
 
 std::size_t process_id()
@@ -84,9 +82,7 @@
 }
 
 
-/// This function accepts and handles a single request.
-template<typename Request>
-int handle_request(Request& req)
+int handle_request(acceptor& a, request& req)
 {
   boost::system::error_code ec;
   
@@ -119,7 +115,7 @@
            "Request ID = " << req.id() << "<br />"
            "Request Hash = " << req.hash() << "<br />"
            "Process ID = " << process_id() << "<br />"
- "<form method=post>" // enctype=\"multipart/form-data\">"
+ "<form method=post enctype=\"multipart/form-data\">"
              "<input type=text name=name value='"
       << req.post["name"] << "' />"
              "<br />"
@@ -139,6 +135,7 @@
   format_map(resp, req, req.env, "Environment Variables");
   format_map(resp, req, req.get, "GET Variables");
   format_map(resp, req, req.post, "POST Variables");
+ format_map(resp, req, req.uploads, "File Uploads");
   format_map(resp, req, req.cookies, "Cookie Variables");
 
   // Print the buffer containing the POST data and the FastCGI params.
@@ -152,9 +149,16 @@
   resp<< "Response content-length == "
       << resp.content_length(); // the content-length (returns std::size_t)
 
- // This function finishes up. The optional third argument
- // is the program status (default: 0).
- return commit(req, resp);
+ //
+ // Write the response. If the commit is successful, start up another
+ // asynchronous accept request.
+ //
+ int status = commit(req, resp);
+ if (!status)
+ a.async_accept(boost::bind(&handle_request, boost::ref(a), _1));
+
+ // The return value isn't used for anything.
+ return status;
 }
 
 int main()
@@ -165,59 +169,57 @@
   // Make a `service` (more about this in other examples).
   service s;
   
- using boost::asio::ip::tcp;
-
   // Make an `acceptor` for accepting requests through.
 #if defined (BOOST_WINDOWS)
- acceptor a(s, 8009); // Accept requests on port 8009.
+ // Accept requests on port 8009.
+ acceptor a(s, 8009);
 #else
- acceptor a(s);
+ acceptor a;
 #endif // defined (BOOST_WINDOWS)
 
   //
   // After the initial setup, we can enter a loop to handle one request at a
   // time until there's an error of some sort.
   //
- int ret(0);
- for (;;)
+ int count(10);
+ while (--count)
   {
- request req(s);
     //
- // Now we enter another loop that reuses the request's memory - makes
- // things more efficient). You should always do this for
- // now; this requirement might be removed in future.
+ // An acceptor can take a request handler as an argument to `accept` and it
+ // will accept a request and pass the handler the request. The return value
+ // of `accept` when used like this is the result of the handler.
     //
- for (;;)
- {
- a.accept(req);
- std::cerr<< "Accepted new request.\n";
- ret = handle_request(req);
- if (ret)
- break;
- //
- // Clear the request's data, so information doesn't pass between
- // different users (this step isn't really necessary, because
- // the library will do this automatically.
- //
- req.clear();
- }
+ // Note that a request handler is any function or function object with the
+ // signature:
+ // boost::function<int (boost::fcgi::request&)>
+ // See the documentation for Boost.Function and Boost.Bind for more.
+ //
+ // The acceptor maintains an internal queue of requests and will reuse a
+ // dead request if one is waiting.
+ //
+ a.async_accept(boost::bind(&handle_request, boost::ref(a), _1));
   }
   
+ std::cerr<< "Start running service..." << std::endl;
+ s.run();
+ std::cerr<< "Shutdown ." << std::endl;
+
+ std::cerr<< "Processing finished. Press enter to continue..." << std::endl;
   std::cin.get();
   
- return ret;
+ //return 0;
 
 }catch(boost::system::system_error const& se){
   // This is the type of error thrown by the library.
   std::cerr<< "[fcgi] System error: " << se.what() << std::endl;
- return -1;
+ //return -1;
 }catch(std::exception const& e){
   // Catch any other exceptions
   std::cerr<< "[fcgi] Exception: " << e.what() << std::endl;
- return -2;
+ //return -2;
 }catch(...){
   std::cerr<< "[fcgi] Uncaught exception!" << std::endl;
- return -3;
+ //return -3;
 }
   std::cerr<< "Press enter to continue." << std::endl;
   std::cin.get();

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/doc.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/doc.qbk (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/doc.qbk 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -3,8 +3,16 @@
 
 [include echo/doc.qbk]
 
+[include async_echo/doc.qbk]
+
 [include amortization/doc.qbk]
 
+[include stencil/doc.qbk]
+
+[include file_browser/doc.qbk]
+
+[include upload/doc.qbk]
+
 [section Servers]
 
 [include server1/doc.qbk]

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/echo/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -30,15 +30,15 @@
 // The styling information for the page, just to make things look nicer.
 static const char* gCSS_text =
 "body { padding: 0; margin: 3%; border-color: #efe; }"
-".var_map_title"
+"ul.data-map .title"
     "{ font-weight: bold; font-size: large; }"
-".var_map"
+"ul.data-map"
     "{ border: 1px dotted; padding: 2px 3px 2px 3px; margin-bottom: 3%; }"
-".var_pair"
+"ul.data-map li"
     "{ border-top: 1px dotted; overflow: auto; padding: 0; margin: 0; }"
-".var_name"
+"ul.data-map div.name"
     "{ position: relative; float: left; width: 30%; font-weight: bold; }"
-".var_value"
+"ul.data-map div.value"
     "{ position: relative; float: left; width: 65%; left: 1%;"
      " border-left: 1px solid; padding: 0 5px 0 5px;"
      " overflow: auto; white-space: pre; }"
@@ -53,27 +53,26 @@
 template<typename OStream, typename Request, typename Map>
 void format_map(OStream& os, Request& req, Map& m, const std::string& title)
 {
- os<< "<div class=\"var_map\">"
- "<div class=\"var_map_title\">"
+ os<< "<ul class=\"data-map\">"
+ "<div class=\"title\">"
     << title
     << "</div>";
 
   if (m.empty())
- os<< "<div class=\"var_pair\">EMPTY</div>";
+ os<< "<li>EMPTY</li>";
   else
     for (typename Map::const_iterator i = m.begin(); i != m.end(); ++i)
     {
- os<< "<div class=\"var_pair\">"
- "<div class=\"var_name\">"
+ os<< "<li>"
+ "<div class=\"name\">"
         << i->first
         << "</div>"
- "<div class=\"var_value\">"
+ "<div class=\"value\">"
         << i->second
- << (req.is_file(i->first) ? " (file)" : "")
         << "</div>"
- "</div>";
+ "</li>";
     }
- os<< "<div class=\"clear\"></div></div>";
+ os<< "<div class=\"clear\"></div></ul>";
 }
 
 std::size_t process_id()
@@ -86,9 +85,7 @@
 }
 
 
-/// This function accepts and handles a single request.
-template<typename Request>
-int handle_request(Request& req)
+int handle_request(request& req)
 {
   boost::system::error_code ec;
   
@@ -121,7 +118,7 @@
            "Request ID = " << req.id() << "<br />"
            "Request Hash = " << req.hash() << "<br />"
            "Process ID = " << process_id() << "<br />"
- "<form method=post>" // enctype=\"multipart/form-data\">"
+ "<form method=post enctype=\"multipart/form-data\">"
              "<input type=text name=name value='"
       << req.post["name"] << "' />"
              "<br />"
@@ -141,6 +138,7 @@
   format_map(resp, req, req.env, "Environment Variables");
   format_map(resp, req, req.get, "GET Variables");
   format_map(resp, req, req.post, "POST Variables");
+ format_map(resp, req, req.uploads, "File Uploads");
   format_map(resp, req, req.cookies, "Cookie Variables");
 
   // Print the buffer containing the POST data and the FastCGI params.
@@ -167,8 +165,6 @@
   // Make a `service` (more about this in other examples).
   service s;
   
- using boost::asio::ip::tcp;
-
   // Make an `acceptor` for accepting requests through.
 #if defined (BOOST_WINDOWS)
   acceptor a(s, 8009); // Accept requests on port 8009.
@@ -183,28 +179,25 @@
   int ret(0);
   for (;;)
   {
- request req(s);
     //
- // Now we enter another loop that reuses the request's memory - makes
- // things more efficient). You should always do this for
- // now; this requirement might be removed in future.
+ // An acceptor can take a request handler as an argument to `accept` and it
+ // will accept a request and pass the handler the request. The return value
+ // of `accept` when used like this is the result of the handler.
     //
- for (;;)
- {
- a.accept(req);
- std::cerr<< "Accepted new request.\n";
- ret = handle_request(req);
- if (ret)
- break;
- //
- // Clear the request's data, so information doesn't pass between
- // different users (this step isn't really necessary, because
- // the library will do this automatically.
- //
- req.clear();
- }
+ // Note that a request handler is any function or function object with the
+ // signature:
+ // boost::function<int (boost::fcgi::request&)>
+ // See the documentation for Boost.Function and Boost.Bind for more.
+ //
+ // The acceptor maintains an internal queue of requests and will reuse a
+ // dead request if one is waiting.
+ //
+ ret = a.accept(&handle_request);
+ if (ret)
+ break;
   }
   
+ std::cerr<< "Processing finished. Press enter to continue..." << std::endl;
   std::cin.get();
   
   return ret;

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/Jamfile.v2 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,23 @@
+# Copyright (c) 2007 Darren Garvey
+#
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy
+# at http://www.boost.org/LICENSE_1_0.txt)
+
+project boost/cgi/example/cgi/stencil ;
+
+exe cgi_stencil
+ :
+ main.cpp /boost/regex/ /boost/cgi/
+ :
+ ;
+
+
+# Our install rule (builds binaries and copies them to <location>)
+install install
+ : cgi_stencil
+ : <location>$(cgi-bin)
+ ;
+
+# Only install example if you use `bjam install' or equivalent
+explicit install ;

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/doc.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/doc.qbk 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,11 @@
+
+[section Stencil]
+
+[import main.cpp]
+
+[cgi_stencil]
+
+See the [@../../example/cgi/stencil/main.cpp full source listing].
+
+[endsect][/ stencil]
+

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,140 @@
+// -- main.hpp --
+//
+// Copyright (c) Darren Garvey 2007-2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+////////////////////////////////////////////////////////////////
+//
+// [cgi_stencil
+//
+
+#include <iostream>
+#include <boost/cgi/fcgi.hpp>
+#include <boost/cgi/utility/stencil.hpp>
+
+using namespace boost::fcgi;
+
+int handle_request(request& req)
+{
+ req.load(parse_all);
+
+ // Construct a response that uses Google cTemplate. Also sets the root
+ // directory where the stencils are found.
+ stencil resp("templates/");
+
+ //// Test 1.
+
+ // This is a minimal response. The content_type(...) may go before or after
+ // the response text.
+ // The content of the response - which is everything streamed to it - is
+ // added to a {{content}} field in the stencil.
+ resp<< content_type("text/html")
+ << "Hello there, universe!";
+
+ //// Test 2.
+
+ // Set some fields.
+ resp.set("script_name", req.script_name()); // Populates {{script_name}}.
+ resp.set("some_string", req.get["string"]); // Populates {{some_string}}.
+ // set() supports any type that Boost.Lexical_cast does.
+ resp.set("short_bits", 8 * sizeof(short)); // Populates {{short_bits}}.
+ if (req.get.count("short"))
+ {
+ // Almost any type is supported by as<>
+ // (ie. any type supported by Boost.Lexical_cast.).
+ short some_short = req.get.as<short>("short", -1);
+ resp.set("some_short", some_short);
+ }
+
+ //// Test 3.
+
+ // Show a section, conditionally.
+
+ // Use the "show" GET variable, or default to the string "show" if not set.
+ request::string_type show = req.get.pick("show", "show");
+ resp.set("show", show == "show" ? "hide" : "show");
+ if (show == "show")
+ resp.show("some_section"); // Shows {{#some_section}}...{{/some_section}}.
+
+ //// Test 4.
+
+ int num = req.get.as("count", 0);
+ if (num < 0) num = 0;
+ resp.set("show_less", num ? num - 1 : 0);
+ resp.set("show_more", num + 1);
+ stencil::section sec("section_with_variable");
+ for (int i(0); i < num; ++i)
+ {
+ // We can show a section and set one field in it in one go.
+ resp.set("some_section_variable", i + 1, sec);
+ }
+
+ //// Test 5.
+
+ resp.add(stencil::section("embedded")).set("test", "passed");
+
+ stencil::dictionary dict = resp.add("embedded");
+ dict.add("subsection") // returns a new sub-dictionary.
+ .set("test", "passed again")
+ .set("other", "(another field)");
+ dict.set("test", "passed yet again", stencil::section("subsection"));
+
+ //// Test 6.
+
+ // Include another stencil into this one at marker {{>include}}.
+ resp.include(
+ stencil::section(
+ "include",
+ "stencil.include.html"
+ )
+ );
+
+ // Short-cut for stencil includes.
+ resp.include("include", "stencil.include.html");
+
+ resp<< cookie("name", "value");
+
+ /// End Tests.
+
+ // Expand the response using the specified template.
+ // cTemplate has a cache internally, which we can choose to
+ // ignore.
+ resp.expand("stencil.html", stencil::reload);
+
+ // Send the response and close the request.
+ return commit(req, resp);
+}
+
+int main()
+{
+try {
+ service s;
+ acceptor a(s, 8018);
+
+ // Handle requests (one at a time) until the counter overflows.
+ for(unsigned count(1);count;++count)
+ {
+ if (a.accept(&handle_request))
+ std::cerr<< "Error returned from handling request #" << count << std::endl;
+ else
+ std::cerr<< "Successfully handled request #" << count << std::endl;
+ }
+
+ return 0;
+
+} catch(std::exception& e) {
+ using namespace std;
+ cerr<< "Error: " << e.what() << endl;
+} catch(...) {
+ using namespace std;
+ cerr<< "Unexpected exception." << endl;
+}
+ // Control only reaches here if an exception has been caught.
+ using namespace std;
+ cerr<< "Press enter to close console window..." << endl;
+ cin.get();
+ return 1;
+}
+//]

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/stencil.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/stencil.html 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,95 @@
+{{! This is a comment. }}
+{{! Set the delimeter just for this introduction. }}
+{{=<< >>=}}
+<<! This is a comment for now.
+
+ Fields look like: {{variable}}
+ Sections look like: {{#section}}some stuff{{/section}}.
+
+ Need to reset the delimeter now, back to the default.
+>>
+<<={{ }}=>>
+{{! This is a comment again. }}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>FastCGI Stencils (using Google cTemplate)</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css" />
+</head>
+<body>
+
+{{!
+ The response content is set to the `content` field.
+
+ You can write to the stencil just as with a boost::cgi::response and when
+ the stencil is expanded, the body of the response is dumped into the
+ `content` field. If you don't want to display the content, simply remove
+ this field in the template.
+}}
+
+<p>Reset Tests</p>
+
+<fieldset>
+ <legend>Test 1 - Original Response Content</legend>
+ <div id="content">
+ {{! Indenting works as you'd expect. }}
+ {{content}}
+ </div>
+</fieldset>
+
+<fieldset>
+ <legend>Test 2 - GET Variables</legend>
+ Here we test using values taken from the query string. The first value shows an HTML-escaped string.
+ The second line attempts type-casting to a short: If that fails, a default value of -1 is used.
+ <ul>
+ <li>
+ String: {{some_string:h}} (examples:
+ plain string,
+ encoded string)
+ </li>
+ <li>
+ {{short_bits}}-bit integer: {{some_short}} (examples:
+ valid number,
+ invalid number)
+ </li>
+ </ul>
+</fieldset>
+
+<fieldset>
+ <legend>Test 3 - Optional Sections ({{show}})</legend>
+ {{#some_section}}
+ <div id="section">
+ This section is shown by default and has only plain text in it.
+ </div>
+ {{/some_section}}
+</fieldset>
+
+<fieldset>
+ <legend>Test 4 - Sections With a Single Field</legend>
+ Below are some variables, shown by expanding a section multiple times
+ (more | less | reset):
+ {{#section_with_variable}}
+ <div class="section">
+ &lt; Section #{{some_section_variable:h}} &gt;
+ </div>
+ {{/section_with_variable}}
+</fieldset>
+
+<fieldset>
+ <legend>Test 5 - Embedded sections</legend>
+ {{#embedded}}
+ <ul>
+ {{#subsection}}
+ <li>The embedded section.<br />Test: {{test}} {{other}}</li>
+ {{/subsection}}
+ </ul>
+ {{/embedded}}
+</fieldset>
+
+<fieldset>
+ <legend>Test 6 - Include Files</legend>
+ {{>include}}
+</fieldset>
+
+</body>
+</html>
\ No newline at end of file

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/stencil.include.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/stencil/stencil.include.html 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,3 @@
+<div>
+ Included file: <span style="font-family: monospace">cgi_stencil.include.html</span>
+</div>
\ No newline at end of file

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/main.cpp 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,82 @@
+// -- main.hpp --
+//
+// Copyright (c) Darren Garvey 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+////////////////////////////////////////////////////////////////
+//
+//[fcgi_upload
+//
+
+#include <boost/cgi/fcgi.hpp>
+#include <boost/cgi/utility/stencil.hpp>
+
+namespace cgi = boost::fcgi;
+namespace http = boost::fcgi::http;
+
+int main()
+{
+try {
+ cgi::service service;
+ // Construct a request. Parses all GET, POST and environment data,
+ // as well as cookies.
+ cgi::request req(service);
+
+ cgi::acceptor acceptor(service, 8050);
+
+ int ret(0);
+
+ for(;;)
+ {
+ acceptor.accept(req);
+
+ try {
+ req.load(cgi::parse_all);
+
+ // Using a response is the simplest way to write data back to the client.
+ cgi::stencil resp;
+
+ resp<< cgi::content_type("text/html");
+ resp.set("filename", req.post["file"]);
+ resp.set("path", req.uploads["file"].path.parent_path().string());
+ resp.set("filename_check", req.uploads["file"].filename);
+ resp.set("content_type", req.uploads["file"].content_type);
+ resp.set("content_disposition", req.uploads["file"].content_disposition);
+
+ resp.expand("upload.html");
+
+ ret = cgi::commit(req, resp);
+
+ } catch(boost::system::system_error& e) {
+ using namespace std;
+ cerr<< "Error " << e.code() << ": " << e.what() << endl;
+ boost::system::error_code ec;
+ ret = req.close(http::internal_server_error, 1, ec);
+ } catch(std::exception& e) {
+ using namespace std;
+ cerr<< "Error: " << e.what() << endl;
+ boost::system::error_code ec;
+ ret = req.close(http::internal_server_error, 1, ec);
+ }
+ }
+
+ // Leave this function, after sending the response and closing the request.
+ // Returns 0 on success.
+ return ret;
+
+} catch(std::exception& e) {
+ using namespace std;
+ cerr<< "Error: " << e.what() << endl;
+ cin.get();
+ return 1;
+} catch(...) {
+ using namespace std;
+ cerr<< "Unexpected exception." << endl;
+ cin.get();
+ return 1;
+}
+}
+//]
+

Added: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/upload.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/upload/upload.html 2010-01-26 20:02:52 EST (Tue, 26 Jan 2010)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>FastCGI Stencils (using Google cTemplate)</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css" />
+</head>
+<body>
+
+<fieldset>
+ <legend>Test 1 - Filename</legend>
+ {{filename}}<br />
+ {{path}}<br />
+ {{filename_check}}<br />
+ {{content_type}}<br />
+ {{content_disposition}}<br />
+
+ <form method="post" enctype="multipart/form-data">
+ <input type="file" name="file" value="" />
+ <input type="hidden" name="upload" value="1" />
+ <input type="submit" name="submit" value="Upload" />
+ </form>
+</fieldset>
+
+</body>
+</html>
\ No newline at end of file


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk