Boost logo

Boost-Commit :

From: lists.drrngrvy_at_[hidden]
Date: 2007-11-17 12:50:29


Author: drrngrvy
Date: 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
New Revision: 41171
URL: http://svn.boost.org/trac/boost/changeset/41171

Log:
Disorganised commit, but makes the previous revision slightly less so.
Added:
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/hello_world/
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/hello_world/Jamfile.v2
      - copied, changed from r40946, /sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/Jamfile.v2
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_acceptor.cpp (contents, props changed)
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_request.cpp (contents, props changed)
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_service.cpp (contents, props changed)
Removed:
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/Jamfile.v2
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/basic-1.cpp
Text files modified:
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_client.hpp | 10 ++++
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_protocol_service.hpp | 1
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request.hpp | 3
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request_acceptor.hpp | 10 +++-
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/request.hpp | 3 +
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/service.hpp | 2
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/async_stdio.hpp | 10 ++++
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/shareable_tcp_socket.hpp | 15 ++++--
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/stdio.hpp | 13 +++++
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/tcp_socket.hpp | 16 ++++--
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/detail/protocol_traits.hpp | 6 ++
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/header.hpp | 91 ++++++++++++++++++++++++++++++++-------
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/response.hpp | 76 +++++++++++++++++++++++++++------
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/acceptor_service_impl.hpp | 1
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_acceptor_service.hpp | 9 +++
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_service.hpp | 27 ++++++++++-
   sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/service.hpp | 2
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/hello_world/Jamfile.v2 | 18 ++++---
   sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/Jamfile.v2 | 19 +++++++
   sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam | 3 +
   20 files changed, 274 insertions(+), 61 deletions(-)

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_client.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_client.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_client.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -55,6 +55,16 @@
     {
     }
 
+ bool is_open()
+ {
+ return connection_->is_open();
+ }
+
+ void close()
+ {
+ connection_->close();
+ }
+
     //io_service& io_service() { return io_service_; }
 
     /// Associate a connection with this client

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_protocol_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_protocol_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_protocol_service.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -19,6 +19,7 @@
 #include "boost/cgi/io_service_provider.hpp"
 #include "boost/cgi/basic_request_fwd.hpp"
 #include "boost/cgi/detail/protocol_traits.hpp"
+#include "boost/cgi/basic_protocol_service_fwd.hpp"
 
 namespace cgi {
 

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -196,7 +196,8 @@
      *
      * @returns The value of program_status
      */
- int close(http::status_code http_status, int program_status)
+ int close(http::status_code http_status = http::ok
+ , int program_status = 0)
     {
       //BOOST_ASSERT( request_status_ != status_type::ended );
 

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request_acceptor.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request_acceptor.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/basic_request_acceptor.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -29,13 +29,17 @@
     typedef typename service_type::protocol_type protocol_type;
     typedef int port_number_type;
 
- explicit basic_request_acceptor(basic_protocol_service<protocol_type>& ps)
+ 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, s);
+ this->service.set_protocol_service(this->implementation, ps);
     }
 
