|
Boost-Commit : |
From: lists.drrngrvy_at_[hidden]
Date: 2008-03-12 13:07:01
Author: drrngrvy
Date: 2008-03-12 13:07:00 EDT (Wed, 12 Mar 2008)
New Revision: 43579
URL: http://svn.boost.org/trac/boost/changeset/43579
Log:
Minor cosmetic update for hello world example.
Text files modified:
sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/acgi/hello_world/main.cpp | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/acgi/hello_world/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/acgi/hello_world/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/libs/cgi/example/acgi/hello_world/main.cpp 2008-03-12 13:07:00 EDT (Wed, 12 Mar 2008)
@@ -11,20 +11,22 @@
//
#include <boost/cgi/acgi.hpp>
+#include <boost/cgi/return.hpp>
using namespace std;
using namespace boost::acgi;
int main()
{
- service srv;
- request req(srv);
- response resp;
+ service s; // This becomes useful with async operations.
+ request req(s); // Our request (POST data won't be parsed yet).
+ response resp; // A response object to make our lives easier.
+ // This is a minimal response. The content_type(...) may go before or after
+ // the response text.
resp<< content_type("text/html")
<< "Hello there, universe.";
- resp.send(req.client());
-
- return 0;
+ // Leave this function, after sending the response and closing the request.
+ return_(resp, req, 0); // Note the underscore: returns "0" to the OS.
}
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