3737
3838#ifndef NETWORK_HTTP_SERVER_CONNECTION_HEADER_BUFFER_MAX_SIZE
3939/* * Here we define a page's worth of header connection buffer data.
40- * This can be tuned to reduce the memory cost of connections, but this
40+ * This can be tuned to reduce the memory cost of connections, but this
4141 * default size is set to be friendly to typical service applications.
4242 * This is the maximum size though and Boost.Asio's internal representation
4343 * of a streambuf would make appropriate decisions on how big a buffer
@@ -91,7 +91,7 @@ namespace network { namespace http {
9191
9292private:
9393static char const *status_message (status_t status) {
94- static char const
94+ static char const
9595 ok_[] =" OK"
9696 , created_[] =" Created"
9797 , accepted_[] =" Accepted"
@@ -160,9 +160,9 @@ namespace network { namespace http {
160160
161161/* * Function: template <class Range> set_headers(Range headers)
162162 * Precondition: headers have not been sent yet
163- * Postcondition: headers have been linearized to a buffer,
163+ * Postcondition: headers have been linearized to a buffer,
164164 * and assumed to have been sent already when the function exits
165- * Throws: std::logic_error in case the headers have already been sent.
165+ * Throws: std::logic_error in case the headers have already been sent.
166166 *
167167 * A call to set_headers takes a Range where each element models the
168168 * Header concept. This Range will be linearized onto a buffer, which is
@@ -171,7 +171,7 @@ namespace network { namespace http {
171171template <class Range >
172172void set_headers (Range headers) {
173173 lock_guardlock (headers_mutex);
174- if (headers_in_progress || headers_already_sent)
174+ if (headers_in_progress || headers_already_sent)
175175boost::throw_exception (std::logic_error (" Headers have already been sent." ));
176176
177177if (error_encountered)
@@ -185,7 +185,7 @@ namespace network { namespace http {
185185 <<constants::crlf ();
186186if (!boost::empty (headers)) {
187187typedef typename Range::const_iterator iterator;
188- boost::transform (headers,
188+ boost::transform (headers,
189189 std::ostream_iterator<std::string>(stream),
190190linearize_header ());
191191 }else {
@@ -213,7 +213,7 @@ namespace network { namespace http {
213213void write (Rangeconst & range) {
214214 lock_guardlock (headers_mutex);
215215if (error_encountered)boost::throw_exception (boost::system::system_error (*error_encountered));
216- std::function<void (boost::system::error_code)> f =
216+ std::function<void (boost::system::error_code)> f =
217217std::bind (
218218 &async_server_connection::default_error
219219 ,async_server_connection::shared_from_this ()
@@ -319,7 +319,7 @@ namespace network { namespace http {
319319status_t status;
320320 request_parser parser;
321321 request request_;
322- typename buffer_type::iterator new_start, data_end;
322+ buffer_type::iterator new_start, data_end;
323323 std::string partial_parsed;
324324 boost::optional<boost::system::system_error> error_encountered;
325325 pending_actions_list pending_actions;
@@ -365,7 +365,7 @@ namespace network { namespace http {
365365 new_start, data_end);
366366boost::fusion::tie (parsed_ok, result_range) = parser.parse_until (
367367 request_parser::method_done, input_range);
368- if (!parsed_ok) {
368+ if (!parsed_ok) {
369369client_error ();
370370break ;
371371 }else if (parsed_ok ==true ) {
@@ -479,7 +479,7 @@ namespace network { namespace http {
479479 }
480480
481481void client_error () {
482- static char const * bad_request =
482+ static char const * bad_request =
483483" HTTP/1.0 400 Bad Request\r\n Connection: close\r\n Content-Type: text/plain\r\n Content-Length: 12\r\n\r\n Bad Request." ;
484484
485485boost::asio::async_write (
@@ -565,17 +565,17 @@ namespace network { namespace http {
565565
566566static std::size_t const connection_buffer_size =
567567 NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE;
568- shared_array_list temporaries =
568+ shared_array_list temporaries =
569569 std::make_shared<array_list>();
570- shared_buffers buffers =
570+ shared_buffers buffers =
571571 std::make_shared<std::vector<boost::asio::const_buffer> >(0 );
572572
573573 std::size_t range_size =boost::distance (range);
574574 buffers->reserve (
575575 (range_size / connection_buffer_size)
576576 + ((range_size % connection_buffer_size)?1 :0 )
577577 );
578- std::size_t slice_size =
578+ std::size_t slice_size =
579579std::min (range_size,connection_buffer_size);
580580typename boost::range_iterator<Range>::type
581581 start =boost::begin (range)
@@ -641,8 +641,8 @@ namespace network { namespace http {
641641 );
642642 }
643643 };
644-
644+
645645}// namespace http
646646}// namespace network
647-
647+
648648#endif /* NETWORK_PROTOCOL_HTTP_SERVER_CONNECTION_HPP_20101027*/