Boost logo

Boost-Commit :

From: lists.drrngrvy_at_[hidden]
Date: 2008-03-28 18:15:17


Author: drrngrvy
Date: 2008-03-28 18:15:16 EDT (Fri, 28 Mar 2008)
New Revision: 43919
URL: http://svn.boost.org/trac/boost/changeset/43919

Log:
Merged revisions 43775-43779,43781-43782,43784-43786,43789-43790,43792-43812,43814-43918 via svnmerge from
https://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk

........
  r43819 | drrngrvy | 2008-03-24 14:00:15 +0000 (Mon, 24 Mar 2008) | 1 line
  
  Removing SCGI examples (which haven't been tested)
........
  r43869 | drrngrvy | 2008-03-26 16:12:38 +0000 (Wed, 26 Mar 2008) | 1 line
  
  Minor fix to project-root.jam
........
  r43912 | drrngrvy | 2008-03-28 16:35:17 +0000 (Fri, 28 Mar 2008) | 1 line
  
  Adding basic FastCGI server example.
........
  r43917 | drrngrvy | 2008-03-28 22:01:04 +0000 (Fri, 28 Mar 2008) | 1 line
  
  Adding slightly more async FastCGI server example.
........
  r43918 | drrngrvy | 2008-03-28 22:10:40 +0000 (Fri, 28 Mar 2008) | 1 line
  
  Tiny addition moving towards an async_load function.
........

Added:
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/fcgi/server1/
      - copied from r43918, /sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/server1/
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/fcgi/server1/Jamfile.v2
      - copied unchanged from r43918, /sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/server1/Jamfile.v2
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/fcgi/server1/main.cpp
      - copied unchanged from r43918, /sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/server1/main.cpp
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/fcgi/server2/
      - copied from r43918, /sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/server2/
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/fcgi/server2/Jamfile.v2
      - copied unchanged from r43918, /sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/server2/Jamfile.v2
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/fcgi/server2/main.cpp
      - copied unchanged from r43918, /sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/server2/main.cpp
Removed:
   sandbox/SOC/2007/cgi/branches/release/libs/cgi/example/scgi/
Properties modified:
   sandbox/SOC/2007/cgi/branches/release/ (props changed)
Text files modified:
   sandbox/SOC/2007/cgi/branches/release/boost/cgi/basic_request.hpp | 13 +++++++------
   sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/acceptor_service_impl.hpp | 25 +------------------------
   sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/request_service.hpp | 40 +++++++++++++++++++++++++++++++++++++++-
   sandbox/SOC/2007/cgi/branches/release/boost/cgi/io_service_provider.hpp | 4 ++--
   sandbox/SOC/2007/cgi/branches/release/project-root.jam | 21 ++++++++++-----------
   5 files changed, 59 insertions(+), 44 deletions(-)

Modified: sandbox/SOC/2007/cgi/branches/release/boost/cgi/basic_request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/release/boost/cgi/basic_request.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/release/boost/cgi/basic_request.hpp 2008-03-28 18:15:16 EDT (Fri, 28 Mar 2008)
@@ -188,16 +188,17 @@
     }
 
 
+ // **FIXME**
     /// Asynchronously read/parse the request meta-data
     /**
      * Note: 'loading' including reading/parsing STDIN if parse_stdin == true
      */
