|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62092 - in sandbox/SOC/2007/cgi/trunk: boost/cgi boost/cgi/fcgi boost/cgi/impl libs/cgi/doc libs/cgi/doc/src
From: lists.drrngrvy_at_[hidden]
Date: 2010-05-18 20:20:40
Author: drrngrvy
Date: 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
New Revision: 62092
URL: http://svn.boost.org/trac/boost/changeset/62092
Log:
Added some comments and removed the unneeded read_some functions in fcgi_request_service.
Text files modified:
sandbox/SOC/2007/cgi/trunk/boost/cgi/basic_client.hpp | 10 ++++++----
sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/client.hpp | 25 ++++++++++++++++++++++++-
sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/request_service.hpp | 14 --------------
sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/fcgi_request_service.ipp | 27 ---------------------------
sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp | 1 -
sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/Jamfile.v2 | 2 +-
sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/cgi.qbk | 2 +-
sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/tutorial.qbk | 2 ++
8 files changed, 34 insertions(+), 49 deletions(-)
Modified: sandbox/SOC/2007/cgi/trunk/boost/cgi/basic_client.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/boost/cgi/basic_client.hpp (original)
+++ sandbox/SOC/2007/cgi/trunk/boost/cgi/basic_client.hpp 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -177,8 +177,7 @@
{
connection_->async_read_some(buf, handler);
}
-
-
+
////// Querying the client.
/// Get a shared_ptr of the connection associated with the client.
@@ -227,7 +226,7 @@
public: // **FIXME**
// we should never read more than content-length bytes.
- std::size_t bytes_left_;
+ std::size_t bytes_left_;
boost::uint16_t request_id_;
client_status status_;
@@ -236,10 +235,13 @@
boost::uint64_t total_sent_packets_;
/// Buffer used to check the header of each packet.
- //header_buffer_type out_header_;
fcgi::spec::header header_;
/// Output buffer.
+ /**
+ * This doesn't take ownership of the underlying memory, so the
+ * data must remain valid until it has been completely written.
+ */
std::vector<boost::asio::const_buffer> outbuf_;
bool keep_connection_;
Modified: sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/client.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/client.hpp (original)
+++ sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/client.hpp 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -97,7 +97,20 @@
return ec;
}
-
+ /// Prepare a buffer by wrapping it into a FastCGI packet.
+ /**
+ * FastCGI dictates that data is sent in packets which identify
+ * which request the data relates to, along with the size of
+ * the packet.
+ *
+ * This function takes a buffer of data and creates another
+ * buffer which includes the packet header information. As the
+ * buffers themselves only contain pointers to the data the
+ * overhead is negligible as the data is not copied.
+ *
+ * The lifetime of the header is guaranteed as it is kept in
+ * the client object itself.
+ */
template<>
template<typename ConstBufferSequence>
void
@@ -179,6 +192,11 @@
/// Write some data to the client.
+ /**
+ * Currently this actually writes an entire packet - which may be up
+ * to 65,535 bytes in size - as the connection may potentially be
+ * multiplexed and shared between requests.
+ */
template<>
template<typename ConstBufferSequence>
std::size_t
@@ -202,6 +220,11 @@
/// Write some data to the client.
+ /**
+ * Currently this actually writes an entire packet - which may be up
+ * to 65,535 bytes in size - as the connection may potentially be
+ * multiplexed and shared between requests.
+ */
template<>
template<typename ConstBufferSequence, typename Handler>
void
Modified: sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/request_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/request_service.hpp (original)
+++ sandbox/SOC/2007/cgi/trunk/boost/cgi/fcgi/request_service.hpp 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -208,20 +208,6 @@
/***************************************************************************/
public: // Reading stuff goes under here
- /// Read some data from the client into the internal buffer.
- std::size_t
- read_some(implementation_type& impl, boost::system::error_code& ec)
- {
- return read_some(impl, impl.prepare(64), ec);
- }
-
- // **FIXME**
- /// Read some data from the client into the supplied buffer.
- template<typename MutableBufferSequence>
- std::size_t
- read_some(implementation_type& impl, const MutableBufferSequence& buf
- , boost::system::error_code& ec);
-
/// Read a single header, buf do nothing with it.
boost::system::error_code
read_header(implementation_type& impl, boost::system::error_code& ec);
Modified: sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/fcgi_request_service.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/fcgi_request_service.ipp (original)
+++ sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/fcgi_request_service.ipp 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -411,29 +411,6 @@
return ec;
}
- // **FIXME**
- /// Read some data from the client.
- template<typename Protocol>
- template<typename MutableBufferSequence>
- BOOST_CGI_INLINE std::size_t
- fcgi_request_service<Protocol>::read_some(
- implementation_type& impl, const MutableBufferSequence& buf
- , boost::system::error_code& ec)
- {
- if (impl.client_.status_ == common::closed_)
- {
- ec = common::error::client_closed;
- return 0;
- }
-
- //if (read_header(ec))
- return 0;
-
- //boost::tribool state = parse_header(impl);
- //std::size_t bytes_read;//( connection_->read_some(buf, ec) );
- //return bytes_read;
- }
-
/// Read in the FastCGI (env) params
// **FIXME**
template<typename Protocol>
@@ -764,10 +741,6 @@
{
impl.client_.request_id_ = fcgi::spec::get_request_id(header);
- BOOST_STATIC_ASSERT((
- fcgi::spec::begin_request::body::size::value
- == fcgi::spec::header_length::value));
-
// A begin request body is as long as a header, so we can optimise:
if (read_header(impl, ec))
return ec;
Modified: sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp (original)
+++ sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -10,7 +10,6 @@
#define CGI_DETAIL_FORM_PARSER_IPP_INCLUDED__
#include "boost/cgi/error.hpp"
-#include "boost/cgi/basic_client.hpp"
#include "boost/cgi/common/form_part.hpp"
#include "boost/cgi/detail/url_decode.hpp"
#include "boost/cgi/common/source_enums.hpp"
Modified: sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/Jamfile.v2 (original)
+++ sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/Jamfile.v2 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -139,7 +139,7 @@
#<xsl:param>root.filename="svg_plot"
#<xsl:param>root.filename=cgi
- <xsl:param>boost.image.src="../doc/src/images"
+ <xsl:param>boost.image.src="../images/logo.png"
<xsl:param>project.image.src="../doc/src/images"
<xsl:param>project.root=http://omnisplat.com
Modified: sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/cgi.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/cgi.qbk (original)
+++ sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/cgi.qbk 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -1,5 +1,5 @@
[/
- / Copyright (c) 2007-2009 Darren Garvey
+ / Copyright (c) 2007-2010 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)
Modified: sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/tutorial.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/tutorial.qbk (original)
+++ sandbox/SOC/2007/cgi/trunk/libs/cgi/doc/src/tutorial.qbk 2010-05-18 20:20:37 EDT (Tue, 18 May 2010)
@@ -15,6 +15,8 @@
[include tutorial/installation.qbk]
+[include tutorial/server_configuration.qbk]
+
[/include:wrapping_up wrapping_up.qbk]
[endsect]
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