Changeset 43773

Timestamp:
Mar 21, 2008, 8:33:04 PM (15 years ago)
Author:
Darren Garvey
Message:

Merged revisions 40142-43769 via svnmerge from
https://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/branches/acceptor_work

........

r40142 | drrngrvy | 2007-10-18 00:40:30 +0100 (Thu, 18 Oct 2007) | 1 line


Merge from SF.net finished, finally. Gadzooks! Ike! It did not have to be that fiddly...

........

r40493 | drrngrvy | 2007-10-27 04:15:02 +0100 (Sat, 27 Oct 2007) | 1 line


Trying SCGI stuff with a compiler (!) - it's really messy at the moment, unfortunately.

........

r40899 | drrngrvy | 2007-11-07 18:08:24 +0000 (Wed, 07 Nov 2007) | 18 lines


Commit to bridge the gap since the last. The included updates are many and scattered, mostly incomplete (see below).


  • Removed gateway_* files, since they're not needed (although changing basic_client -> basic_gateway might be a future possibility; it depends how the Client concept develops).


  • Working on a more rigorous testing environment (not yet included here). For this we need an 'executor' that can generate fake requests and launch the programs compiled using this library in the way they're supposed to be. I avoided doing this before now because it seemed like a monumental task, but thanks to the (not-done-yet) Boost.Process, it isn't.


The separate testing environment provides more than just the ability to test the library independently of an HTTP server.


Required features:

  • Allow one to easily debug their program.
  • Allow basic benchmarking facilities.
  • Allow testing of CGI, SCGI and FastCGI programs.
  • Allow loading of 'requests' from file or command line


In short, the lack of tests is hindering progress. Dropping the *need* for an HTTP server layer should help immensely. Obviously they will still be needed, just not at every step of the way.

........

r40915 | drrngrvy | 2007-11-08 01:24:05 +0000 (Thu, 08 Nov 2007) | 1 line


Working with cgi::response. It now separates the headers and the body, which can be reset at any time. The send() functions also should now work. The flush() and async_*() functions haven't been done yet. Streaming header and cookie classes to a response work now and can be sent in any order. A default-constructed header now stops any more headers being appended (BOOST_ASSERT is used for this), unless the ugly unterminate_headers function is called (that might be 'beyond ugly' though, it may have to change).

........

r41171 | drrngrvy | 2007-11-17 17:50:26 +0000 (Sat, 17 Nov 2007) | 1 line


Disorganised commit, but makes the previous revision slightly less so.

........

r41245 | drrngrvy | 2007-11-20 03:00:40 +0000 (Tue, 20 Nov 2007) | 8 lines


Again, not a particularly atomic commit, but:

  • Added some examples;
  • Allow use of boost::cgi, boost::acgi, boost::fcgi, boost::scgi;
  • Added listen(), bind(), assign() and open() functions to acceptor classes (at least, to the SCGI ones);
  • Fixed tcp_connection static create() function;
  • other minor changes.

........

r43172 | drrngrvy | 2008-02-08 14:43:13 +0000 (Fri, 08 Feb 2008) | 13 lines


This is a backup commit, it may be less functional than the last revision!


Contents:


  • Some work towards SCGI support. This was partly abandoned to work on FastCGI support (which is merely a copy of the scgi directory + modifications).


  • FastCGI support has begun to be added. On linux, with apache (mod_fastcgi or mod_fcgid) it can accept multiple connections and read/parse packets. PARAM packets can be parsed correctly, as can STDIN and BEGIN_REQUEST packets. They lack proper handling because I'm not sure if introducing a circular dependency is absolutely necessary - ie. the basic_client<> reads/parses packets but in order to do so must have access to the basic_request<> associated with it (to store variables in). The basic_request<> *has* a basic_client<> so that dependency exists too. There are several ways around it, not sure which is best.


  • FastCGI outputting hasn't been addressed yet, will do that after important uni work is done.


  • The beginnings of multipart form data handling was added, but only using Boost.Regex. The idea is that 'eventually' this should be a seperate form_parser class that takes a function object for reading more data and a map to store saved data into, so the class is generally useful outside this library. This separation has the advantage of allowing a Boost.Spirit, Boost.Regex and Boost.Xpressive implementation. I'm starting with regex because it won't get done otherwise. It's not finished yet, surprise surprise.

