From: Dean M. B. <mik...@gm...> - 2010-12-01 01:02:33
|
Hi Tim, On Wed, Dec 1, 2010 at 7:41 AM, Timothy Stewart <tim...@gm...> wrote: > I apologize in advance, my C++ is fairly weak. I was trying to make a > simple http server using cpp netlib v.0.8. The first problem I ran into was > the undefined "_or" problem, which I got around by including foreach.hpp (I > believe the other thread recommended #include <boost/mpl/or.hpp> which I'm > sure is a more direct solution). Yes, that should really be addressed in a point release. I'll commit that change and package up 0.8.1 appropriately. > > // CPPNetLibTest.cpp : Defines the entry point for the console application. > // > #include "stdafx.h" > #include <boost/foreach.hpp> > #include <boost/network/include/http/server.hpp> > > struct handler_type; > typedef boost::network::http::server<handler_type> http_server; > struct handler_type { > void operator()( > http_server::request const & request, > http_server::response & response > ) { > std::string pathstr = path(request); > // do something here depending on the path requested. Here, instead of path(request), do destination(request). I'll try to make the above work too, I hadn't thought about the symmetry between a client request and a server request. I'll see if that can make it into 0.8.1 too. HTH -- Dean Michael Berris deanberris.com |