Boost logo

Boost-Commit :

From: drrngrvy_at_[hidden]
Date: 2007-07-24 14:44:06


Author: drrngrvy
Date: 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
New Revision: 7524
URL: http://svn.boost.org/trac/boost/changeset/7524

Log:
Added some tests; reimplemented use of asio's basic_io_object (only difference is implementation_type -> impl_type : WILL FIX); added basic_sync_io_object so a cgi request doesn't need to be loaded with an io_serivce (Note: this should only be used as an upgrade path: acgi_request uses an io_service and has many advantages)

Added:
   sandbox/SOC/2007/cgi/boost/cgi/basic_sync_io_object.hpp
   sandbox/SOC/2007/cgi/boost/cgi/detail/pop_options.hpp
   sandbox/SOC/2007/cgi/boost/cgi/detail/push_options.hpp
   sandbox/SOC/2007/cgi/libs/cgi/example/
   sandbox/SOC/2007/cgi/libs/cgi/example/acgi/
   sandbox/SOC/2007/cgi/libs/cgi/example/acgi/Jamfile.v2
   sandbox/SOC/2007/cgi/libs/cgi/example/acgi/main.cpp
   sandbox/SOC/2007/cgi/libs/cgi/example/cgi/
   sandbox/SOC/2007/cgi/libs/cgi/example/cgi/..ignore/
   sandbox/SOC/2007/cgi/libs/cgi/example/cgi/Jamfile.v2
   sandbox/SOC/2007/cgi/libs/cgi/example/cgi/main.cpp
   sandbox/SOC/2007/cgi/libs/cgi/util/
   sandbox/SOC/2007/cgi/libs/cgi/util/system/
   sandbox/SOC/2007/cgi/libs/cgi/util/system/Jamfile.v2
Text files modified:
   sandbox/SOC/2007/cgi/boost/cgi/basic_io_object.hpp | 12 ++++
   sandbox/SOC/2007/cgi/boost/cgi/basic_request.hpp | 93 +++++++++++++++++++++++++++------------
   sandbox/SOC/2007/cgi/boost/cgi/basic_request_acceptor.hpp | 8 ++
   sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp | 2
   sandbox/SOC/2007/cgi/boost/cgi/connections/async_stdio.hpp | 5 ++
   sandbox/SOC/2007/cgi/boost/cgi/connections/stdio.hpp | 27 ++++++++++-
   sandbox/SOC/2007/cgi/boost/cgi/connections/tcp_socket.hpp | 4 +
   sandbox/SOC/2007/cgi/boost/cgi/data_sink.hpp | 12 ++++
   sandbox/SOC/2007/cgi/boost/cgi/data_source.hpp | 6 ++
   sandbox/SOC/2007/cgi/boost/cgi/detail/common_headers.hpp | 12 ++--
   sandbox/SOC/2007/cgi/boost/cgi/detail/extract_params.hpp | 2
   sandbox/SOC/2007/cgi/boost/cgi/detail/url_decode.hpp | 6 +-
   sandbox/SOC/2007/cgi/boost/cgi/io_service_provider.hpp | 4 +
   sandbox/SOC/2007/cgi/boost/cgi/reply.hpp | 4 +
   sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp | 5 +
   sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp | 4 +
   sandbox/SOC/2007/cgi/boost/cgi/request_ostream.hpp | 94 +++++++++++++++++++++------------------
   sandbox/SOC/2007/cgi/boost/cgi/request_service.hpp | 35 ++++++++++++++
   sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp | 10 ++++
   sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl.hpp | 10 ++++
   sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl_base.hpp | 48 ++++++++++---------
   sandbox/SOC/2007/cgi/libs/cgi/test/Jamfile.v2 | 5 +
   sandbox/SOC/2007/cgi/libs/cgi/test/compile/tcp_connection.cpp | 2
   23 files changed, 287 insertions(+), 123 deletions(-)

Modified: sandbox/SOC/2007/cgi/boost/cgi/basic_io_object.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/basic_io_object.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/basic_io_object.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -14,12 +14,18 @@
 
 namespace cgi {
 
- template<typename Service, bool UseIoService = true>
+ template<typename Service>
   class basic_io_object
     : private boost::noncopyable
   {
   public:
     typedef Service service_type;
+
+ cgi::io_service& io_service()
+ {
+ return service.io_service();
+ }
+
   private:
     typedef typename Service::impl_type impl_type;
 
@@ -39,8 +45,9 @@
     service_type& service;
   };
 
+ /*
   template<typename Service>
- class basic_io_object<Service, false>
+ class basic_io_object<Service, false>
     : private boost::noncopyable
   {
   public:
@@ -61,6 +68,7 @@
     impl_type impl;
     service_type service;
   };
+ */
 
 } // namespace cgi
 

Modified: sandbox/SOC/2007/cgi/boost/cgi/basic_request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/basic_request.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/basic_request.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -9,30 +9,35 @@
 #ifndef CGI_BASIC_REQUEST_HPP_INCLUDED__
 #define CGI_BASIC_REQUEST_HPP_INCLUDED__
 
+#include "detail/push_options.hpp"
+
 #include <iostream>
 #include <boost/noncopyable.hpp>
+#include <boost/mpl/if.hpp>
 #include <boost/assert.hpp>
 #include <boost/system/error_code.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/basic_io_object.hpp>
 
 #include "detail/throw_error.hpp"
 #include "detail/protocol_traits.hpp"
 #include "request_base.hpp"
 #include "role_type.hpp"
