Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51790 - in sandbox/SOC/2007/cgi/branches/pickmeup: boost/cgi boost/cgi/common boost/cgi/detail boost/cgi/fcgi boost/cgi/impl libs/cgi/build/msvc/9.0/Boost.CGI libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game libs/cgi/build/msvc/9.0/Boost.CGI/acgi_echo libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo libs/cgi/build/msvc/9.0/Boost.CGI/cgi_hello_world libs/cgi/build/msvc/9.0/Boost.CGI/fcgi_hello_world libs/cgi/example/acgi/cookie_game2 libs/cgi/example/fcgi/hello_world
From: lists.drrngrvy_at_[hidden]
Date: 2009-03-15 21:35:14


Author: drrngrvy
Date: 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
New Revision: 51790
URL: http://svn.boost.org/trac/boost/changeset/51790

Log:
Minor bug fixes and small bits of documentation.

* Added user-defined session maps to requests (interprocess sessions only, not between processes yet)
* Added macro to clean up defining accessors to request data (ie. operator[])
Binary files modified:
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.ncb
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.suo
Text files modified:
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp | 40 +++++++++--------
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp | 14 ++++++
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp | 9 ++++
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp | 46 ++++++++++++++++----
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp | 2
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/error.hpp | 5 +
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp | 11 ++--
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/error.hpp | 5 +
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp | 82 ++++++++++++++++++++++++-----------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln | 58 +++----------------------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj | 1
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj | 3
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_echo/acgi_echo.vcproj | 2
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj | 1
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_hello_world/cgi_hello_world.vcproj | 2
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/fcgi_hello_world/fcgi_hello_world.vcproj | 8 +++
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp | 29 +++---------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/hello_world/main.cpp | 90 ++++++++++++++++++++++++---------------
   18 files changed, 237 insertions(+), 171 deletions(-)

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -460,29 +460,31 @@
       return env_vars(this->implementation.vars_)[n];
     }
 
+ /// Set up accessor functions for environment variables
+ /**
+ * if you have, eg.
+ *
+ * request req(...);
+ * req[get] -> returns a -> get_map&
+ *
+ * You can use this just like a std::map<>`
+ *
+ * If you want to add a new data type to a request you need to:
+ * > Update this file (just below)
+ * > Update source_enums.hpp
+ * > Update map.hpp with a new map type
+ * > Update `data_map_type` in the `request_base` class
+ */
     /// Get a `common::env_map&` of all the environment variables.
- env_map& operator[](common::env_data_type const&)
- {
- return env_vars(this->implementation.vars_);
- }
-
+ BOOST_CGI_DETAIL_MAP_ACCESS(env)
     /// Get a `common::get_map&` of all the GET variables.
- get_map& operator[](common::get_data_type const&)
- {
- return get_vars(this->implementation.vars_);
- }
-
+ BOOST_CGI_DETAIL_MAP_ACCESS(get)
     /// Get a `common::post_map&` of all the POST variables.
- post_map& operator[](common::post_data_type const&)
- {
- return post_vars(this->implementation.vars_);
- }
-
+ BOOST_CGI_DETAIL_MAP_ACCESS(post)
     /// Get a `common::cookie_map&` of all the cookies.
- cookie_map& operator[](common::cookie_data_type const&)
- {
- return cookie_vars(this->implementation.vars_);
- }
+ BOOST_CGI_DETAIL_MAP_ACCESS(cookie)
+ /// Get a `common::session_map&` of all the session variables.
+ BOOST_CGI_DETAIL_MAP_ACCESS(session)
 
     /// Get a `common::form_map&` of either the GET or POST variables.
     form_map& operator[](common::form_data_type const&)

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -4,16 +4,30 @@
 #include <map>
 #include "boost/cgi/common/name.hpp"
 
