mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-09-06 15:07:11 +02:00
Update POCO library.
This commit is contained in:
@@ -72,7 +72,7 @@ void handleDataSSLrequest(DialogSocket& ds, bool ssl, Session::Ptr& sslSession)
|
||||
ds = sss;
|
||||
}
|
||||
}
|
||||
catch (Exception& exc)
|
||||
catch (Exception& exc)
|
||||
{
|
||||
std::cout << exc.displayText() << std::endl;
|
||||
}
|
||||
|
||||
+8
-8
@@ -37,10 +37,10 @@ public:
|
||||
Poco::UInt16 port() const;
|
||||
/// Returns the port the echo server is
|
||||
/// listening on.
|
||||
|
||||
|
||||
void run();
|
||||
/// Does the work.
|
||||
|
||||
|
||||
const std::string& lastCommand() const;
|
||||
/// Returns the last command received by the server.
|
||||
|
||||
@@ -53,28 +53,28 @@ public:
|
||||
|
||||
const std::vector<std::string>& lastCommands() const;
|
||||
/// Returns the last command received by the server.
|
||||
|
||||
|
||||
void addResponse(const std::string& response);
|
||||
/// Sets the next response returned by the server.
|
||||
|
||||
|
||||
void clearCommands();
|
||||
/// Clears all commands.
|
||||
|
||||
|
||||
void clearResponses();
|
||||
/// Clears all responses.
|
||||
|
||||
|
||||
void log(bool flag);
|
||||
/// Enables or disables logging to stdout.
|
||||
|
||||
Poco::Net::Session::Ptr getSslSession();
|
||||
void setSslSession(Poco::Net::Session::Ptr cSession);
|
||||
|
||||
|
||||
private:
|
||||
Poco::Net::ServerSocket _socket;
|
||||
Poco::Thread _thread;
|
||||
Poco::Event _ready;
|
||||
mutable Poco::FastMutex _mutex;
|
||||
bool _stop;
|
||||
std::atomic<bool> _stop;
|
||||
std::vector<std::string> _nextResponses;
|
||||
std::vector<std::string> _lastCommands;
|
||||
bool _acceptCommands;
|
||||
|
||||
+4
-3
@@ -37,9 +37,10 @@ public:
|
||||
{
|
||||
CppUnit::TestRunner runner;
|
||||
runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite());
|
||||
return runner.run(_targs) ? 0 : 1;
|
||||
CppUnitPocoExceptionText (exc);
|
||||
return runner.run(_targs, exc) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
void setup(int argc, char** argv)
|
||||
{
|
||||
init(1, argv);
|
||||
@@ -53,7 +54,7 @@ protected:
|
||||
loadConfiguration(); // load default configuration files, if present
|
||||
Poco::Util::Application::initialize(self);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
std::vector<std::string> _targs;
|
||||
};
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
#include "Poco/DateTimeFormat.h"
|
||||
#include "Poco/Thread.h"
|
||||
#include "HTTPSTestServer.h"
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -298,7 +297,7 @@ void HTTPSClientSessionTest::testInterop()
|
||||
StreamCopier::copyStream(rs, ostr);
|
||||
std::string str(ostr.str());
|
||||
assertTrue (str == "This is a test file for NetSSL.\n");
|
||||
assertTrue (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
|
||||
assertTrue (cert.commonName().find(".appinf.com") != std::string::npos);
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +318,7 @@ void HTTPSClientSessionTest::testProxy()
|
||||
StreamCopier::copyStream(rs, ostr);
|
||||
std::string str(ostr.str());
|
||||
assertTrue (str == "This is a test file for NetSSL.\n");
|
||||
assertTrue (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
|
||||
assertTrue (cert.commonName().find(".appinf.com") != std::string::npos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ void HTTPSTestServer::run()
|
||||
|
||||
bool HTTPSTestServer::requestComplete() const
|
||||
{
|
||||
return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") &&
|
||||
return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") &&
|
||||
(_lastRequest.find("\r\n\r\n") != std::string::npos)) ||
|
||||
(_lastRequest.find("\r\n0\r\n") != std::string::npos);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ std::string HTTPSTestServer::handleRequest() const
|
||||
std::string body(SMALL_BODY);
|
||||
response.append("HTTP/1.0 200 OK\r\n");
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n");
|
||||
response.append("Connection: Close\r\n");
|
||||
@@ -143,7 +143,7 @@ std::string HTTPSTestServer::handleRequest() const
|
||||
std::string body(LARGE_BODY);
|
||||
response.append("HTTP/1.0 200 OK\r\n");
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n");
|
||||
response.append("Connection: Close\r\n");
|
||||
@@ -171,7 +171,7 @@ std::string HTTPSTestServer::handleRequest() const
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
if (_lastRequest.find("Content-Length") != std::string::npos)
|
||||
{
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n");
|
||||
}
|
||||
@@ -192,13 +192,13 @@ std::string HTTPSTestServer::handleRequest() const
|
||||
response.append("HTTP/1.1 200 OK\r\n");
|
||||
response.append("Connection: keep-alive\r\n");
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n\r\n");
|
||||
response.append("HTTP/1.1 200 OK\r\n");
|
||||
response.append("Connection: Keep-Alive\r\n");
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n\r\n");
|
||||
response.append(body);
|
||||
@@ -214,7 +214,7 @@ std::string HTTPSTestServer::handleRequest() const
|
||||
response.append("HTTP/1.1 200 OK\r\n");
|
||||
response.append("Connection: close\r\n");
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n\r\n");
|
||||
}
|
||||
@@ -235,7 +235,7 @@ std::string HTTPSTestServer::handleRequest() const
|
||||
std::string body(SMALL_BODY);
|
||||
response.append("HTTP/1.0 200 OK\r\n");
|
||||
response.append("Content-Type: text/plain\r\n");
|
||||
response.append("Content-Length: ");
|
||||
response.append("Content-Length: ");
|
||||
response.append(NumberFormatter::format((int) body.size()));
|
||||
response.append("\r\n");
|
||||
response.append("Connection: Close\r\n");
|
||||
|
||||
@@ -36,15 +36,15 @@ public:
|
||||
Poco::UInt16 port() const;
|
||||
/// Returns the port the echo server is
|
||||
/// listening on.
|
||||
|
||||
|
||||
void run();
|
||||
/// Does the work.
|
||||
|
||||
|
||||
const std::string& lastRequest() const;
|
||||
/// Returns the last request.
|
||||
|
||||
static const std::string SMALL_BODY;
|
||||
static const std::string LARGE_BODY;
|
||||
static const std::string LARGE_BODY;
|
||||
|
||||
protected:
|
||||
bool requestComplete() const;
|
||||
@@ -54,7 +54,7 @@ private:
|
||||
Poco::Net::SecureServerSocket _socket;
|
||||
Poco::Thread _thread;
|
||||
Poco::Event _ready;
|
||||
bool _stop;
|
||||
std::atomic<bool> _stop;
|
||||
std::string _lastRequest;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ public:
|
||||
runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite());
|
||||
return runner.run(_targs) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
void setup(const std::vector<std::string>& args)
|
||||
{
|
||||
char* argv[] =
|
||||
{
|
||||
const_cast<char*>(args[0].c_str())
|
||||
};
|
||||
|
||||
|
||||
init(1, argv);
|
||||
for (std::size_t i = 0; i < args.size(); ++i)
|
||||
_targs.push_back(args[i]);
|
||||
@@ -58,7 +58,7 @@ protected:
|
||||
loadConfiguration(); // load default configuration files, if present
|
||||
Poco::Util::Application::initialize(self);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
std::vector<std::string> _targs;
|
||||
};
|
||||
|
||||
+2
-2
@@ -39,14 +39,14 @@ public:
|
||||
runner.run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
void initialize(Poco::Util::Application& self)
|
||||
{
|
||||
loadConfiguration(); // load default configuration files, if present
|
||||
Poco::Util::Application::initialize(self);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
std::vector<std::string> _targs;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user