- template<typename Handler>
- void async_load(Handler handler, bool parse_stdin = false)
- {
- this->service.async_load(this->implementation, parse_stdin
- , handler);
- }
+ //template<typename Handler>
+ //void async_load(Handler handler, bool parse_stdin = false)
+ //{
+ // this->service.async_load(this->implementation, parse_stdin
+ // , handler);
+ //}
 
     /// Notify the server the request has finished being handled
     /**

Modified: sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/acceptor_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/acceptor_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/acceptor_service_impl.hpp 2008-03-28 18:15:16 EDT (Fri, 28 Mar 2008)
@@ -34,7 +34,7 @@
    namespace detail {
 
      /// Helper functions for async_accept operation.
- template<typename T, /*typename Request, */typename Handler>
+ template<typename T, typename Handler>
      struct accept_handler
      {
        accept_handler(T& t, typename T::implementation_type& impl
@@ -297,17 +297,6 @@
        this->io_service().post(
          detail::accept_handler<type, Handler>(*this, impl, request, handler)
        );
- //boost::system::error_code ec;
- //handler(ec);
- //acceptor_service_.async_accept(impl.acceptor_, request.client().connection()->next_layer_type()
-
-/*
- &acceptor_service_impl<protocol_type>
- ::typename check_for_waiting_request<
- CommonGatewayRequest
- , Handler>,
- this, boost::ref(impl), boost::ref(request), handler));
-*/
      }
 
      /// Close the acceptor (not implemented yet).
@@ -329,18 +318,6 @@
                                    , CommonGatewayRequest& request
                                    , Handler handler)
      {
- /*
- {
- boost::mutex::scoped_lock lk(impl.mutex_);
- if (!impl.waiting_requests_.empty())
- {
- request = *(impl.waiting_requests_.front());
- impl.waiting_requests_.pop();
- return handler(ec); // this could be `io_service::post`ed again
- }
- }
- */
-
        // We can't call accept on an open request (close it first).
        if (request.is_open())
          return handler(error::accepting_on_an_open_request);

Modified: sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/request_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/request_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/release/boost/cgi/fcgi/request_service.hpp 2008-03-28 18:15:16 EDT (Fri, 28 Mar 2008)
@@ -24,8 +24,37 @@
 #include "boost/cgi/fcgi/client.hpp"
 
 namespace cgi {
- namespace fcgi {
 
+ namespace detail {
+
+ template<typename T, typename Handler>
+ struct async_load_helper
+ {
+ async_load_helper(T& t, typename T::implementation_type& impl
+ , bool parse_stdin, Handler h)
+ : type(t)
+ , impl_(impl)
+ , parse_stdin_(parse_stdin)
+ , handler_(h)
+ {
+ }
+
+ void operator()()
+ {
+ boost::system::error_code ec;
+ type.load(impl_, parse_stdin_, ec);
+ handler_(ec);
+ }
+
+ T& type;
+ typename T::implementation_type& impl_;
+ bool parse_stdin_;
+ Handler handler_;
+ };
+ }
+
+ namespace fcgi {
+
   /// The IoObjectService class for a FCGI basic_request<>s
   class fcgi_request_service
     : public detail::service_base<fcgi_request_service>
@@ -276,6 +305,15 @@
       return ec;
     }
 
+ // **FIXME**
+ template<typename Handler>
+ void async_load(implementation_type& impl, bool parse_stdin, Handler handler)
+ {
+ this->io_service().post(
+ detail::async_load_helper<type, Handler>(this, parse_stdin, handler)
+ );
+ }
+
     /* These Don't Belong Here.
     template<typename MutableBufferSequence>
     std::size_t read_some(implementation_type& impl

Modified: sandbox/SOC/2007/cgi/branches/release/boost/cgi/io_service_provider.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/release/boost/cgi/io_service_provider.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/release/boost/cgi/io_service_provider.hpp 2008-03-28 18:15:16 EDT (Fri, 28 Mar 2008)
@@ -58,7 +58,7 @@
     {
     }
 
- ::cgi::io_service&
+ ::cgi::common::io_service&
       get_io_service()
     {
       return io_service_;
@@ -79,7 +79,7 @@
       io_service_.reset();
     }
   private:
- ::cgi::io_service io_service_;
+ ::cgi::common::io_service io_service_;
   };
 
 

Modified: sandbox/SOC/2007/cgi/branches/release/project-root.jam
==============================================================================
--- sandbox/SOC/2007/cgi/branches/release/project-root.jam (original)
+++ sandbox/SOC/2007/cgi/branches/release/project-root.jam 2008-03-28 18:15:16 EDT (Fri, 28 Mar 2008)
@@ -1,11 +1,8 @@
 import os ;
 import modules ;
 
-path-constant BOOST_ROOT : [ os.environ BOOST_ROOT ] ;
 path-constant BOOST_BUILD_PATH : [ os.environ BOOST_BUILD_PATH ] ;
 
-path-constant PROJECT_ROOT : . ;
-
 path-constant top : . ;
 path-constant include-dir : /usr/local/include ;
 path-constant boost-root : [ os.environ BOOST_ROOT ] ;
@@ -27,27 +24,30 @@
 #
 # Note that the command line will override the environment variable!
 #############################################################################
-local rule get-bin-dir ( bin-name : envvar )
+local rule get-bin-dir ( protocol )
 {
- local bin-dir = [ MATCH "^--$(bin-name)=(.*)" : [ modules.peek : ARGV ] ] ;
+ local bin-dir = [ MATCH "^--$(protocol:L)-bin=(.*)" : [ modules.peek : ARGV ] ] ;
   if $(bin-dir)
   {
     return $(bin-dir) ;
   }
   else
   {
- bin-dir = [ os.environ $(envvar) ] ;
+ bin-dir = [ os.environ "BOOST_$(protocol:U)_BIN_PATH" ] ;
     if $(bin-dir)
     {
       return $(bin-dir) ;
     }
- return $(top)/$(bin-name) ;
+ else
+ {
+ return $(top)/$(protocol:L)"-bin" ;
+ }
   }
 }
 
-path-constant cgi-bin : [ get-bin-dir "cgi-bin" : "BOOST_CGI_BIN_PATH" ] ;
-path-constant fcgi-bin : [ get-bin-dir "fcgi-bin" : "BOOST_FCGI_BIN_PATH" ] ;
-path-constant scgi-bin : [ get-bin-dir "scgi-bin" : "BOOST_SCGI_BIN_PATH" ] ;
+path-constant cgi-bin : [ get-bin-dir "cgi" ] ;
+path-constant fcgi-bin : [ get-bin-dir "fcgi" ] ;
+path-constant scgi-bin : [ get-bin-dir "scgi" ] ;
 
 
 use-project /boost/ : $(boost-root) ;
@@ -60,7 +60,6 @@
   : requirements
       <include>$(boost-root)
       <include>$(top)
- #<include>C:\cc\src\ctemplate\windows
       <define>_CRT_SECURE_NO_WARNINGS
       <define>_SCL_SECURE_NO_WARNINGS
   ;


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