-#include "data_source.hpp"
 #include "data_sink.hpp"
 #include "status_type.hpp"
 #include "is_async.hpp"
-#include "basic_io_object.hpp"
 #include "connection_base.hpp"
 #include "http/status_code.hpp"
 #include "request_service.hpp"
 #include "basic_protocol_service_fwd.hpp"
 #include "basic_request_fwd.hpp"
+#include "basic_sync_io_object.hpp"
+#include "basic_io_object.hpp"
 
 namespace cgi {
 
+ //using boost::asio::basic_io_object;
   /*
   enum status_type
     { ok
@@ -72,7 +77,10 @@
           , typename Allocator>
   class basic_request
     : public request_base
- , public basic_io_object<Service, is_async<Protocol>::value>
+ , public boost::mpl::if_c<is_async<Protocol>::value
+ , basic_io_object<Service>
+ , basic_sync_io_object<Service>
+ >::type
   {
   public:
     typedef basic_request<Protocol, Service, Role
@@ -89,7 +97,7 @@
 
     // Throws
     basic_request(bool load_now = true, bool parse_post = true)
- : basic_io_object<Service, false>()
+ : basic_sync_io_object<Service>()
     {
       if (load_now) load(parse_post);//this->service.load(this->impl, true, ec);
     }
@@ -97,14 +105,14 @@
     basic_request(boost::system::error_code& ec
                  , const bool load_now = true
                  , const bool parse_post = true)
- : basic_io_object<Service, false>()
+ : basic_sync_io_object<Service>()
     {
       if (load_now) load(ec, parse_post);//this->service.load(this->impl, true, ec);
     }
       
     basic_request(protocol_service_type& s, const bool load_now = false
                  , const bool parse_post = false)
- : basic_io_object<Service, true>(s.io_service())
+ : basic_io_object<Service>(s.io_service())
     {
       if (load_now) load(parse_post);//this->service.load(this->impl, false, ec);
     }
@@ -112,7 +120,7 @@
     basic_request(protocol_service_type& s
                  , boost::system::error_code& ec
                  , const bool load_now = false, const bool parse_post = false)
- : basic_io_object<Service, true>(s.io_service())
+ : basic_io_object<Service>(s.io_service())
     {
       if(load_now) load(ec, parse_post);//this->service.load(this->impl, false, ec);
     }
@@ -172,11 +180,7 @@
       //BOOST_ASSERT( request_status_ != status_type::ended );
 
       this->service.set_status(this->impl, http_status);
- //http_status_ = http_status;
- //program_status_ = program_status;
       this->service.end(this->impl, http_status);
- //io_service_.dispatch(set_status(status_type::ended));
- //this->impl.end_request(this, status_code);
     }
 
     void close(int http_status, int program_status)
@@ -191,10 +195,21 @@
       this->service.end(this->impl, http::internal_server_error);
     }
 
+ void set_source(cgi::sink dest = reply)
+ {
+ boost::system::error_code ec;
+ this->service(this->impl, dest, ec);
+ detail::throw_error(ec);
+ }
+
+ void set_source(cgi::sink dest, boost::system::error_code& ec)
+ {
+ this->service(this->impl, dest, ec);
+ }
+
     /// Read some data from the request
- template<typename MutableBufferSequence, typename Source>
- std::size_t read_some(const MutableBufferSequence& buf
- , Source source = data_source::stdin())
+ template<typename MutableBufferSequence/*, typename Source*/>
+ std::size_t read_some(const MutableBufferSequence& buf)
     {
       boost::system::error_code ec;
       std::size_t s = this->service.read_some(this->impl, buf, ec);
@@ -202,17 +217,15 @@
       return s;
     }
 
- template<typename MutableBufferSequence, typename Source>
+ template<typename MutableBufferSequence/*, typename Source*/>
     std::size_t read_some(const MutableBufferSequence& buf
- , boost::system::error_code& ec
- , Source source = data_source::stdin())
+ , boost::system::error_code& ec)
     {
       return this->service.read_some(this->impl, buf, ec);
     }
 
- template<typename ConstBufferSequence, typename Sink>
- std::size_t write_some(const ConstBufferSequence& buf
- , Sink dest = data_sink::stdout())
+ template<typename ConstBufferSequence/*, typename Sink*/>
+ std::size_t write_some(const ConstBufferSequence& buf)
     {
       boost::system::error_code ec;
       std::size_t s = this->service.write_some(this->impl, buf, ec);
@@ -220,10 +233,9 @@
       return s;
     }
 
- template<typename ConstBufferSequence, typename Sink>
+ template<typename ConstBufferSequence/*, typename Sink*/>
     std::size_t write_some(const ConstBufferSequence& buf
- , boost::system::error_code& ec
- , Sink dest = data_sink::stdout())
+ , boost::system::error_code& ec)
     {
       return this->service.write_some(this->impl, buf, ec);
     }
@@ -244,9 +256,16 @@
 **/
 
     /// Find the get meta-variable matching name