+/// You can define your
+#ifndef BOOST_CGI_SESSION_MAP_TYPE
+# define BOOST_CGI_SESSION_MAP_TYPE map
+#endif // BOOST_CGI_SESSION_MAP_TYPE
+
 namespace cgi {
  namespace common {
 
   typedef std::map< ::cgi::common::name, std::string> map;
 
+ /**
+ * If you want to add a new data type to a request you need to:
+ * > Update this file
+ * > Update source_enums.hpp
+ * > Update `data_map_type` in the `request_base` class
+ * > Use the `BOOST_CGI_DETAIL_MAP_ACCESS` macro in `basic_request<>`,
+ * next to the other uses of it.
+ */
   typedef map env_map;
   typedef map get_map;
   typedef map post_map;
   typedef map form_map;
   typedef map cookie_map;
+ typedef map session_map;
 
  } // namespace common
 } // namespace cgi

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/request_base.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -52,9 +52,18 @@
       typedef boost::asio::const_buffers_1 const_buffers_type;
       typedef boost::asio::mutable_buffers_1 mutable_buffers_type;
  
+ /**
+ * If you want to add a new data type to a request you need to:
+ * > Update this file (just below)
+ * > Update source_enums.hpp
+ * > Update map.hpp with a new map type
+ * > Use the `BOOST_CGI_DETAIL_MAP_ACCESS` macro in `basic_request<>`,
+ * next to the other uses of it.
+ */
       typedef boost::fusion::vector<
           common::env_map, common::get_map
         , common::post_map, common::cookie_map
+ , common::session_map
> var_map_type;
 
       var_map_type vars_;

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -9,20 +9,48 @@
 namespace cgi {
  namespace common {
 
- enum env_data_type { env, env_data };
- enum get_data_type { get, get_data };
- enum post_data_type { post, post_data };
- enum cookie_data_type { cookies, cookie_data };
- enum form_data_type { form, form_data };
+ /// Types of data sources and related enums.
+ /**
+ * Each data source is given a unique type. This is so the accessor
+ * operators on a `basic_request<>` are compile-time aliases to the
+ * internal data maps.
+ *
+ * If you want to add a new data type to a request you need to:
+ * > Update this file
+ * > Update map.hpp with a new map type
+ * > Update `data_map_type` in the `request_base` class
+ * > Use the `BOOST_CGI_DETAIL_MAP_ACCESS` macro in `basic_request<>`,
+ * next to the other uses of it.
+ */
+ enum env_data_type { env, env_data };
+ enum get_data_type { get, get_data };
+ enum post_data_type { post, post_data };
+ enum cookie_data_type { cookies, cookie_data };
+ enum form_data_type { form, form_data };
+ enum session_data_type { session, session_data };
 
    template<typename Impl>
- env_map& env_vars(Impl& impl) { return boost::fusion::at_c<0>(impl); }
+ env_map&
+ env_vars(Impl& impl) { return boost::fusion::at_c<0>(impl); }
    template<typename Impl>
- get_map& get_vars(Impl& impl) { return boost::fusion::at_c<1>(impl); }
+ get_map&
+ get_vars(Impl& impl) { return boost::fusion::at_c<1>(impl); }
    template<typename Impl>
- post_map& post_vars(Impl& impl) { return boost::fusion::at_c<2>(impl); }
+ post_map&
+ post_vars(Impl& impl) { return boost::fusion::at_c<2>(impl); }
    template<typename Impl>
- cookie_map& cookie_vars(Impl& impl) { return boost::fusion::at_c<3>(impl); }
+ cookie_map&
+ cookie_vars(Impl& impl) { return boost::fusion::at_c<3>(impl); }
+ template<typename Impl>
+ session_map&
+ session_vars(Impl& impl) { return boost::fusion::at_c<4>(impl); }
+
+/// This is used in `class basic_request<>` to add the request data accessors operators.
+#define BOOST_CGI_DETAIL_MAP_ACCESS(x) \
+ x##_map& operator[](common::##x##_data_type const&) \
+ { \
+ return x##_vars(this->implementation.vars_); \
+ }
 
  } // namespace common
 } // namespace cgi

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -58,7 +58,7 @@
 // on by default).
 #if defined(BOOST_CGI_KEEP_EMPTY_VARS)
          if (name.empty())
- destination[current_token.c_str()] = "";
+ destination.insert(std::make_pair(common::name(current_token.c_str()), ""));
          else
 #endif // BOOST_CGI_KEEP_EMPTY_VARS
            destination[name.c_str()] = current_token;

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/error.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/error.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/error.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -11,7 +11,9 @@
 // The errors for everything are defined in here. ie. FastCGI,
 // CGI and SCGI errors.
 //