- explicit basic_request_acceptor(basic_protocol_service<protocol_type>& ps
+ template<typename IoServiceProvider>
+ explicit basic_request_acceptor(basic_protocol_service<
+ protocol_type, IoServiceProvider>& ps
                                    , port_number_type port_num)
       : boost::asio::basic_io_object<RequestAcceptorService>(ps.io_service())
     {

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/request.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/request.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -22,6 +22,9 @@
 
   typedef basic_request<cgi_request_service, cgi_service> cgi_request;
 
+ namespace cgi {
+ typedef cgi_request request;
+ } // namespace cgi
 } // namespace cgi
 
 #endif // CGI_CGI_REQUEST_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/cgi/service.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -13,8 +13,6 @@
 #include "boost/cgi/connections/stdio.hpp"
 #include "boost/cgi/connections/async_stdio.hpp"
 #include "boost/cgi/basic_protocol_service_fwd.hpp"
-#include "boost/cgi/gateway_impl/acgi_gateway_impl.hpp"
-#include "boost/cgi/gateway_service/acgi_gateway_service.hpp"
 
 namespace cgi {
 

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/async_stdio.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/async_stdio.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/async_stdio.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -36,6 +36,16 @@
     {
     }
 
+ bool is_open() const
+ {
+ return is_open_;
+ }
+
+ void close()
+ {
+ is_open_ = false;
+ }
+
     static pointer create(::cgi::io_service& ios)
     {
       return pointer(new basic_connection<tags::async_stdio>(ios));

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/shareable_tcp_socket.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/shareable_tcp_socket.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/shareable_tcp_socket.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -39,6 +39,16 @@
     {
     }
 
+ bool is_open() const
+ {
+ return sock_.is_open();
+ }
+
+ void close()
+ {
+ sock_.close();
+ }
+
     static pointer create(io_service& ios)
     {
       return static_cast<pointer>(
@@ -83,11 +93,6 @@
       sock_.async_write_some(buf, handler);
     }
 
- void close()
- {
- sock_.close();
- }
-
     mutex_type& mutex() { return mutex_; }
     condtion_type& condition() { return condition_; }
   private:

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/stdio.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/stdio.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/stdio.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -34,6 +34,7 @@
     basic_connection()
       : in_(std::cin)
       , out_(std::cout)
+ , is_open_(true)
     {
     }
 
@@ -41,9 +42,20 @@
     basic_connection(T&)
       : in_(std::cin)
       , out_(std::cout)
+ , is_open_(true)
     {
     }
 
+ bool is_open() const
+ {
+ return is_open_;
+ }
+
+ void close()
+ {
+ is_open_ = false;
+ }
+
     static pointer create()
     {
       return pointer(new basic_connection<tags::stdio>());
@@ -78,6 +90,7 @@
   protected:
     std::istream& in_;
     std::ostream& out_;
+ bool is_open_;
   };
 
   typedef basic_connection<tags::stdio> stdio_connection;

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/tcp_socket.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/tcp_socket.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/connections/tcp_socket.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -32,6 +32,16 @@
     {
     }
 
+ bool is_open() const
+ {
+ return sock_.is_open();
+ }
+
+ void close()
+ {
+ sock_.close();
+ }
+
     static pointer create(io_service& ios)
     {
       return static_cast<pointer>(new basic_connection<tags::tcp_socket>(ios));
@@ -74,12 +84,6 @@
     {
       sock_.async_write_some(buf, handler);
     }
-
- void close()
- {
- sock_.close();
- }
-
   private:
     boost::asio::ip::tcp::socket sock_;
   };

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/detail/protocol_traits.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/detail/protocol_traits.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/detail/protocol_traits.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -144,6 +144,12 @@
       //typedef scgi_gateway_service gateway_service_type;
     };
 
+ template<>
+ struct protocol_traits<::cgi::scgi_>
+ : protocol_traits<tags::scgi>
+ {
+ };
+
  } // namespace detail
 } // namespace cgi
 

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/header.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/header.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/header.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -13,47 +13,104 @@
 
 namespace cgi {
 
- struct header
+ template<typename StringT = std::string>
+ struct basic_header
   {
- header()
+ typedef StringT string_type;
+
+ basic_header()
       : content()
     {
     }
 
- /*
+
     /// Templated constructor to allow user-defined types to be converted
- template<typename T>
- header(T& t)
- : content(t.to_string())
- {
- }
- */
+ //template<typename T>
+ //basic_header(T& t)
+ // : content(t.to_string())
+ //{
+ //}
+
 
     //template<>
- header(const std::string& _content)
+ basic_header(const string_type& _content)
       : content(_content)
     {
     }
 
- header(const std::string& name, const std::string& val)
+ basic_header(const string_type& name, const string_type& val)
       : content(name + ": " + val)
     {
     }
 
- std::string content;
+ //basic_header(const std::string& name, const std::string& val)
+ // : content(name + ": " + val)
+ //{
+ //}
+
+ /// Construct an header from a cookie.
+ template<typename T>
+ basic_header(const basic_cookie<T>& ck)
+ : content("Set-cookie: " + ck.to_string())
+ {
+ }
+
+ string_type content;
   };
 
- // Some shortcuts, to cut down on errors
- header content_type(const std::string& str)
+/*
+ template<typename StringT>
+ basic_header<StringT>
+ make_header(const StringT& name, const StringT& val)
   {
- return header("Content-type", str);
+ return basic_header<StringT>(name, val);
+ }*/
+
+ template<typename T, typename StringT>
+ T make_header(const StringT& name, const StringT& val)
+ {
+ return basic_header<StringT>(name, val);
   }
 
- header location(const std::string& url)
+
+ //{ Some shortcuts, to cut down on typing errors.
+ template<typename StringT>
+ basic_header<StringT>
+ content_type(StringT& str)
   {
- return header("Location", url);
+ return basic_header<StringT>("Content-type", str);
   }
 
+ template<typename StringT>
+ basic_header<StringT>
+ content_encoding(StringT& str)
+ {
+ return basic_header<StringT>("Content-encoding", str);
+ }
+/*
+ template<typename StringT>
+ basic_header<StringT>
+ location(const StringT& url)
+ {
+ return basic_header<StringT>("Location", url);
+ }
+
+ basic_header<std::string>
+ location(const std::string& url)
+ {
+ return basic_header<std::string>("Location", url);
+ }*/
+ template<typename T>
+ T location(const std::string& url)
+ {
+ return make_header("Location", url);
+ }
+ //}
+
+ // typedefs for typical usage
+ typedef basic_header<std::string> header;
+ typedef basic_header<std::wstring> wheader;
+
 } // namespace cgi
 
 #endif // CGI_HEADER_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/response.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/response.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/response.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -18,6 +18,9 @@
 #include "boost/cgi/buffer.hpp"
 #include "boost/cgi/cookie.hpp"
 #include "boost/cgi/header.hpp"
+#include "boost/cgi/basic_request_fwd.hpp"
+#include "boost/cgi/http/status_code.hpp"
+#include "boost/cgi/streambuf.hpp"
 #include <boost/foreach.hpp>
 
 /// This mess outputs a default Content-type header if the user hasn't set any.
@@ -238,11 +241,21 @@
      * This call uses error_code semantics. ie. ec is set if an error occurs.
      * Note: The data in the stream isn't cleared after this call.
      */
- template<typename CommonGatewayRequest>
+ /*
+ template<typename T, typename X, enum Y, typename Z>
     boost::system::error_code&
- send(CommonGatewayRequest& req, boost::system::error_code& ec)
+ send(::cgi::basic_request<T, X, Y, Z>& req, boost::system::error_code& ec)
     {
- //BOOST_CGI_ADD_DEFAULT_HEADER
+ send(req.client(), ec);
+ //req.set_status(http_status_);
+ return ec;
+ }
+*/
+ template<typename SyncWriteStream>
+ boost::system::error_code&
+ send(SyncWriteStream& ws, boost::system::error_code& ec)
+ {
+ BOOST_CGI_ADD_DEFAULT_HEADER
 
       // Terminate the headers.
       headers_.push_back("\r\n");
@@ -255,14 +268,12 @@
         headers.push_back(::cgi::buffer(*i));
       }
       //}
- //std::ofstream("test_stuff", std::out);
- //of<< headers_.front();
- ::cgi::write(req.client(), headers
+
+ ::cgi::write(ws, headers
                   , boost::asio::transfer_all(), ec);
       headers_terminated_ = true;
- ::cgi::write(req.client(), rdbuf()->data()
+ ::cgi::write(ws, rdbuf()->data()
                   , boost::asio::transfer_all(), ec);
- req.set_status(http_status_);
 
       //BOOST_FOREACH(headers_.begin(), headers_.end()
       // , headers.push_back(::cgi::buffer(*_1)));
@@ -314,6 +325,12 @@
       headers_terminated_ = false;
     }
 
+ /// Get the length of the body of the response
+ std::size_t content_length()
+ {
+ return rdbuf()->size();
+ }
+
     /// Add a header after appending the CRLF sequence.
     response& set_header(const std::string& value)
     {
@@ -329,6 +346,21 @@
       headers_.push_back(name + ": " + value + "\r\n");
       return *this;
     }
+
+ void clear_headers()
+ {
+ BOOST_ASSERT(!headers_terminated_);
+ headers_.clear();
+ }
+
+ void reset_headers()
+ {
+ headers_.clear();
+ headers_terminated_ = false;
+ }
+ //response& operator<< (response& r1, response& r2)
+ //{
+ // r1.
   protected:
     // Vector of all the headers, each followed by a CRLF
     std::vector<std::string> headers_;
@@ -342,11 +374,14 @@
     // True if no more headers are to be appended.
     bool headers_terminated_;
 
+ //template<typename T>
+ //response& operator<<(const T& t) {
+ // ostream_<< t;
+ // return *this;
+ //}
+
     template<typename T>
     friend response& operator<<(response& resp, const T& t);
-
- //template<typename T>
- //friend response& operator<<(response& resp, T t);
   };
 
   /// Generic ostream template
@@ -372,8 +407,21 @@
    * effects; for instance, it won't write any data to the client.
    * ]
    */
