HTTPServer::HTTPServer should take a AutoPtr<HTTPServerParams> argument instead of a raw HTTPServerParams* argument. Consider what happens in the following code snippet:
HTTPServerParams* params = new HTTPServerParams;
params->setMaxThreads( -42 );
HTTPServer server( my_handler, socket, params );
In this case, params->setMaxThreads() will throw an exception, which means that the HTTPServerParams object will be leaked. The obvious fix would be to declare an AutoPtr<HTTPServerParams> instead of a raw pointer, but alas, it still needs to be passed to HTTPServer::HTTPServer as a raw pointer, thus defeating the purose. There are workarounds to ensure that the HTTPServerParams object is freed if an exception is thrown before the HTTPServer object takes ownership, but they are complicated and difficult.
Evan <emezeske zzz@zzz="" sunedison="" zzz.zzz="" com="">