- std::string meta_get(const std::string& name) const
+ std::string meta_get(const std::string& name)
     {
- return this->service.meta_get(this->impl, name);
+ boost::system::error_code ec;
+ return this->service.meta_get(this->impl, name, ec);
+ detail::throw_error(ec);
+ }
+
+ std::string meta_get(const std::string& name, boost::system::error_code& ec)
+ {
+ return this->service.meta_get(this->impl, name, ec);
     }
 
     /// Find the post meta-variable matching name
@@ -257,17 +276,25 @@
      */
     std::string meta_post(const std::string& name, bool greedy = true)
     {
- return this->service.meta_post(this->impl, name, greedy);
+ boost::system::error_code ec;
+ return this->service.meta_post(this->impl, name, ec, greedy);
+ detail::throw_error(ec);
+ }
+
+ std::string meta_post(const std::string& name, boost::system::error_code& ec
+ , bool greedy = true)
+ {
+ return this->service.meta_post(this->impl, name, ec, greedy);
     }
 
     /// Find the cookie meta-variable matching name
- std::string meta_cookie(const std::string& name) const
+ std::string meta_cookie(const std::string& name)
     {
       return this->service.meta_cookie(this->impl, name);
     }
 
     /// Find the environment meta-variable matching name
- std::string meta_env(const std::string& name) const
+ std::string meta_env(const std::string& name)
     {
       return this->service.meta_env(this->impl, name);
     }
@@ -286,7 +313,7 @@
      * provide a meta_var_all() function which is greedy; the
      * ugly/long name there to discourage use.
      */
- std::string meta_var(const std::string& name, bool greedy = false) const
+ std::string meta_var(const std::string& name, bool greedy = false)
     {
       return this->service.meta_var(this->impl, name, greedy);
       std::string request_method( meta_env("REQUEST_METHOD") );
@@ -413,6 +440,12 @@
       return this->service.is_open(this->impl);
     }
 
+ /// Set a user cookie
+ void set_cookie(const std::string& name, const std::string& value)
+ {
+ return this->service.set_cookie(this->impl, name, value);
+ }
+
   private:
     //connection_ptr conn_;
     //service_type& service;
@@ -501,6 +534,8 @@
 
 } // namespace cgi
 
