$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: drrngrvy_at_[hidden]
Date: 2007-07-20 04:26:12
Author: drrngrvy
Date: 2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
New Revision: 7488
URL: http://svn.boost.org/trac/boost/changeset/7488
Log:
corrections from the last commit
Added:
   sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp
   sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp
   sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp
   sandbox/SOC/2007/cgi/boost/cgi/status_type.hpp
Removed:
   sandbox/SOC/2007/cgi/boost/cgi/cgi/cgi_protocol_service.hpp
   sandbox/SOC/2007/cgi/boost/cgi/detail/cgi_acceptor_service.hpp
   sandbox/SOC/2007/cgi/boost/cgi/detail/fcgi_acceptor_service.hpp
   sandbox/SOC/2007/cgi/boost/cgi/request_impl/async_cgi_request_impl.hpp
   sandbox/SOC/2007/cgi/boost/cgi/request_role.hpp
   sandbox/SOC/2007/cgi/boost/cgi/request_type.hpp
   sandbox/SOC/2007/cgi/boost/cgi/service_impl/async_cgi_service_impl.hpp
Text files modified: 
   sandbox/SOC/2007/cgi/boost/cgi/is_async.hpp |     2 +-                                      
   1 files changed, 1 insertions(+), 1 deletions(-)
Deleted: sandbox/SOC/2007/cgi/boost/cgi/cgi/cgi_protocol_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/cgi/cgi_protocol_service.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,18 +0,0 @@
-//             -- cgi_protocol_service.hpp --
-//
-//            Copyright (c) Darren Garvey 2007.
-// 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)
-//
-////////////////////////////////////////////////////////////////
-#ifndef CGI_CGI_PROTOCOL_SERVICE_HPP_INCLUDED__
-#define CGI_CGI_PROTOCOL_SERVICE_HPP_INCLUDED__
-
-namespace cgi {
-
-  typedef basic_protocol_service<tags::async_cgi> service;
-
-} // namespace cgi
-
-#endif // CGI_CGI_PROTOCOL_SERVICE_HPP_INCLUDED__
Deleted: sandbox/SOC/2007/cgi/boost/cgi/detail/cgi_acceptor_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/detail/cgi_acceptor_service.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,12 +0,0 @@
-#ifndef CGI_CGI_ACCEPTOR_SERVICE_HPP_INCLUDED__
-#define CGI_CGI_ACCEPTOR_SERVICE_HPP_INCLUDED__
-
-namespace cgi {
-namespace detail {
-
-
-
-} // namespace detail
-} // namespace cgi
-
-#endif // CGI_CGI_ACCEPTOR_SERVICE_HPP_INCLUDED__
Deleted: sandbox/SOC/2007/cgi/boost/cgi/detail/fcgi_acceptor_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/detail/fcgi_acceptor_service.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,17 +0,0 @@
-#ifndef CGI_FCGI_ACCEPTOR_SERVICE_HPP_INCLUDED__
-#define CGI_FCGI_ACCEPTOR_SERVICE_HPP_INCLUDED__
-
-namespace cgi {
-namespace detail {
-
-  class fcgi_acceptor_service
-  {
-  public:
-
-  private:
-  };
-
-} // namespace detail
-} // namespace cgi
-
-#endif // CGI_FCGI_ACCEPTOR_SERVICE_HPP_INCLUDED__
Modified: sandbox/SOC/2007/cgi/boost/cgi/is_async.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/is_async.hpp	(original)
+++ sandbox/SOC/2007/cgi/boost/cgi/is_async.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
@@ -17,7 +17,7 @@
 
   template<typename Protocol>
   struct is_async
-    : boost::mpl::bool_<true>
+    : boost::mpl::bool_<true>::type
   {
   };
 