- template<>
- response& operator<<(response& resp, const ::cgi::header& hdr)
+ template<typename T>
+ response& operator<<(response& resp, const ::cgi::basic_header<std::basic_string<T> >& hdr)
+ {
+ if (hdr.content.empty()) {
+ resp.headers_terminated_ = true;
+ return resp;
+ }else{
+ // We shouldn't allow headers to be sent after they're explicitly ended.
+ BOOST_ASSERT(!resp.headers_terminated_);
+ resp.set_header(hdr.content);
+ return resp;
+ }
+ }
+ template<typename StringT>
+ response& operator<<(response& resp, const ::cgi::basic_header<StringT>& hdr)
   {
     if (hdr.content.empty()) {
       resp.headers_terminated_ = true;
@@ -398,7 +446,7 @@
    * library.
    */
   template<typename T>
- response& operator<<(response& resp, basic_cookie<T> ck)
+ response& operator<<(response& resp, typename basic_cookie<T> ck)
   {
     resp.set_header("Set-cookie", ck.to_string());
     return resp;

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/acceptor_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/acceptor_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/acceptor_service_impl.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -15,6 +15,7 @@
 #include <boost/bind.hpp>
 #include <boost/asio.hpp>
 #include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
 #include <boost/utility/enable_if.hpp>
 #include <boost/system/error_code.hpp>
 

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_acceptor_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_acceptor_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_acceptor_service.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -41,13 +41,14 @@
     typedef scgi::acceptor_service_impl<> service_impl_type;
     typedef service_impl_type::implementation_type implementation_type;
     typedef typename implementation_type::protocol_type protocol_type;
- typedef basic_protocol_service<protocol_type> protocol_service_type;
+ //typedef basic_protocol_service<protocol_type> protocol_service_type;
 
     /// The unique service identifier
     //static boost::asio::io_service::id id;
 
     scgi_request_acceptor_service(::cgi::io_service& ios)
       : detail::service_base<request_service<Protocol> >(ios)
+ , service_impl_(ios)
     {
     }
 
@@ -89,6 +90,12 @@
     {
       service_impl_.async_accept(impl, handler);
     }
+
+ template<typename T>
+ void set_protocol_service(implementation_type& impl, T& ps)
+ {
+ impl.service_ = &ps;
+ }
   private:
     service_impl_type service_impl_;
   };

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/request_service.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -37,7 +37,9 @@
       typedef ::cgi::map map_type;
       typedef tcp_connection connection_type;
       typedef ::cgi::scgi_ protocol_type;
- typedef basic_client<connection_type, protocol_type> client_type;
+ typedef basic_client<
+ connection_type, protocol_type
+ > client_type;
 
       implementation_type()
         : client_()
@@ -91,8 +93,27 @@
       //impl.set_state(aborted);
     }
 
- boost::system::error_code& load(implementation_type& impl, bool parse_stdin
- , boost::system::error_code& ec)
+ void shutdown_service()
+ {
+ }
+
+ bool is_open(implementation_type& impl)
+ {
+ return !impl.all_done_ && impl.client_.is_open();
+ }
+
+ /// Close the request.
+ int close(implementation_type& impl, http::status_code& hsc
+ , int program_status)
+ {
+ impl.all_done_ = true;
+ impl.client_.close();
+ return program_status;
+ }
+
+ boost::system::error_code&
+ load(implementation_type& impl, bool parse_stdin
+ , boost::system::error_code& ec)
     {
       //int header_len( get_length_of_header(impl, ec) );
       BOOST_ASSERT(!ec);

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/boost/cgi/scgi/service.hpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -19,7 +19,7 @@
  namespace scgi {
 
    // typedef for standard scgi::service (a model of ProtocolService)
- typedef basic_protocol_service<tags::scgi> service;
+ typedef basic_protocol_service<::cgi::scgi_> service;
 
  }
 } // namespace cgi

Deleted: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/Jamfile.v2 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
+++ (empty file)
@@ -1,19 +0,0 @@
-
-project cgi.examples.server1
- : build-dir
- ../../../../bin.v2
- ;
-
-exe server1
- :
- basic-1.cpp
- :
- <include>$(BOOST_ROOT)
- <include>../../../../
- <library>../../util/system//boost_system
- <define>BOOST_ALL_NO_LIB=1
- <define>_CRT_SECURE_NO_WARNINGS
- <define>_SCL_SECURE_NO_WARNINGS
- ;
-
-

Deleted: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/basic-1.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/basic-1.cpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
+++ (empty file)
@@ -1,53 +0,0 @@
-// -- basic-1.cpp --
-//
-// 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)
-//
-////////////////////////////////////////////////////////////////
-
-#include "boost/cgi/scgi.hpp"
-
-namespace cgi {
- namespace scgi {
-
- class server1
- {
- public:
- //using cgi::scgi;
-
- typedef service protocol_service_type;
-
- server1()
- : service_()
- //, acceptor_()
- {
- }
-
- void run()
- {
- //acceptor_.async_accept(
- service_.run();
- }
-
- void stop()
- {
- service_.stop();
- }
- private:
- protocol_service_type service_;
- //acceptor acceptor_;
- };
-
- } // namespace scgi
-} // namespace cgi
-
-int main()
-{
- cgi::scgi::server1 server;
-
- server.run();
-
- return 0;
-}

Copied: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/hello_world/Jamfile.v2 (from r40946, /sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/Jamfile.v2)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/Jamfile.v2 (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/scgi/hello_world/Jamfile.v2 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -1,19 +1,23 @@
 
-project cgi.examples.server1
+project cgi.examples.hello_world
   : build-dir
- ../../../../bin.v2
+ $(PROJECT_ROOT)/bin.v2
   ;
 
-exe server1
+exe hw
   :
- basic-1.cpp
+ main.cpp
   :
     <include>$(BOOST_ROOT)
- <include>../../../../
- <library>../../util/system//boost_system
- <define>BOOST_ALL_NO_LIB=1
+ <include>$(PROJECT_ROOT)
+ #<library>../../util/system//boost_system
+ #<define>BOOST_ALL_NO_LIB=1
     <define>_CRT_SECURE_NO_WARNINGS
     <define>_SCL_SECURE_NO_WARNINGS
   ;
 
+install hw_i
+ : hw
+ : <location>$(BOOST_CGI_BIN_DIR)
+ ;
 

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/Jamfile.v2 (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/Jamfile.v2 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -2,6 +2,21 @@
 
 import testing ;
 
+test-suite scgi_compile_tests
+ :
+ [ compile scgi_service.cpp ]
+ [ compile scgi_request.cpp ]
+ [ compile scgi_acceptor.cpp ]
+ :
+ <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE=1
+ <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE=1
+ <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE=1
+ <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
+ <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
+ ;
+
+explicit scgi_compile_tests ;
+
 test-suite compile_test_suite
   :
     # connections
@@ -24,7 +39,9 @@
     [ compile cgi_header_check.cpp ]
     [ compile is_async_test.cpp ]
   :
- <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECIATE=1
+ <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE=1
     <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE=1
     <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE=1
   ;
+
+explicit compile_test_suite ;

Added: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_acceptor.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_acceptor.cpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -0,0 +1,10 @@
+#include <boost/cgi/scgi/service.hpp>
+#include <boost/cgi/scgi/acceptor.hpp>
+
+int main()
+{
+ cgi::scgi::service s;
+ cgi::scgi::acceptor a(s);
+
+ return 0;
+}

Added: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_request.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_request.cpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -0,0 +1,10 @@
+#include <boost/cgi/scgi/service.hpp>
+#include <boost/cgi/scgi/request.hpp>
+
+int main()
+{
+ cgi::scgi::service s;
+ cgi::scgi::request r(s);
+
+ return 0;
+}

Added: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_service.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/test/compile/scgi_service.cpp 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -0,0 +1,8 @@
+#include <boost/cgi/scgi/service.hpp>
+
+int main()
+{
+ cgi::scgi::service s;
+
+ return 0;
+}

Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam 2007-11-17 12:50:26 EST (Sat, 17 Nov 2007)
@@ -2,3 +2,6 @@
 
 path-constant BOOST_ROOT : [ os.environ BOOST_ROOT ] ;
 path-constant BOOST_BUILD_PATH : [ os.environ BOOST_BUILD_PATH ] ;
+
+path-constant PROJECT_ROOT : . ;
+path-constant BOOST_CGI_BIN_DIR : c:/Apache/Apache2.2/cgi-bin ;


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