mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
Merge branch 'poco-1.10.0' into devel
This commit is contained in:
commit
b884f04d5c
3
JWT/dependencies
Normal file
3
JWT/dependencies
Normal file
@ -0,0 +1,3 @@
|
||||
Foundation
|
||||
JSON
|
||||
Crypto
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 30 KiB |
@ -69,7 +69,7 @@ and a pointer to a member function. The event can be fired by calling
|
||||
#include <iostream>
|
||||
|
||||
using Poco::BasicEvent;
|
||||
using Poco::Delegate;
|
||||
using Poco::delegate;
|
||||
|
||||
class Source
|
||||
{
|
||||
@ -96,13 +96,11 @@ and a pointer to a member function. The event can be fired by calling
|
||||
Source source;
|
||||
Target target;
|
||||
|
||||
source.theEvent += Delegate<Target, int>(
|
||||
&target, &Target::onEvent);
|
||||
source.theEvent += delegate(&target, &Target::onEvent);
|
||||
|
||||
source.fireEvent(42);
|
||||
|
||||
source.theEvent -= Delegate<Target, int>(
|
||||
&target, &Target::onEvent);
|
||||
source.theEvent -= delegate(&target, &Target::onEvent);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -315,12 +313,11 @@ server.
|
||||
{
|
||||
}
|
||||
|
||||
void handleRequest(HTTPServerRequest& request,
|
||||
HTTPServerResponse& response)
|
||||
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
|
||||
{
|
||||
Application& app = Application::instance();
|
||||
app.logger().information("Request from "
|
||||
+ request.clientAddress().toString());
|
||||
app.logger().information("Request from %s",
|
||||
request.clientAddress().toString());
|
||||
|
||||
Timestamp now;
|
||||
std::string dt(DateTimeFormatter::format(now, _format));
|
||||
@ -350,8 +347,7 @@ server.
|
||||
{
|
||||
}
|
||||
|
||||
HTTPRequestHandler* createRequestHandler(
|
||||
const HTTPServerRequest& request)
|
||||
HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request)
|
||||
{
|
||||
if (request.getURI() == "/")
|
||||
return new TimeRequestHandler(_format);
|
||||
@ -365,15 +361,6 @@ server.
|
||||
|
||||
class HTTPTimeServer: public Poco::Util::ServerApplication
|
||||
{
|
||||
public:
|
||||
HTTPTimeServer(): _helpRequested(false)
|
||||
{
|
||||
}
|
||||
|
||||
~HTTPTimeServer()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
void initialize(Application& self)
|
||||
{
|
||||
@ -381,11 +368,6 @@ server.
|
||||
ServerApplication::initialize(self);
|
||||
}
|
||||
|
||||
void uninitialize()
|
||||
{
|
||||
ServerApplication::uninitialize();
|
||||
}
|
||||
|
||||
void defineOptions(OptionSet& options)
|
||||
{
|
||||
ServerApplication::defineOptions(options);
|
||||
@ -398,8 +380,7 @@ server.
|
||||
this, &HTTPTimeServer::handleHelp)));
|
||||
}
|
||||
|
||||
void handleHelp(const std::string& name,
|
||||
const std::string& value)
|
||||
void handleHelp(const std::string& name, const std::string& value)
|
||||
{
|
||||
HelpFormatter helpFormatter(options());
|
||||
helpFormatter.setCommand(commandName());
|
||||
@ -415,14 +396,15 @@ server.
|
||||
{
|
||||
if (!_helpRequested)
|
||||
{
|
||||
unsigned short port = (unsigned short)
|
||||
config().getInt("HTTPTimeServer.port", 9980);
|
||||
std::string format(
|
||||
config().getString("HTTPTimeServer.format",
|
||||
unsigned short port = static_cast<unsigned short>(
|
||||
config().getInt("HTTPTimeServer.port", 9980));
|
||||
std::string format(config().getString(
|
||||
"HTTPTimeServer.format",
|
||||
DateTimeFormat::SORTABLE_FORMAT));
|
||||
|
||||
ServerSocket svs(port);
|
||||
HTTPServer srv(new TimeRequestHandlerFactory(format),
|
||||
HTTPServer srv(
|
||||
new TimeRequestHandlerFactory(format),
|
||||
svs, new HTTPServerParams);
|
||||
srv.start();
|
||||
waitForTerminationRequest();
|
||||
@ -432,7 +414,7 @@ server.
|
||||
}
|
||||
|
||||
private:
|
||||
bool _helpRequested;
|
||||
bool _helpRequested = false;
|
||||
};
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -1,9 +1,11 @@
|
||||
Crypto
|
||||
NetSSL_OpenSSL
|
||||
JWT
|
||||
Data
|
||||
Data/SQLite
|
||||
Data/ODBC
|
||||
Data/MySQL
|
||||
Data/PostgreSQL
|
||||
Zip
|
||||
PageCompiler
|
||||
PageCompiler/File2Page
|
||||
|
Loading…
Reference in New Issue
Block a user