Added: sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
@@ -0,0 +1,41 @@
+//              -- acgi_request_impl.hpp --
+//
+//            Copyright (c) Darren Garvey 2007.
+// 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)
+//
+////////////////////////////////////////////////////////////////
+#ifndef CGI_ACGI_REQUEST_IMPL_HPP_INCLUDED__
+#define CGI_ACGI_REQUEST_IMPL_HPP_INCLUDED__
+
+#include "../cgi/cgi_service.hpp"
+#include "cgi_request_impl_base.hpp"
+#include "../connections/async_stdio.hpp"
+
+// Make this ProtocolService-independent
+
+namespace cgi {
+
+  // Forward declaration
+  class acgi_service_impl;
+
+  class acgi_request_impl
+    : public cgi_request_impl_base<acgi_request_impl, async_stdio_connection>
+  {
+  public:
+    typedef cgi_service    protocol_service_type;
+
+    acgi_request_impl()
+      : cgi_request_impl_base<acgi_request_impl, connection_type>()
+    {
+    }
+
+  protected:
+    //acgi_request_impl(); // private default constructor
+    friend class acgi_service_impl;
+  };
+
+} // namespace cgi
+
+#endif // CGI_ASYNC_CGI_REQUEST_IMPL_HPP_INCLUDED__
Deleted: sandbox/SOC/2007/cgi/boost/cgi/request_impl/async_cgi_request_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_impl/async_cgi_request_impl.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,40 +0,0 @@
-//           -- async_cgi_request_impl.hpp --
-//
-//            Copyright (c) Darren Garvey 2007.
-// 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)
-//
-////////////////////////////////////////////////////////////////
-#ifndef CGI_ASYNC_CGI_REQUEST_IMPL_HPP_INCLUDED__
-#define CGI_ASYNC_CGI_REQUEST_IMPL_HPP_INCLUDED__
-
-#include "cgi_service.hpp"
-#include "cgi_request_impl.hpp"
-
-// Make this ProtocolService-independent
-
-namespace cgi {
-
-  class async_cgi_request_impl
-    : public cgi_request_impl
-  {
-  public:
-    typedef cgi_service    protocol_service_type;
-
-    async_cgi_request_impl(protocol_service_type& protocol_service)
-      : cgi_request_impl(protocol_service)
-      , protocol_service_(protocol_service)
-    {
-    }
-
-  protected:
-    async_cgi_request_impl(); // private default constructor
-    friend class async_cgi_service_impl;
-
-    protocol_service_type& protocol_service_;
-  }; 
-
-} // namespace cgi
-
-#endif // CGI_ASYNC_CGI_REQUEST_IMPL_HPP_INCLUDED__
Added: sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
@@ -0,0 +1,108 @@
+//             -- cgi_request_impl_base.hpp --
+//
+//            Copyright (c) Darren Garvey 2007.
+// 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)
+//
+////////////////////////////////////////////////////////////////
+#ifndef CGI_CGI_REQUEST_IMPL_BASE_HPP_INCLUDED__
+#define CGI_CGI_REQUEST_IMPL_BASE_HPP_INCLUDED__
+
+#include <map>
+#include <string>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "../http/status_code.hpp"
+#include "../connections/stdio.hpp"
+#include "../role_type.hpp"
+#include "../status_type.hpp"
+#include "../map.hpp"
+//#include
+
+// Make this ProtocolService-independent
+
+namespace cgi {
+
+  //Forward declaration
+  template<typename T>
+  class cgi_service_impl_base;
+
+
+  /// Implementation for a standard CGI request
+  /**
+   * 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.
+   */
+  template<typename RequestImpl, typename Connection>
+  class cgi_request_impl_base
+  {
+  public:
+    typedef ::cgi::map                         map_type;
+    typedef Connection                         connection_type;
+    typedef boost::shared_ptr<connection_type> conn_ptr;
+
+    /// Constructor
+    cgi_request_impl_base()
+      : stdin_parsed_(false)
+      , http_status_(http::ok)
+      , request_status_(unloaded)
+      , connection_()
+    {
+    }
+
+  protected:
+    friend class cgi_service_impl_base<RequestImpl>;
+
+    map_type get_vars_;
+    map_type post_vars_;
+    map_type cookie_vars_;
+
+    bool stdin_parsed_;
+
+    http::status_code http_status_;
+    status_type request_status_;
+
+    conn_ptr connection_;
+
+    std::string null_str_;
+  };
+
+  //template<> inline const std::string&
+  //cgi_request_impl::var<tags::ENV>(const std::string& name)
+  //{
+  //  return ::getenv(name.c_str());
+  //}
+
+  /// Get a request map of all the environment meta-variables (slow)
+  /**
+   * -- NOT IMPLEMENTED FOR NOW --
+   *
+   * In the case of a CGI request, the environment meta-data is usually stored
+   * in the process environment, which means there is no direct access to all
+   * of them as a map_type&. In other words, this function call will have to
+   * load all of the variables into memory and then return the map
+   */
+  //template<> inline cgi_request_impl::map_type&
+  //cgi_request_impl::var<tags::ENV>()
+  //{
+  //  throw std::logic_error("Can't get all environment vars as a map_type&");
+  //}
+
+  //template<> inline cgi_request_impl::map_type&
+  //cgi_request_impl::var<tags::HTTP>() { return http_map_; }
+
+  //template<> inline cgi_request_impl::map_type&
+  //cgi_request_impl::var<tags::COOKIE>() { return cookie_map_; }
+
+  //template<> inline cgi_request_impl::map_type&
+  //cgi_request_impl::var<tags::GET>() { return get_map_; }
+
+  //template<> inline cgi_request_impl::map_type&
+  //cgi_request_impl::var<tags::POST>() { return post_map_; }
+
+} // namespace cgi
+
+#endif // CGI_CGI_REQUEST_IMPL_BASE_HPP_INCLUDED__
Deleted: sandbox/SOC/2007/cgi/boost/cgi/request_role.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_role.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,27 +0,0 @@
-//                   -- role_type.hpp --
-//
-//            Copyright (c) Darren Garvey 2007.
-// 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)
-//
-////////////////////////////////////////////////////////////////
-#ifndef CGI_ROLE_TYPE_HPP_INCLUDED__
-#define CGI_ROLE_TYPE_HPP_INCLUDED__
-
-namespace cgi {
-
-  /// The 'role' of the request
-  /**
-   * See the section on 'role types' in the Design notes for more information.
-   * @code responder @endcode is by far the most common type.
-   */
-  enum role_type { responder
-                 , authorizer
-                 , filter
-                 , undefined = responder // CGI programs default to responder
-  };
-
-} // namespace cgi
-
-#endif // CGI_ROLE_TYPE_HPP_INCLUDED__
Deleted: sandbox/SOC/2007/cgi/boost/cgi/request_type.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_type.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,14 +0,0 @@
-#ifndef CGI_REQUEST_TYPE_HPP_INCLUDED__
-#define CGI_REQUEST_TYPE_HPP_INCLUDED__
-
-namespace cgi {
-
-  enum request_type
-  { responder
-  , authorizer
-  , filter
-  };
-
-} // namespace cgi
-
-#endif // CGI_REQUEST_TYPE_HPP_INCLUDED__
Added: sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
@@ -0,0 +1,67 @@
+//               -- acgi_service_impl.hpp --
+//
+//            Copyright (c) Darren Garvey 2007.
+// 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)
+//
+////////////////////////////////////////////////////////////////
+#ifndef CGI_ACGI_SERVICE_IMPL_HPP_INCLUDED__
+#define CGI_ACGI_SERVICE_IMPL_HPP_INCLUDED__
+
+#include <boost/asio/io_service.hpp>
+#include "../tags.hpp"
+#include "../io_service.hpp"
+#include "../map.hpp"
+#include "../request_impl/acgi_request_impl.hpp"
+#include "cgi_service_impl_base.hpp"
+#include "../detail/service_base.hpp"
+#include "../io_service.hpp"
+#include "../detail/extract_params.hpp"
+
+namespace cgi {
+
+  //template<typename ProtocolService>
+  class acgi_service_impl
+  //: public boost::asio::io_service::service
+    : public cgi_service_impl_base<acgi_request_impl>
+    , public detail::service_base<acgi_service_impl>
+  {
+  public:
+    typedef acgi_service_impl           type;
+    typedef acgi_request_impl           impl_type;
+    typedef cgi::map                    map_type;
+    typedef tags::acgi                  protocol_type;
+    typedef cgi_service                 protocol_service_type;
+
+    /// The unique service identifier
+    //    static boost::asio::io_service::id id;
+
+    acgi_service_impl(cgi::io_service& ios)
+      : detail::service_base<acgi_service_impl>(ios)
+    {
+    }
+
+    acgi_service_impl(protocol_service_type& protocol_service)
+    //: boost::asio::io_service::service(protocol_service.io_service())
+      : detail::service_base<acgi_service_impl>(protocol_service.io_service())
+    //  , cgi_service_impl_base<acgi_request_impl>()
+    {
+    }
+
+    void shutdown_service()
+    {
+    }
+
+    void construct(implementation_type& impl)
+    {
+    }
+
+    void destroy(implementation_type& impl)
+    {
+    }
+  };
+
+} // namespace cgi
+
+#endif // CGI_ASYNC_CGI_SERVICE_IMPL_HPP_INCLUDED__
Deleted: sandbox/SOC/2007/cgi/boost/cgi/service_impl/async_cgi_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/service_impl/async_cgi_service_impl.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
+++ (empty file)
@@ -1,96 +0,0 @@
-//           -- async_cgi_service_impl.hpp --
-//
-//            Copyright (c) Darren Garvey 2007.
-// 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)
-//
-////////////////////////////////////////////////////////////////
-#ifndef CGI_ASYNC_CGI_SERVICE_IMPL_HPP_INCLUDED__
-#define CGI_ASYNC_CGI_SERVICE_IMPL_HPP_INCLUDED__
-
-#include "../request_impl/async_cgi_request_impl.hpp"
-#include "cgi_service_impl.hpp"
-
-namespace cgi {
-
-  class async_cgi_service_impl
-    : public boost::asio::io_service::service
-    , public cgi_service_impl_base<async_cgi_request_impl>
-  {
-  public:
-    typedef tags::async_cgi                         protocol_type;
-    typedef typename protocol_type::service_type    protocol_service_type;
-
-    /// The unique service identifier
-    static boost::asio::io_service::id id;
-
-    explicit async_cgi_service_impl(protocol_service_type& protocol_service)
-      : boost::asio::io_service::service(protocol_service.io_service())
-      , cgi_service_impl<async_cgi_request_impl>()
-    {
-    }
-
-    void shutdown_service()
-    {
-    }
-
-    /// Construct a new cgi request implementation
-    void construct(impl_type& impl)
-    {
-    }
-
-    template<typename ImplType, typename Handler>
-    class load_handler
-    {
-    public:
-      load_handler(impl_type& impl, bool parse_stdin, Handler handler)
-	      : impl_(impl)
-	      , service_(impl.service_)
-	      , work_(service.io_service())
-	      , parse_stdin_(parse_stdin)
-	      , handler_(handler)
-      {
-      }
-
-      void operator()()
-      {
-        boost::system::error_code ec
-          = cgi_service_impl::load(impl_, ec, handler_);
-
-	      service_.post(boost::bind(&Handler, handler_, ec));
-      }
-    private:
-      protocol_service_type& service_;
-      protocol_service_type::work work_;
-      Handler handler_;
-      ImplType impl_;
-    };
-
-    /// Asynchronously read/parse the request meta-data
-    /**
-     * @param parse_stdin if true then STDIN data is also read/parsed
-     */
-    template<typename Handler>
-    void async_load(impl_type& impl, bool parse_stdin, Handler handler)
-    {
-      impl.service_.post(boost::bind(&load_handler<impl_type, Handler>
-                                       (impl, parse_stdin, handler)));
-    }
-
-    template<typename MutableBufferSequence, typename Handler>
-    void async_read_some(impl_type& impl, const MutableBufferSequence& buf
-                        , Handler handler)
-    {
-      impl.connection_->async_read_some(buf, handler);
-    }
-
-    template<typename ConstBufferSequence, typename Handler>
-    void async_write_some(impl_type& impl, const ConstBufferSequence& buf
-                         , Handler handler)
-    {
-      impl.connection_->async_write_some(buf, handler);
-    }
-  };
-
-#endif // CGI_ASYNC_CGI_SERVICE_IMPL_HPP_INCLUDED__
Added: sandbox/SOC/2007/cgi/boost/cgi/status_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/status_type.hpp	2007-07-20 04:26:11 EDT (Fri, 20 Jul 2007)
@@ -0,0 +1,25 @@
+//                  -- status_type.hpp --
+//
+//            Copyright (c) Darren Garvey 2007.
+// 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)
+//
+////////////////////////////////////////////////////////////////
+#ifndef CGI_STATUS_TYPE_HPP_INCLUDED__
+#define CGI_STATUS_TYPE_HPP_INCLUDED__
+
+namespace cgi {
+
+  enum status_type
+    { null
+    , unloaded
+    , loaded
+    , ok
+    , aborted
+    , ended
+    };
+
+} // namespace cgi
+
+#endif // CGI_STATUS_TYPE_HPP_INCLUDED__