........

r43183 | drrngrvy | 2008-02-09 04:48:28 +0000 (Sat, 09 Feb 2008) | 1 line


Worked on getting fcgi::client able to write data: fcgi::client::write_some can write packets now. Also fcgi_request_service knows when it has finished loading now.

........

r43195 | drrngrvy | 2008-02-09 14:34:21 +0000 (Sat, 09 Feb 2008) | 13 lines


Refactored functions related to reading from fcgi::client to fcgi_request_service to remove the need for any circular dependency. Now you have the client as an AsyncWriteStream and the request as an AsyncReadStream: so you read into the request and write to the client... Seems natural.


I haven't updated the relevant bits for the other protocols, I'm going to leave that in case this turns out to be a bad way (it should be OK).


Note:


  • read_some isn't implemented yet.


  • the process_* functions work to varying degrees, but don't finish their jobs yet: that was due to the circular dependency issue mentioned above.


  • Only tested on linux/apache

........

r43197 | drrngrvy | 2008-02-09 17:18:35 +0000 (Sat, 09 Feb 2008) | 3 lines


FastCGI environment variables are stored now. The fcgi/hello_world example displays them (will move this to fcgi/echo when things settle a bit).

........

r43208 | drrngrvy | 2008-02-10 14:35:42 +0000 (Sun, 10 Feb 2008) | 3 lines


Adding return_() macro to make closing requests nicer-looking. (just a thought)

........

r43224 | drrngrvy | 2008-02-11 19:44:28 +0000 (Mon, 11 Feb 2008) | 1 line


Adding FastCGI echo example.

........

r43225 | drrngrvy | 2008-02-11 20:00:54 +0000 (Mon, 11 Feb 2008) | 1 line


Cleaned up return_ macro.

........

r43578 | drrngrvy | 2008-03-12 17:06:00 +0000 (Wed, 12 Mar 2008) | 3 lines


Adding amortization calculator example, which uses Google cTemplate to handle HTML output.

........

r43579 | drrngrvy | 2008-03-12 17:07:00 +0000 (Wed, 12 Mar 2008) | 1 line


Minor cosmetic update for hello world example.

........

r43580 | drrngrvy | 2008-03-12 17:43:11 +0000 (Wed, 12 Mar 2008) | 1 line


Cleaning up example a bit.

........

r43581 | drrngrvy | 2008-03-12 18:02:50 +0000 (Wed, 12 Mar 2008) | 1 line


Cleaned up template file a bit.

........

r43582 | drrngrvy | 2008-03-13 00:42:37 +0000 (Thu, 13 Mar 2008) | 1 line


Another minor cleanup to main.cpp.

........

r43583 | drrngrvy | 2008-03-13 00:45:41 +0000 (Thu, 13 Mar 2008) | 1 line


Try last commit again.

........

r43584 | drrngrvy | 2008-03-13 00:47:08 +0000 (Thu, 13 Mar 2008) | 1 line


