- fixed SF#3489816: MessageHeader::MAX_VALUE_LENGTH too small
- port rev. 1970 from 1.4.4: added timeout to SocketReactorTest::testSocketConnectorFail() to avoid the test from running for a very long time on Linux/OS X
This commit is contained in:
Родитель
a77bfefd69
Коммит
4652c7cb8b
|
@ -167,7 +167,7 @@ private:
|
|||
/// Limits for basic sanity checks when reading a header
|
||||
{
|
||||
MAX_NAME_LENGTH = 256,
|
||||
MAX_VALUE_LENGTH = 4096,
|
||||
MAX_VALUE_LENGTH = 8192,
|
||||
DFL_FIELD_LIMIT = 100
|
||||
};
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ void MessageHeaderTest::testReadInvalid1()
|
|||
void MessageHeaderTest::testReadInvalid2()
|
||||
{
|
||||
std::string s("name1: value1\r\nname2: ");
|
||||
s.append(8000, 'x');
|
||||
s.append(9000, 'x');
|
||||
std::istringstream istr(s);
|
||||
MessageHeader mh;
|
||||
try
|
||||
|
|
|
@ -264,6 +264,7 @@ namespace
|
|||
_failed(false),
|
||||
_shutdown(false)
|
||||
{
|
||||
reactor.addEventHandler(socket(), Observer<FailConnector, TimeoutNotification>(*this, &FailConnector::onTimeout));
|
||||
reactor.addEventHandler(socket(), Observer<FailConnector, ShutdownNotification>(*this, &FailConnector::onShutdown));
|
||||
}
|
||||
|
||||
|
@ -273,6 +274,13 @@ namespace
|
|||
_shutdown = true;
|
||||
}
|
||||
|
||||
void onTimeout(TimeoutNotification* pNf)
|
||||
{
|
||||
pNf->release();
|
||||
_failed = true;
|
||||
reactor()->stop();
|
||||
}
|
||||
|
||||
void onError(int error)
|
||||
{
|
||||
_failed = true;
|
||||
|
@ -326,6 +334,7 @@ void SocketReactorTest::testSocketReactor()
|
|||
void SocketReactorTest::testSocketConnectorFail()
|
||||
{
|
||||
SocketReactor reactor;
|
||||
reactor.setTimeout(Poco::Timespan(3, 0));
|
||||
SocketAddress sa("192.168.168.192", 12345);
|
||||
FailConnector connector(sa, reactor);
|
||||
assert (!connector.failed());
|
||||
|
|
Загрузка…
Ссылка в новой задаче