+#include "detail/pop_options.hpp"
+
 #endif // CGI_BASIC_REQUEST_HPP_INCLUDED__
 
 /*

Modified: sandbox/SOC/2007/cgi/boost/cgi/basic_request_acceptor.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/basic_request_acceptor.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/basic_request_acceptor.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -9,14 +9,18 @@
 #ifndef CGI_BASIC_REQUEST_ACCEPTOR_HPP_INCLUDED__
 #define CGI_BASIC_REQUEST_ACCEPTOR_HPP_INCLUDED__
 
-#include <boost/system.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/system/error_code.hpp>
+
+#include "basic_io_object.hpp"
+#include "is_async.hpp"
 
 namespace cgi {
 
   template<typename RequestAcceptorService>
   class basic_request_acceptor
     : private boost::noncopyable
- , public boost::asio::basic_io_object<RequestAcceptorService>
+ , public basic_io_object<RequestAcceptorService, is_async<RequestAcceptorService::protocol_type>::value>
   {
   public:
     // typedef impl_type;

Added: sandbox/SOC/2007/cgi/boost/cgi/basic_sync_io_object.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/basic_sync_io_object.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,42 @@
+// -- basic_sync_io_object.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_BASIC_SYNC_IO_OBJECT_HPP_INCLUDED__
+#define CGI_BASIC_SYNC_IO_OBJECT_HPP_INCLUDED__
+
+#include <boost/noncopyable.hpp>
+
+namespace cgi {
+
+ /// basic_io_object alternative when an io_service isn't used
+ template<typename Service>
+ class basic_sync_io_object
+ : private boost::noncopyable
+ {
+ public:
+ typedef Service service_type;
+ typedef typename Service::impl_type impl_type;
+
+ protected:
+ explicit basic_sync_io_object()
+ {
+ service.construct(impl);
+ }
+
+ ~basic_sync_io_object()
+ {
+ service.destroy(impl);
+ }
+
+ service_type service;
+ impl_type impl;
+ };
+
+} // namespace cgi
+
+#endif // CGI_BASIC_SYNC_IO_OBJECT_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -1,4 +1,4 @@
-// -- cgi.hpp --
+// -- cgi/cgi.hpp --
 //
 // Copyright (c) Darren Garvey 2007.
 // Distributed under the Boost Software License, Version 1.0.

Modified: sandbox/SOC/2007/cgi/boost/cgi/connections/async_stdio.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/connections/async_stdio.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/connections/async_stdio.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -36,6 +36,11 @@
     {
     }
 
+ static pointer create(cgi::io_service& ios)
+ {
+ return pointer(new basic_connection<tags::async_stdio>(ios));
+ }
+
     template<typename ConnectionPtr, typename MutableBufferSequence
             , typename Handler>
     class read_handler

Modified: sandbox/SOC/2007/cgi/boost/cgi/connections/stdio.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/connections/stdio.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/connections/stdio.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -12,11 +12,14 @@
 #include <iostream>
 #include <istream>
 #include <ostream>
+#include <string>
 #include <boost/system/error_code.hpp>
+#include <boost/asio.hpp>
 
 #include "../basic_connection_fwd.hpp"
 #include "../tags.hpp"
 #include "../connection_base.hpp"
+#include "../data_sink.hpp"
 //#include "../io_service.hpp"
 
 namespace cgi {
@@ -26,6 +29,8 @@
     : public connection_base
   {
   public:
+ typedef boost::shared_ptr<basic_connection<tags::stdio> > pointer;
+
     basic_connection()
       : in_(std::cin)
       , out_(std::cout)
@@ -41,12 +46,18 @@
     {
     }
 
+ static pointer create()
+ {
+ return pointer(new basic_connection<tags::stdio>());
+ }
+
     template<typename MutableBufferSequence>
     std::size_t read_some(MutableBufferSequence buf
- , boost::system::error_code& ec)
+ , boost::system::error_code& ec
+ , cgi::sink origin)
     {
       if( buf.data() != in_.rdbuf() )
- return in_.read(buf.data(), buf.size());
+ return in_.read(buf.begin(), buf.size());
       return buf.size();
     }
 
@@ -54,7 +65,17 @@
     std::size_t write_some(ConstBufferSequence& buf
                           , boost::system::error_code& ec)
     {
- return out_.write(buf.data(), buf.size());
+ std::size_t bytes_transferred(0);
+ for(typename ConstBufferSequence::const_iterator i = buf.begin()
+ ; i != buf.end(); ++i)
+ {
+ std::size_t buf_len = boost::asio::buffer_size(*i);
+ std::string s(boost::asio::buffer_cast<const char*>(*i)
+ , buf_len);
+ bytes_transferred += buf_len;
+ out_.write(s.c_str(), buf_len);
+ }
+ return bytes_transferred;
     }
 
   protected:

Modified: sandbox/SOC/2007/cgi/boost/cgi/connections/tcp_socket.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/connections/tcp_socket.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/connections/tcp_socket.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -9,6 +9,8 @@
 #ifndef CGI_TCP_CONNECTION_HPP_INCLUDED__
 #define CGI_TCP_CONNECTION_HPP_INCLUDED__
 
+#include "../detail/push_options.hpp"
+
 #include "../basic_connection.hpp"
 #include "../connection_base.hpp"
 #include "../tags.hpp"
@@ -79,4 +81,6 @@
 
 } // namespace cgi
 
+#include "../detail/pop_options.hpp"
+
 #endif // CGI_TCP_CONNECTION_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/data_sink.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/data_sink.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/data_sink.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -10,10 +10,18 @@
 #define CGI_DATA_SINK_HPP_INCLUDED__
 
 namespace cgi {
+
+ enum sink
+ { stdout_
+ , stderr_
+ , reply
+ , log
+ , reply_log = reply | log };
+
  namespace data_sink {
 
- struct stdout {};
- struct stderr {};
+ //struct stdout_ {};
+ //struct stderr_ {};
 
  } // namespace data_sink
 } // namespace cgi

Modified: sandbox/SOC/2007/cgi/boost/cgi/data_source.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/data_source.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/data_source.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -10,9 +10,13 @@
 #define CGI_DATA_SOURCE_HPP_INCLUDED__
 
 namespace cgi {
+
+ enum source
+ { stdin_ };
+
  namespace data_source {
 
- struct stdin {};
+ //struct stdin_ {};
 
  } // namespace data_source
 } // namespace cgi

Modified: sandbox/SOC/2007/cgi/boost/cgi/detail/common_headers.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/detail/common_headers.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/detail/common_headers.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -6,8 +6,8 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 ////////////////////////////////////////////////////////////////
-#ifndef CGI_CGI_HPP_INCLUDED__
-#define CGI_CGI_HPP_INCLUDED__
+#ifndef CGI_CGI_CGI_HPP_INCLUDED__
+#define CGI_CGI_CGI_HPP_INCLUDED__
 
 // #include all protocol-independent headers only. Protocol-specific
 // headers can just include this after other headers.
@@ -17,10 +17,10 @@
 #include "../io_service.hpp"
 #include "../streambuf.hpp"
 #include "../basic_request.hpp"
-#include "../basic_request_acceptor.hpp"
-#include "../reply.hpp"
-#include "../logger.hpp"
+//#include "../basic_request_acceptor.hpp"
+//#include "../reply.hpp"
+//#include "../logger.hpp"
 #include "../read.hpp"
 #include "../write.hpp"
 
-#endif // CGI_CGI_HPP_INCLUDED__
+#endif // CGI_CGI_CGI_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/detail/extract_params.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/detail/extract_params.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/detail/extract_params.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -25,7 +25,7 @@
                                             , boost::system::error_code& ec)
    {
      if( input.empty() )
- return ec = boost::system::error_code(34, boost::system::errno_ecat);
+ return ec;// = boost::system::error_code(34, boost::system::errno_ecat);
      
          typedef typename boost::tokenizer<Separator> tokenizer;
      

Added: sandbox/SOC/2007/cgi/boost/cgi/detail/pop_options.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/detail/pop_options.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,15 @@
+// -- detail/push_options.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)
+//
+////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+
+//#pragma warning (disable:)
+//#undef _CRT_SECURE_NO_DEPRECATE
+
+#endif

Added: sandbox/SOC/2007/cgi/boost/cgi/detail/push_options.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/boost/cgi/detail/push_options.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,16 @@
+// -- detail/push_options.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)
+//
+////////////////////////////////////////////////////////////////
+
+#ifdef _MSC_VER
+
+//#pragma warning (disable:)
+#define _CRT_SECURE_NO_DEPRECATE 1
+#pragma warning (disable:4996)
+
+#endif

Modified: sandbox/SOC/2007/cgi/boost/cgi/detail/url_decode.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/detail/url_decode.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/detail/url_decode.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -33,10 +33,10 @@
    /// URL-decode a string
    std::string url_decode( const std::string& str )
    {
- std::string ret;
+ std::string ret;
 
- for( unsigned int i=0; i < str.size(); i++ )
- {
+ for( unsigned int i=0; i < str.size(); i++ )
+ {
            switch( str[i] )
        {
          case ' ':

Modified: sandbox/SOC/2007/cgi/boost/cgi/io_service_provider.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/io_service_provider.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/io_service_provider.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -10,6 +10,8 @@
 #define CGI_IO_SERVICE_PROVIDER_HPP_INCLUDED__
 
 
+#include "detail/push_options.hpp"
+
 #include <boost/ref.hpp>
 #include <boost/bind.hpp>
 #include <boost/thread.hpp>
@@ -210,4 +212,6 @@
 
 } // namespace cgi
 
+#include "detail/pop_options.hpp"
+
 #endif // CGI_IO_SERVICE_PROVIDER_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/reply.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/reply.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/reply.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -9,6 +9,8 @@
 #ifndef CGI_REPLY_HPP_INCLUDED__
 #define CGI_REPLY_HPP_INCLUDED__
 
+#include "detail/push_options.hpp"
+
 #include <ostream>
 
 #include "request_ostream.hpp"
@@ -63,4 +65,6 @@
 
 } // namespace cgi
 
+#include "detail/pop_options.hpp"
+
 #endif // CGI_REPLY_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/request_impl/acgi_request_impl.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -14,6 +14,10 @@
 #include "../connections/async_stdio.hpp"
 
 // Make this ProtocolService-independent
+/*
+ * Should the request_impl extract an io_service from the protocol_service
+ * on construction, so that
+ */
 
 namespace cgi {
 
@@ -32,7 +36,6 @@
     }
 
   protected:
- //acgi_request_impl(); // private default constructor
     friend class acgi_service_impl;
   };
 

Modified: sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/request_impl/cgi_request_impl_base.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -49,11 +49,13 @@
       : stdin_parsed_(false)
       , http_status_(http::ok)
       , request_status_(unloaded)
- , connection_()
+ // , connection_(new )
     {
     }
 
   protected:
+ conn_ptr connection() { return connection_; }
+
     friend class cgi_service_impl_base<RequestImpl>;
 
     map_type get_vars_;

Modified: sandbox/SOC/2007/cgi/boost/cgi/request_ostream.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_ostream.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/request_ostream.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -30,6 +30,8 @@
 that.
 *********************************/
 
+#include "detail/push_options.hpp"
+
 #include <ostream>
 //#include <streambuf>
 #include <boost/assert.hpp>
@@ -43,6 +45,7 @@
 #include "tags.hpp"
 #include "data_sink.hpp"
 #include "request_base.hpp"
+#include "basic_request.hpp"
 #include "http/status_code.hpp"
 //#include "detail/take_buffer.hpp"
 
@@ -68,9 +71,9 @@
   {
   public:
     /// Default constructor
- explicit request_ostream(http::status_code sc = http::ok)
- : request_(NULL)
- , buffer_(new cgi::streambuf())
+ request_ostream(http::status_code sc = http::ok)
+ : /*request_(NULL)
+ , */buffer_(new cgi::streambuf())
       , ostream_(buffer_.get())
       , http_status_(sc)
 // , destination_(destination)
@@ -82,9 +85,9 @@
      * Takes the buffer and uses it internally, does nothing with it on
      * destruction.
      */
- request_ostream(cgi::streambuf* buf, http::status_code sc = http::ok)
- : request_(NULL)
- , ostream_(buf)
+ request_ostream(std::streambuf* buf, http::status_code sc = http::ok)
+ : /*request_(NULL)
+ , */ostream_(buf)
       , http_status_(sc)
 // , destination_(destination)
     {
@@ -98,19 +101,19 @@
      * CommonGatewayRequest) to use internally.
      * </strike>
      */
- template<typename CommonGatewayRequest>
- request_ostream(CommonGatewayRequest& req, http::status_code sc = http::ok)
- : request_(&req)
- , buffer_(new cgi::streambuf())
- , ostream_(buffer_.get()) //detail::take_buffer(req))
- , http_status_(sc)
-// , destination_(destination)
- {
- }
+// template<typename CommonGatewayRequest>
+// request_ostream(CommonGatewayRequest& req, http::status_code sc = http::ok)
+// : request_(&req)
+// , buffer_(new cgi::streambuf())
+// , ostream_(buffer_.get()) //detail::take_buffer(req))
+// , http_status_(sc)
+//// , destination_(destination)
+// {
+// }
 
     ~request_ostream()
     {
- if (request_) send();
+ //if (request_) send();
     }
 
     void clear()
@@ -141,11 +144,11 @@
     /**
      * If there is no error, the buffer is cleared.
      */
- void flush()
- {
- BOOST_ASSERT(request_ != NULL);
- flush(*request_);
- }
+ //void flush()
+ //{
+ // BOOST_ASSERT(request_ != NULL);
+ // flush(*request_);
+ //}
 
     /// Synchronously flush the data to the supplied request
     /**
@@ -156,7 +159,7 @@
     template<typename CommonGatewayRequest>
     void flush(CommonGatewayRequest& req)
     {
- cgi::write(req, *ostream_.rdbuf());
+ cgi::write(req, cgi::buffer(*ostream_.rdbuf()));
       // the above function will throw on an error
       clear();
     }
@@ -218,12 +221,12 @@
      * twice without an arguement (unless you add another request - something
      * not possible yet).
      */
- void send()
- {
- BOOST_ASSERT(request_ != NULL);
- send(*request_);
- request_ = NULL;
- }
+ //void send()
+ //{
+ // BOOST_ASSERT(request_ != NULL);
+ // send(*request_);
+ // request_ = NULL;
+ //}
 
     /// Synchronously send the reply to the default request
     /**
@@ -232,13 +235,13 @@
      * can't be called twice without an arguement (unless you add another
      * request - something not possible yet).
      */
- boost::system::error_code& send(boost::system::error_code& ec)
- {
- BOOST_ASSERT(request_ != NULL);
- if(!send(*request_, ec))
- request_ = NULL;
- return ec;
- }
+ //boost::system::error_code& send(boost::system::error_code& ec)
+ //{
+ // BOOST_ASSERT(request_ != NULL);
+ // if(!send(*request_, ec))
+ // request_ = NULL;
+ // return ec;
+ //}
 
     /// Synchronously send the data via the supplied request
     /**
@@ -249,7 +252,7 @@
     template<typename CommonGatewayRequest>
     void send(CommonGatewayRequest& req)
     {
- cgi::write(req, *ostream_.rdbuf(), data_sink::stdout());
+ cgi::write(req, *ostream_.rdbuf(), stdout_);
       req.set_status(http_status_);
     }
 
@@ -279,21 +282,22 @@
     }
 
     /// Get the buffer associated with the stream
- boost::shared_ptr<cgi::streambuf> rdbuf() const
+ cgi::streambuf* rdbuf() const
     {
- return ostream_.rdbuf();
+ return static_cast<cgi::streambuf*>(ostream_.rdbuf());
     }
 
     void set_status(http::status_code& num) { http_status_ = num; }
- http::status_code& get_status() const
+
+ http::status_code& get_status()
     {
       return http_status_;
     }
 
- request_base* request() const
- {
- return request_;
- }
+ //request_base* request() const
+ //{
+ // return request_;
+ //}
 
 // int destination() const
 // {
@@ -302,7 +306,7 @@
 
   private:
     /// The request associated with the ostream; can be NULL
- request_base* request_;
+ //request_base* request_;
 
     boost::shared_ptr<cgi::streambuf> buffer_;
     std::ostream ostream_;
@@ -325,4 +329,6 @@
 
 } // namespace cgi
 
+#include "detail/pop_options.hpp"
+
 #endif // CGI_REQUEST_OSTREAM_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/request_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/request_service.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/request_service.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -9,6 +9,8 @@
 #ifndef CGI_REQUEST_SERVICE_HPP_INCLUDED
 #define CGI_REQUEST_SERVICE_HPP_INCLUDED
 
+#include "detail/push_options.hpp"
+
 #include <boost/utility/enable_if.hpp>
 
 //#include "is_async.hpp"
@@ -54,7 +56,7 @@
     //{
     //}
 
- request_service(io_service& ios)
+ request_service(cgi::io_service& ios)
       : detail::service_base<request_service<Protocol> >(ios)
       //: boost::asio::io_service::service(ps.io_service())
       , service_impl_(boost::asio::use_service<service_impl_type>(ios))
@@ -109,6 +111,35 @@
       return service_impl_.is_open(impl);
     }
 
+ template<typename ConstBufferSequence>
+ std::size_t write_some(impl_type& impl, const ConstBufferSequence& buf)
+ {
+ boost::system::error_code ec;
+ return service_impl_.write_some(impl, buf, ec);
+ detail::throw_error(ec);
+ }
+
+ template<typename ConstBufferSequence>
+ std::size_t write_some(impl_type& impl, const ConstBufferSequence& buf
+ , boost::system::error_code& ec)
+ {
+ return service_impl_.write_some(impl, buf, ec);
+ }
+
+ template<typename MutableBufferSequence>
+ std::size_t read_some(impl_type& impl, MutableBufferSequence buf)
+ {
+ boost::system::error_code ec;
+ return service_impl_.read_some(impl, buf, ec);
+ detail::throw_error(ec);
+ }
+
+ template<typename MutableBufferSequence>
+ std::size_t read_some(impl_type& impl, MutableBufferSequence buf
+ , boost::system::error_code& ec)
+ {
+ return service_impl_.read_some(impl, buf, ec);
+ }
   private:
     //typename boost::mpl::if_<typename is_async<protocol_type>::value
     // , boost::add_reference<service_impl_type>
@@ -118,4 +149,6 @@
 
 } // namespace cgi
 
+#include "detail/pop_options.hpp"
+
 #endif // CGI_REQUEST_SERVICE_HPP_INCLUDED

Modified: sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/service_impl/acgi_service_impl.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -18,6 +18,7 @@
 #include "../detail/service_base.hpp"
 #include "../io_service.hpp"
 #include "../detail/extract_params.hpp"
+#include "../connections/async_stdio.hpp"
 
 namespace cgi {
 
@@ -52,6 +53,15 @@
     void shutdown_service()
     {
     }
+ void construct(implementation_type& impl)
+ {
+ impl.connection_ = async_stdio_connection::create(io_service());
+ }
+
+ void destroy(implementation_type& impl)
+ {
+ }
+
   };
 
 } // namespace cgi

Modified: sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -21,6 +21,7 @@
 #include "cgi_service_impl_base.hpp"
 #include "../detail/extract_params.hpp"
 #include "../request_impl/cgi_request_impl.hpp"
+#include "../connections/stdio.hpp"
 
 namespace cgi {
 
@@ -45,6 +46,15 @@
       : cgi_service_impl_base<cgi_request_impl>()
     {
     }
+
+ void construct(implementation_type& impl)
+ {
+ impl.connection_ = stdio_connection::create();
+ }
+
+ void destroy(implementation_type& impl)
+ {
+ }
   };
 
 } // namespace cgi

Modified: sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl_base.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl_base.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/service_impl/cgi_service_impl_base.hpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -1,8 +1,11 @@
 #ifndef CGI_CGI_SERVICE_IMPL_BASE_HPP_INCLUDED__
 #define CGI_CGI_SERVICE_IMPL_BASE_HPP_INCLUDED__
 
+#include "../detail/push_options.hpp"
+
 #include <string>
 #include <cstdlib>
+#include <iostream>
 #include <boost/assert.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/system/error_code.hpp>
@@ -10,6 +13,7 @@
 #include "../map.hpp"
 #include "../role_type.hpp"
 #include "../detail/extract_params.hpp"
+//#include "../connections/stdio.hpp"
 
 namespace cgi {
 
@@ -18,6 +22,9 @@
 
  } // namespace detail
 
+ using std::cerr;
+ using std::endl;
+
 
   template<typename RequestImplType>
   class cgi_service_impl_base
@@ -35,14 +42,6 @@
     {
     }
 
- void construct(implementation_type& impl)
- {
- }
-
- void destroy(implementation_type& impl)
- {
- }
-
     /// Synchronously read/parse the request meta-data
     /**
      * @param parse_stdin if true then STDIN data is also read/parsed
@@ -51,7 +50,7 @@
     load(implementation_type& impl, bool parse_stdin
         , boost::system::error_code& ec)
     {
- std::string request_method = meta_get(impl, "REQUEST_METHOD", ec);
+ const std::string& request_method = meta_env(impl, "REQUEST_METHOD", ec);
       if (request_method == "GET")
         if (parse_get_vars(impl, ec))
               return ec;
@@ -64,25 +63,25 @@
       return ec;
     }
 
- template<typename ConnectionPtr, typename MutableBufferSequence>
+ template<typename MutableBufferSequence>
     std::size_t read_some(implementation_type& impl, const MutableBufferSequence& buf
                          , boost::system::error_code& ec)
     {
- std::size_t s = impl.connection_->read_some(buf, ec);
+ std::size_t s = impl.connection()->read_some(buf, ec);
       return s;
     }
 
- template<typename ConnectionPtr, typename ConstBufferSequence>
+ template<typename ConstBufferSequence>
     std::size_t write_some(implementation_type& impl, const ConstBufferSequence& buf
                           , boost::system::error_code& ec)
     {
- return impl.connection_->write_some(buf, ec);
+ return impl.connection()->write_some(buf, ec);
     }
 
     //template<typename VarType> map_type& var(implementation_type&) const;
 
     std::string var(map_type& meta_data, const std::string& name
- , boost::system::error_code& ec) const
+ , boost::system::error_code& ec)
     {
       /* Alt:
       if ((typename map_type::iterator pos = meta_data.find(name))
@@ -99,12 +98,12 @@
     }
 
         std::string meta_get(implementation_type& impl, const std::string& name
- , boost::system::error_code& ec) const
+ , boost::system::error_code& ec)
     {
       return var(impl.get_vars_, name, ec);
     }
 
- map_type& meta_get(implementation_type& impl) const
+ map_type& meta_get(implementation_type& impl)
     {
       return impl.get_vars_;
     }
@@ -134,7 +133,7 @@
       return val;
     }
 
- map_type& meta_post(implementation_type& impl) const
+ map_type& meta_post(implementation_type& impl)
     {
       return impl.post_vars_;
     }
@@ -142,12 +141,12 @@
 
     /// Find the cookie meta-variable matching name
     std::string meta_cookie(implementation_type& impl, const std::string& name
- , boost::system::error_code& ec) const
+ , boost::system::error_code& ec)
     {
       return var(impl.cookie_vars_, name, ec);
     }
 
- map_type& meta_cookie(implementation_type& impl) const
+ map_type& meta_cookie(implementation_type& impl)
     {
       return impl.cookie_vars_;
     }
@@ -157,11 +156,12 @@
     std::string meta_env(implementation_type& impl, const std::string& name
                         , boost::system::error_code& ec)
     {
- return ::getenv(name.c_str());
+ const char* c = ::getenv(name.c_str());
+ return c ? c : impl.null_str_;
     }
 
 
- role_type get_role(implementation_type& impl) const
+ role_type get_role(implementation_type& impl)
     {
       return responder;
     }
@@ -187,7 +187,7 @@
     parse_cookie_vars(RequestImpl& impl, boost::system::error_code& ec)
     {
       // Make sure this function hasn't already been called
- BOOST_ASSERT( impl.cookie_vars_.empty() );
+ //BOOST_ASSERT( impl.cookie_vars_.empty() );
 
       std::string vars = meta_env(impl, "HTTP_COOKIE", ec);
       if (vars.empty())
@@ -208,7 +208,7 @@
     parse_post_vars(RequestImpl& impl, boost::system::error_code& ec)
     {
       // Make sure this function hasn't already been called
- BOOST_ASSERT( impl.cookie_vars_.empty() );
+ //BOOST_ASSERT( impl.post_vars_.empty() );
           
       //# error "Not implemented"
 
@@ -231,4 +231,6 @@
 
 } // namespace cgi
 
+#include "../detail/pop_options.hpp"
+
 #endif // CGI_CGI_SERVICE_IMPL_HPP_INCLUDED__

Added: sandbox/SOC/2007/cgi/libs/cgi/example/acgi/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/libs/cgi/example/acgi/Jamfile.v2 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,30 @@
+# 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)
+
+import os ;
+
+
+local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
+
+project boost/cgi/examples/acgi
+# : build-dir ../bin.v2
+ ;
+
+SOURCES = main ;
+
+exe acgi
+ :
+ $(SOURCES).cpp
+ :
+ <include>$(BOOST_ROOT)
+ <include>"../../../../"
+ <library>../../util/system//boost_system
+ <define>BOOST_ALL_NO_LIB=1
+ <toolset>gcc:<linkflags>-lpthread
+ ;
+
+#install
+# :
\ No newline at end of file

Added: sandbox/SOC/2007/cgi/libs/cgi/example/acgi/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/libs/cgi/example/acgi/main.cpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,12 @@
+#include <boost/cgi/acgi.hpp>
+
+int main()
+{
+ cgi::cgi_service service;
+ cgi::acgi_request req(service);
+
+ std::string buf("Content-type:text/html\r\n\r\nHello there, Universe.");
+ cgi::write(req, cgi::buffer(buf.c_str(), buf.size()));
+
+ return 0;
+}

Added: sandbox/SOC/2007/cgi/libs/cgi/example/cgi/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/libs/cgi/example/cgi/Jamfile.v2 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,29 @@
+# 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)
+
+import os ;
+
+
+local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
+
+project boost/cgi/examples/cgi
+# : build-dir ../bin.v2
+ ;
+
+
+exe cgi
+ :
+ main.cpp
+ :
+ <include>$(BOOST_ROOT)
+ <include>"../../../../"
+ <library>../../util/system//boost_system
+ <define>BOOST_ALL_NO_LIB=1
+ <toolset>gcc:<linkflags>-lpthread
+ ;
+
+#install
+# :
\ No newline at end of file

Added: sandbox/SOC/2007/cgi/libs/cgi/example/cgi/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/libs/cgi/example/cgi/main.cpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,22 @@
+#include <string>
+#include <boost/system/error_code.hpp>
+#include "../../../../boost/cgi/cgi.hpp"
+
+int main()
+{
+ try{
+ cgi::cgi_request req;
+
+ std::string buf("Content-type: text/html\r\n\r\nHello there, universe!");
+ boost::system::error_code ec;
+
+ req.write_some(cgi::buffer(buf.c_str(), buf.size()), ec);
+
+ buf = req.meta_get("blah");
+ req.write_some(cgi::buffer(buf.c_str(), buf.size()), ec);
+
+ } catch( boost::system::error_code& ec ) {
+ std::cerr<< "error: " << ec.message() << std::endl;
+}
+ return 0;
+}

Modified: sandbox/SOC/2007/cgi/libs/cgi/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/cgi/libs/cgi/test/Jamfile.v2 (original)
+++ sandbox/SOC/2007/cgi/libs/cgi/test/Jamfile.v2 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -7,7 +7,7 @@
     [ compile compile/async_stdio_connection.cpp ]
     [ compile compile/tcp_connection.cpp ]
     [ compile compile/cgi_service.cpp ]
-# [ compile compile/fcgi_service.cpp ]
+# [ compile compile/fcgi_service.cpp ]
     [ compile compile/is_async_test.cpp ]
     [ compile compile/cgi_request.cpp ]
     [ compile compile/acgi_request.cpp ]
@@ -16,7 +16,8 @@
 
     [ compile compile/cgi_header_check.cpp ]
 
-# [ run run/stdio_connection.cpp ]
+# [ run run/stdio_connection.cpp ]
+# [ run run/cgi_request.cpp ]
   :
     <include>$(BOOST_ROOT)
     <include>"../../../"

Modified: sandbox/SOC/2007/cgi/libs/cgi/test/compile/tcp_connection.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/libs/cgi/test/compile/tcp_connection.cpp (original)
+++ sandbox/SOC/2007/cgi/libs/cgi/test/compile/tcp_connection.cpp 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -1,4 +1,4 @@
-#include "boost/cgi/connections/tcp.hpp"
+#include "boost/cgi/connections/tcp_socket.hpp"
 
 int main()
 {

Added: sandbox/SOC/2007/cgi/libs/cgi/util/system/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/libs/cgi/util/system/Jamfile.v2 2007-07-24 14:44:03 EDT (Tue, 24 Jul 2007)
@@ -0,0 +1,6 @@
+
+
+lib boost_system
+ :
+ : <file>/usr/local/lib/libboost_system-gcc41.a
+ ;


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