-// **FIXME** This is a mess.
+// **FIXME** There should likely be a common set of errors and
+// then protocol-specific errors. So far, everything
+// is an fcgi_error, which clearly isn't right.
 //
 ////////////////////////////////////////////////////////////////
 #ifndef CGI_ERROR_HPP_INCLUDED__
@@ -19,6 +21,7 @@
 
 #include <string>
 #include <boost/system/error_code.hpp>
+#include "boost/cgi/common/error.hpp"
 #include "boost/cgi/fcgi/error.hpp"
 
 namespace cgi {

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -147,18 +147,19 @@
        //assign(impl.acceptor_, , 0, ec);
        return acceptor_service_.assign(impl.acceptor_, boost::asio::ip::tcp::v4()
                                       , 0, ec);
- #else
+#else
 //# error "Windows isn't supported at the moment"
        HANDLE hListen = INVALID_HANDLE_VALUE;
        boost::asio::detail::socket_type sock;
        struct sockaddr sa;
        int sa_len = sizeof(sa);
 #if NO_WSAACCEPT
- sock = accept((boost::asio::detail::socket_type)hListen, &sa, &sa_len);
- if (sock == INVALID_SOCKET)
- return cgi::error::invalid_socket;
+// sock = accept((boost::asio::detail::socket_type)hListen, &sa, &sa_len);
+// if (sock == INVALID_SOCKET)
+// return cgi::error::invalid_socket;
 #else
- sock = WSAAccept((unsigned int)hListen, &sa, &sa_len, NULL, (DWORD)NULL);
+//#error BOOST_WINDOWS
+ //sock = WSAAccept((unsigned int)hListen, &sa, &sa_len, NULL, (DWORD)NULL);
        if (sock == INVALID_SOCKET)
          return ::cgi::error::invalid_socket;
 #endif

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/error.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/error.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/error.hpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -66,7 +66,10 @@
   bad_read,
 
   // A client wasn't able to open.
- client_not_open
+ client_not_open,
+
+ // End of File (read zero bytes)
+ eof
 };
 
   namespace detail {

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/form_parser.ipp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -160,8 +160,9 @@
       form_parser::parse_multipart_form(boost::system::error_code& ec)
     {
       parse_boundary_marker(ec);
-
+ std::cerr<< "Parsed boundary marker" << std::endl;
       move_to_start_of_first_part(ec);
+ std::cerr<< (ec ? "Error finding first multipart section" : "Moved to start of actual data") << std::endl;
 
       if (ec && ec != boost::asio::error::eof)
         return ec;
@@ -191,6 +192,7 @@
     boost::system::error_code
       form_parser::parse_form_part_data(boost::system::error_code& ec)
     {
+ std::cerr<< "In form_parser::parse_form_part_data" << std::endl;
       std::string regex("^(.*?)" // the data
                         "\\x0D\\x0A" // CR LF
                         "--" "(");
@@ -209,7 +211,7 @@
         regex += *boundary_markers.begin();
       }
 
- regex += ")(--)?[ ]*\\x0D\\x0A";
+ regex += ")(--)?[ ]*(?:\\x0D\\x0A)?";
       boost::regex re(regex);
 
       typedef buffer_type::iterator buffer_iter;
@@ -221,6 +223,7 @@
       //int runs = 0;
       buffer_iter begin(buffer_.begin() + offset);
       buffer_iter end(buffer_.end());
+ std::cerr<< "Current buffer (a) :{ " << std::string(begin,end) << " }: " << std::endl;
 
       for(;;)
       {
@@ -301,7 +304,7 @@
                             "[ \\x0D\\x0A]*=[ \\x0D\\x0A]*" // separator
                             "(?:\"?([-.\\w]*)\"?)" // value may be empty
                           ")?" // mark the extra n/v pairs optional
- "\\x0D\\x0A"
+ "(?:\\x0D\\x0A)"
                         ")"
                         "(?:"
                           "([-\\w]+)" // name
@@ -322,9 +325,11 @@
                             "[ \\x0D\\x0A]*=[ \\x0D\\x0A]*" // separator
                             "(?:\"?([-.\\w]*)\"?)" // value may be empty
                           ")?" // mark the extra n/v pairs optional
- "\\x0D\\x0A" // followed by the end of the line
+ "(?:\\x0D\\x0A)" // followed by the end of the line
                         ")?"
                       "(\\x0D\\x0A)"); // followed by the 'header termination' line
+
+ boost::regex re2("([^\\n\\r]+?)\\r\\n\\r\\n");
 
       typedef buffer_type::iterator buffer_iter;
 
@@ -339,10 +344,12 @@
       {
         buffer_iter begin(buffer_.begin() + offset);
         buffer_iter end(buffer_.end());
+ std::cerr<< "Current buffer (b) :{ " << std::string(begin,end) << " }: " << std::endl;
 
- if (!boost::regex_search(begin, end, matches, re
+ if (!boost::regex_search(begin, end, matches, re2
                                 , boost::match_default | boost::match_partial))
         {
+ std::cerr<< "Read all stdin." << std::endl;
           stdin_parsed_ = true;
           return ec;
         }
@@ -353,7 +360,7 @@
               ; i < matches.size()
                && matches[i].matched
                && !matches[i].str().empty()
- ; i+=2)
+ ; i+=1)
           {
             if (matches[i].str() == "name")
             {
@@ -364,27 +371,30 @@
               part.meta_data_[matches[i]]
                 = std::make_pair(matches[i+1].first, matches[i+1].second);
             }
+ std::cerr<< "Adding form part with name :{ " << part.name << " }: " << std::endl;
             form_parts_.push_back(part);
          }
+
+ std::cerr<< " num matches = " << matches.size() << std::endl;
+ std::cerr<< "matches[13] :{ " << matches[13].str() << " }: " << std::endl;
 
          if (matches[13].str() == "\r\n")
          {
            offset_ = offset + matches[0].length();
            offset += matches[0].length();
            pos_ = matches[0].second;
-
+ std::cerr<< "stuff :{ " << matches[0].str() << " }: " << std::endl;
            return ec;
          }
          else
          {
+ std::cerr<< "oh no" << std::endl;
            throw std::runtime_error("Invalid POST data (header wasn't terminated as expected)");
          }
 
         }else{
- bytes_read
- = callback_(ec);
- if (ec)
- return ec;
+ bytes_read = callback_(ec);
+ if (ec) return ec;
           if (++runs > 40)
           {
             std::cerr<< "Done 40 runs; bailing out" << std::endl;
@@ -392,7 +402,7 @@
           }
        }
       }
-
+ std::cerr<< " -- Done form part meta data. -- " << std::endl;
       return ec;
     }
 