And again (it's late).

........

r43585 | drrngrvy | 2008-03-13 00:59:35 +0000 (Thu, 13 Mar 2008) | 1 line


Various fixes, mostly to FastCGI parts; one or two small changes to aCGI/CGI files.

........

r43745 | drrngrvy | 2008-03-21 16:24:14 +0000 (Fri, 21 Mar 2008) | 1 line


Updated project-root.jam that allows users to install examples straight into their cgi-bin / fcgi-bin / etc. directory using either the command line or environment variables.

........

r43746 | drrngrvy | 2008-03-21 16:30:08 +0000 (Fri, 21 Mar 2008) | 1 line


Importing cgi::common namespace into boost::*cgi namespaces when including that protocol's header

........

r43749 | drrngrvy | 2008-03-21 16:49:08 +0000 (Fri, 21 Mar 2008) | 36 lines


  • all-files
    • Moved common bits into namespace ::cgi::common
    • Updated references to things that were moved over


  • basic_request.hpp
    • adding close() overload that takes an error_code;
    • adding a clear() function so a request can be safely reused.


  • basic_request_acceptor.hpp
    • an acceptor now initialises itself by default (using default_init())
    • added protocol_service() function to get the underlying basic_protocol_service
    • accept() calls now use the endpoint, like Boost.Asio.


  • basic_sync_io_object.hpp
    • s/impl/implementation


  • common/form_parser.hpp
    • added name member, because every form part has a name (saves looking it up in a map every time)


  • connections/stdio.hpp
    • simplified write_some() a little.


  • detail/cgi_*_impl_base.hpp
    • cosmetic changes, removed old fluff (see source)


  • error.hpp
    • added a couple of new errors


  • fcgi/acceptor_service_impl.hpp
    • added default_init() function, which only works on linux for now.


  • fcgi/client.hpp
    • added close() overload that doesn't take an error_code


  • response.hpp
    • added resend() function, which sends the header+body regardless of the value of headers_terminated_

........

r43751 | drrngrvy | 2008-03-21 16:54:26 +0000 (Fri, 21 Mar 2008) | 1 line


Fixed url_decode() and added hex_to_char(), which should be used instead of url_decode(char, char) - it's more portable too.

........

r43753 | drrngrvy | 2008-03-21 16:57:07 +0000 (Fri, 21 Mar 2008) | 4 lines


  • Commented out some of the error logging used for testing (makes such a difference to speed).
  • Added clear() function so requests can be reused safely.
  • Added close() overload that takes an error_code
  • Cleaned up some old fluff

........

r43754 | drrngrvy | 2008-03-21 16:57:34 +0000 (Fri, 21 Mar 2008) | 1 line


Updated README

........

r43755 | drrngrvy | 2008-03-21 17:02:02 +0000 (Fri, 21 Mar 2008) | 2 lines


  • Added some compile tests and fixed the (two!) run tests.
  • Tried setting up tests using wget to verify the whole program (by checking its output when it's behind a server)

........

r43756 | drrngrvy | 2008-03-21 17:07:31 +0000 (Fri, 21 Mar 2008) | 2 lines


  • Added fcgi/amortization example
  • Modified fcgi/echo example to make it a bit cleaner

........

r43757 | drrngrvy | 2008-03-21 17:09:13 +0000 (Fri, 21 Mar 2008) | 2 lines


  • Added cgi/echo example
  • Modified/fixed/cleaned up amortization example

........

r43759 | drrngrvy | 2008-03-21 18:14:29 +0000 (Fri, 21 Mar 2008) | 1 line


Resolved conflict

........

r43760 | drrngrvy | 2008-03-21 18:17:06 +0000 (Fri, 21 Mar 2008) | 1 line


Adding basic example testing multipart forms.

........

r43761 | drrngrvy | 2008-03-21 18:18:07 +0000 (Fri, 21 Mar 2008) | 1 line


Remove reference to google/ctemplate jamfile.

........

r43762 | drrngrvy | 2008-03-21 18:20:32 +0000 (Fri, 21 Mar 2008) | 1 line


Adding build directory (trying to simplify generating requirements for examples/tests)

........

r43763 | drrngrvy | 2008-03-21 18:29:21 +0000 (Fri, 21 Mar 2008) | 1 line


Add common/form_parser.hpp (which isn't used for anything real yet, but is referenced in detail/.cgi_service_impl_base.hpp)

........

r43764 | drrngrvy | 2008-03-21 18:31:06 +0000 (Fri, 21 Mar 2008) | 1 line


Move header class into namespace ::cgi::common (other changes backed out)

........

r43765 | drrngrvy | 2008-03-21 18:43:08 +0000 (Fri, 21 Mar 2008) | 1 line


Fix cookie.cpp

........

(No files)

Note: See TracChangeset for help on using the changeset viewer.