@@ -400,18 +410,19 @@
     boost::system::error_code
       form_parser::move_to_start_of_first_part(boost::system::error_code& ec)
     {
- boost::regex re("((?:.*)?" // optional leading characters
+ //std::cerr<< "In func: " << boundary_markers.front() << std::endl;
+ boost::regex re("(?:"//(?:.*?)?" // optional leading characters
                       //"(?:\\x0D\\x0A)|^" // start of line
- "[\\x0D\\x0A^]*?"
+ //"[\\x0D\\x0A^\\<]*?"
                       "("
                         "--" + boundary_markers.front() + // two dashes and our marker
                       ")"
- "(--)?" // optional two dashes (not sure if this is allowed)
- " *\\x0D\\x0A)");
+ "(--)?" // optional two dashes
+ "[ \\r\\n]*?\\r\\n)");
                                         // on the first marker.
 
       typedef buffer_type::iterator buffer_iter;
- //std::cerr<< "Regex := " << re << std::endl;
+ std::cerr<< "Regex :{ " << re << " }: " << std::endl;
 
       boost::match_results<buffer_iter> matches;
 
@@ -421,11 +432,15 @@
       std::size_t bytes_read = 0;
       for(;;)
       {
- bytes_read
- = callback_(ec);
-
- if (ec || (bytes_read == 0))
- return ec;
+ // The function object stored in `callback_` is used to read data.
+ bytes_read = callback_(ec);
+
+ std::cerr<< "Read " << bytes_read << " bytes from the socket (offset = " << offset << ")." << std::endl
+ << "Current buffer :{ " << std::string(buffer_.begin(), buffer_.end()) << " }: " << std::endl;
+
+ //if (bytes_read == 0) ec = common::error::multipart_form_boundary_not_found;
+ if (ec || bytes_read == 0) return ec;
+
         buffer_iter begin(buffer_.begin());// + offset);
         buffer_iter end(buffer_.end());
         if (!boost::regex_search(begin, end //impl.buffer_.begin(), impl.buffer_.end()
@@ -436,7 +451,9 @@
         }
         else
         {
- if (matches[2].matched)
+ std::cerr<< "Matches :{ " << matches[0].str() << " }: " << std::endl;
+
+ if (matches[1].matched)
           {
             buffer_.erase(buffer_.begin(), matches[0].second);
             offset_ = 0;
@@ -446,7 +463,7 @@
           else
           {
             if (++runs > 10)
- return ec;
+ return ec = common::error::multipart_form_boundary_not_found;
             continue;
           }
         }
@@ -462,7 +479,20 @@
       //BOOST_ASSERT(!content_type.empty());
 
       // **FIXME** (don't use Boost.Regex)
- boost::regex re("; ?boundary=\"?([^\"\n\r]+)\"?");
+ std::cerr<< " :{ " << content_type_ << " }: " << std::endl;
+ /*
+ std::string::size_type sz = content_type_.find("=");
+ if (sz == std::string::npos)
+ return boost::system::error_code(666, boost::system::system_category);
+
+ std::string::size_type sz2 = content_type_.find("\r", sz);
+ boundary_marker = content_type_.substr(sz+1);
+ // New boundary markers are added to the front of the list.
+ boundary_markers.push_front(boundary_marker);
+ /*
+ std::cerr<< "Need string:: " << content_type_.substr(sz+1) << " (" << sz << "," << (sz2) << ")";
+ */
+ boost::regex re("; ?boundary=\"?([^\"\\r]+)\"?(\\r\\n)?");
       boost::smatch match_results;
       if (!boost::regex_search(content_type_, match_results, re))
         return boost::system::error_code(666, boost::system::system_category);
@@ -470,7 +500,7 @@
       boundary_marker = match_results[1].str();
       // New boundary markers are added to the front of the list.
       boundary_markers.push_front(match_results[1].str());
- std::cerr<< "boundary marker := " << boundary_marker << std::endl;
+ std::cerr<< "boundary marker :{ " << boundary_marker << " }: " << std::endl;
 
       return ec;
     }

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

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -1,27 +1,9 @@
 ï»¿
 Microsoft Visual Studio Solution File, Format Version 10.00
 # Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xcgi_server1", "xcgi_server1\xcgi_server1.vcproj", "{30BDABB1-6F79-4009-B2FB-7DDA11CB2DC4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_echo", "cgi_echo\cgi_echo.vcproj", "{12AA5F5E-EA1E-4602-98E4-9244872739C1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_hello_world", "cgi_hello_world\cgi_hello_world.vcproj", "{CDC4D356-7606-4100-BD78-AFAE949C5748}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_hello_world", "acgi_hello_world\acgi_hello_world.vcproj", "{FEAD8671-B7BE-4F52-A308-6B337171F0B6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_echo", "acgi_echo\acgi_echo.vcproj", "{83BF52DF-C606-4BB7-B06F-EDC28DE829B1}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_cookie_game", "acgi_cookie_game\acgi_cookie_game.vcproj", "{7B825743-52B4-44DC-932F-29F4D2547F38}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_amortization", "Amortization\Amortization.vcproj", "{EA445816-770B-49AC-8813-53BF79D88905}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_debug_server", "cgi_debug_server\cgi_debug_server.vcproj", "{730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_ctemplate_debug_server", "cgi_ctemplate_debug_server\cgi_ctemplate_debug_server.vcproj", "{CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DebugServer3", "DebugServer3\DebugServer3.vcproj", "{C0B7A721-6E2B-4594-94DD-94A6D21919DB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_ctemplate_cookie_game", "acgi_ctemplate_cookie_game\acgi_ctemplate_cookie_game.vcproj", "{AC2E336C-7C32-468C-9847-470436CF668F}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_echo", "acgi_echo\acgi_echo.vcproj", "{83BF52DF-C606-4BB7-B06F-EDC28DE829B1}"
 EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,40 +11,14 @@
                 Release|Win32 = Release|Win32
         EndGlobalSection
         GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {30BDABB1-6F79-4009-B2FB-7DDA11CB2DC4}.Debug|Win32.ActiveCfg = Release|Win32
- {30BDABB1-6F79-4009-B2FB-7DDA11CB2DC4}.Release|Win32.ActiveCfg = Release|Win32
- {30BDABB1-6F79-4009-B2FB-7DDA11CB2DC4}.Release|Win32.Build.0 = Release|Win32
- {12AA5F5E-EA1E-4602-98E4-9244872739C1}.Debug|Win32.ActiveCfg = Release|Win32
- {12AA5F5E-EA1E-4602-98E4-9244872739C1}.Release|Win32.ActiveCfg = Release|Win32
- {12AA5F5E-EA1E-4602-98E4-9244872739C1}.Release|Win32.Build.0 = Release|Win32
- {CDC4D356-7606-4100-BD78-AFAE949C5748}.Debug|Win32.ActiveCfg = Release|Win32
- {CDC4D356-7606-4100-BD78-AFAE949C5748}.Release|Win32.ActiveCfg = Release|Win32
- {CDC4D356-7606-4100-BD78-AFAE949C5748}.Release|Win32.Build.0 = Release|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Debug|Win32.ActiveCfg = Release|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Release|Win32.ActiveCfg = Release|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Release|Win32.Build.0 = Release|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Debug|Win32.ActiveCfg = Release|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Release|Win32.ActiveCfg = Release|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Release|Win32.Build.0 = Release|Win32
- {7B825743-52B4-44DC-932F-29F4D2547F38}.Debug|Win32.ActiveCfg = Release|Win32
+ {7B825743-52B4-44DC-932F-29F4D2547F38}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7B825743-52B4-44DC-932F-29F4D2547F38}.Debug|Win32.Build.0 = Debug|Win32
                 {7B825743-52B4-44DC-932F-29F4D2547F38}.Release|Win32.ActiveCfg = Release|Win32
                 {7B825743-52B4-44DC-932F-29F4D2547F38}.Release|Win32.Build.0 = Release|Win32
- {EA445816-770B-49AC-8813-53BF79D88905}.Debug|Win32.ActiveCfg = Release|Win32
- {EA445816-770B-49AC-8813-53BF79D88905}.Release|Win32.ActiveCfg = Release|Win32
- {EA445816-770B-49AC-8813-53BF79D88905}.Release|Win32.Build.0 = Release|Win32
- {730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}.Debug|Win32.ActiveCfg = Release|Win32
- {730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}.Release|Win32.ActiveCfg = Release|Win32
- {730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}.Release|Win32.Build.0 = Release|Win32
- {CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}.Debug|Win32.ActiveCfg = Release|Win32
- {CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}.Release|Win32.ActiveCfg = Release|Win32
- {CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}.Release|Win32.Build.0 = Release|Win32
- {C0B7A721-6E2B-4594-94DD-94A6D21919DB}.Debug|Win32.ActiveCfg = Debug|Win32
- {C0B7A721-6E2B-4594-94DD-94A6D21919DB}.Release|Win32.ActiveCfg = Release|Win32
- {C0B7A721-6E2B-4594-94DD-94A6D21919DB}.Release|Win32.Build.0 = Release|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Debug|Win32.ActiveCfg = Debug|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Debug|Win32.Build.0 = Debug|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Release|Win32.ActiveCfg = Release|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Release|Win32.Build.0 = Release|Win32
+ {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Debug|Win32.Build.0 = Debug|Win32
+ {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Release|Win32.ActiveCfg = Release|Win32
+ {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

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

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -40,6 +40,7 @@
                         />
                         <Tool
                                 Name="VCCLCompilerTool"
+ AdditionalOptions="/D &quot;_SCL_SECURE_NO_WARNINGS&quot;"
                                 Optimization="0"
                                 AdditionalIncludeDirectories=""
                                 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -86,7 +86,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\style.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\style.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
                         />
                 </Configuration>
                 <Configuration
@@ -162,6 +162,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\main.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;"
                         />
                 </Configuration>
         </Configurations>

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_echo/acgi_echo.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_echo/acgi_echo.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_echo/acgi_echo.vcproj 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -40,6 +40,7 @@
                         />
                         <Tool
                                 Name="VCCLCompilerTool"
+ AdditionalOptions="/D &quot;_SCL_SECURE_NO_WARNINGS&quot;"
                                 Optimization="0"
                                 AdditionalIncludeDirectories="&quot;C:\Code\C++\Boost.CGI\current&quot;;&quot;C:\Code\C++\boost\svn\branches\release&quot;"
                                 PreprocessorDefinitions="_SCL_SECURE_NO_WARNINGS"
@@ -116,6 +117,7 @@
                         />
                         <Tool
                                 Name="VCCLCompilerTool"
+ AdditionalOptions="/"
                                 Optimization="2"
                                 EnableIntrinsicFunctions="true"
                                 PreprocessorDefinitions="_SCL_SECURE_NO_WARNINGS"

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -163,6 +163,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;"
                         />
                 </Configuration>
         </Configurations>

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_hello_world/cgi_hello_world.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_hello_world/cgi_hello_world.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_hello_world/cgi_hello_world.vcproj 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -136,6 +136,7 @@
                         />
                         <Tool
                                 Name="VCLinkerTool"
+ AdditionalOptions="libboost_system-vc90-mt-1_38.lib"
                                 LinkIncremental="1"
                                 GenerateDebugInformation="true"
                                 SubSystem="1"
@@ -163,6 +164,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;"
                         />
                 </Configuration>
         </Configurations>

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/fcgi_hello_world/fcgi_hello_world.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/fcgi_hello_world/fcgi_hello_world.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/fcgi_hello_world/fcgi_hello_world.vcproj 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -60,6 +60,7 @@
                         />
                         <Tool
                                 Name="VCLinkerTool"
+ AdditionalOptions="libboost_system-vc90-mt-gd-1_38.lib"
                                 LinkIncremental="2"
                                 GenerateDebugInformation="true"
                                 SubSystem="1"
@@ -85,6 +86,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\fcgi-bin\$(TargetName)&quot;"
                         />
                 </Configuration>
                 <Configuration
@@ -132,6 +134,7 @@
                         />
                         <Tool
                                 Name="VCLinkerTool"
+ AdditionalOptions="libboost_system-vc90-mt-1_38.lib"
                                 LinkIncremental="1"
                                 GenerateDebugInformation="true"
                                 SubSystem="1"
@@ -159,6 +162,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\fcgi-bin\$(TargetName)&quot;"
                         />
                 </Configuration>
         </Configurations>
@@ -170,6 +174,10 @@
                         Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
+ <File
+ RelativePath="..\..\..\..\..\example\fcgi\hello_world\main.cpp"
+ >
+ </File>
                 </Filter>
                 <Filter
                         Name="Header Files"

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -1,26 +1,7 @@
-// -- main.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)
-//
-////////////////////////////////////////////////////////////////
-//
-//[acgi_cookie_game2
-//
-// Cookie Test With cTemplate
-// --------------------------
-//
-// This file uses Google cTemplate to show the benefits of using an HTML
-// template engine. Using cTemplate to separate how you show the response and
-// how you figure out what to respond with, is keeping to the MVC paradigm.
-// Read up on that if you're not familiar; if you already are, you can
-// probably stop scowling at the last cookie_game example now.
-//
-#include <boost/cgi/acgi.hpp>
+// -- main.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)//////////////////////////////////////////////////////////////////////[acgi_cookie_game2//// Cookie Test With cTemplate// --------------------------//// This file uses Google cTemplate to show the benefits of using an HTML// template engine. Using cTemplate to separate how you show the response and// how you figure out what to respond with, is keeping to the MVC paradigm.// Read up on that if you're not familiar; if you already are, you can// probably stop scowling at the last cookie_game example now.//#include <boost/cgi/acgi.hpp>
 #include <boost/cgi/utility.hpp>
 #include <google/template.h>
+//]
 
 /**
  * The following example has a few stages.
@@ -28,6 +9,8 @@
  * the source code.
  */
 
+//[main
+
 using namespace boost::acgi;
 
 // The types we use. Only here because this is an example.
@@ -106,11 +89,13 @@
 
     if (has_key(req[form], "name"))
     {
+ // If requested by the user, delete the cookie.
       if (has_key(req[form], "del"))
         resp<< cookie(req[form]["name"]);
- else
+ else // Set the cookie.
         resp<< cookie(req[form]["name"], req[form]["value"]);
       resp<< redirect(req, req.script_name());
+ // Exit here.
       return_(resp, req, http::ok);
     }
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/hello_world/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/hello_world/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/fcgi/hello_world/main.cpp 2009-03-15 21:35:11 EDT (Sun, 15 Mar 2009)
@@ -12,18 +12,33 @@
 // The simplest FastCGI program, outputs only "Hello there, universe."
 //
 
-#include <boost/cgi/fcgi.hpp>
-#include <boost/cgi.hpp>
+#include <cmath>
+#include <boost/system/system_error.hpp>
+//#include <boost/cgi/fcgi.hpp>
+//#include <boost/cgi.hpp>
 
 using namespace std;
-using namespace boost::fcgi;
+//using namespace boost::fcgi;
+
+#include <iostream>
+
+class Test
+{
+public:
+ Test() {
+ //std::cerr<< "Test Test!!!";
+ }
+};
+
+// Initialise first.
+Test test;
 
 template<typename Request, typename Response>
 int handle_request(Request& req, Response& resp)
 {
   // This is a minimal response. The content_type(...) may go before or after
   // the response text.
- resp<< content_type("text/plain")
+ resp//<< content_type("text/plain")
       << "Hello there, universe.";
 
   return_(resp, req, 0);
@@ -31,43 +46,48 @@
 
 int main()
 {
-try
-{
- service s; // This becomes useful with async operations.
- acceptor a(s); // The acceptor is for accepting requests
-
   int ret = 0; // the return value
+
+ for(long i=1000000000; i != 0; --i)
+ {
+ std::sqrt(1236.456L); // waste time
+ }
+
+ try
+ {/*
+ service s; // This becomes useful with async operations.
+ acceptor a(s); // The acceptor is for accepting requests
+
   
- for (;;)
- {
- request req(s); // Our request (reusing this when possible saves expensive
- // construction/destruction of the request's memory).
-
- for (;;) // Handle requests until something goes wrong
- // (an exception will be thrown).
+ for (;;)
     {
- a.accept(req);
- response resp; // Use the response class to make our lives easier.
- ret = handle_request(req, resp); // The class defined above.
- if (ret) break; // Use a new request if something went wrong.
+ request req(s); // Our request (reusing this when possible saves expensive
+ // construction/destruction of the request's memory).
+
+ for (;;) // Handle requests until something goes wrong
+ // (an exception will be thrown).
+ {
+ a.accept(req);
+ response resp; // Use the response class to make our lives easier.
+ ret = handle_request(req, resp); // The class defined above.
+ if (ret) break; // Use a new request if something went wrong.
+ }
+ if (!a.is_open()) break; // Quit completely if the acceptor bails out.
     }
- if (!a.is_open()) break; // Quit completely if the acceptor bails out.
+ */
+ } // This library throws only this type of exception (see Boost.System documentation).
+ catch(boost::system::system_error const& err)
+ {
+ std::cerr<< "System error " << err.code() << ": "
+ << err.what() << std::endl;
+ return 1;
+ }
+ catch(...)
+ {
+ std::cerr<< "Unknown error!" << std::endl;
+ return 2;
   }
-
   return ret;
 }
-// This library throws only this type of exception (see Boost.System documentation).
-catch(boost::system::system_error& err)
-{
- std::cerr<< "System error " << err.code() << ": "
- << err.what() << std::endl;
- return 1;
-}
-catch(...)
-{
- std::cerr<< "Unknown error!" << std::endl;
- return 2;
-}
-}
 //]
 


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