fixed various bugs (see SF tracker)

This commit is contained in:
Guenter Obiltschnig 2008-09-16 17:26:28 +00:00
parent 5b26a62961
commit 57762a2cfc
19 changed files with 97 additions and 28 deletions

View File

@ -164,6 +164,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mtd.lib"/>
<Tool
Name="VCMIDLTool"/>
@ -217,6 +218,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mt.lib"/>
<Tool
Name="VCMIDLTool"/>

View File

@ -256,6 +256,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mt.lib"
/>
<Tool
@ -327,6 +328,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mtd.lib"
/>
<Tool

View File

@ -249,6 +249,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mt.lib"
/>
<Tool
@ -318,6 +319,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mtd.lib"
/>
<Tool

View File

@ -89,7 +89,7 @@ public:
typedef typename Bucket::iterator BucketIterator;
typedef typename BucketVec::iterator BucketVecIterator;
class ConstIterator
class ConstIterator: public std::iterator<std::forward_iterator_tag, Value>
{
public:
ConstIterator()

View File

@ -115,7 +115,10 @@ void AsyncChannel::close()
{
while (!_queue.empty()) Thread::sleep(100);
do { _queue.wakeUpAll(); }
do
{
_queue.wakeUpAll();
}
while (!_thread.tryJoin(100));
}
}

View File

@ -166,6 +166,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mtd.lib"/>
<Tool
Name="VCMIDLTool"/>
@ -219,6 +220,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mt.lib"/>
<Tool
Name="VCMIDLTool"/>

View File

@ -258,6 +258,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mt.lib"
/>
<Tool
@ -329,6 +330,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mtd.lib"
/>
<Tool

View File

@ -249,6 +249,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mt.lib"
/>
<Tool
@ -318,6 +319,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\Poco$(ProjectName)mtd.lib"
/>
<Tool

View File

@ -1,7 +1,7 @@
//
// HTTPCookie.h
//
// $Id: //poco/svn/Net/include/Poco/Net/HTTPCookie.h#2 $
// $Id: //poco/1.3/Net/include/Poco/Net/HTTPCookie.h#1 $
//
// Library: Net
// Package: HTTP
@ -157,6 +157,12 @@ public:
/// Returns the maximum age in seconds for
/// the cookie.
void setHttpOnly(bool flag = true);
/// Sets the HttpOnly flag for the cookie.
bool getHttpOnly() const;
/// Returns true iff the cookie's HttpOnly flag is set.
std::string toString() const;
/// Returns a string representation of the cookie,
/// suitable for use in a Set-Cookie header.
@ -170,6 +176,7 @@ private:
std::string _path;
bool _secure;
int _maxAge;
bool _httpOnly;
};
@ -224,6 +231,12 @@ inline int HTTPCookie::getMaxAge() const
}
inline bool HTTPCookie::getHttpOnly() const
{
return _httpOnly;
}
} } // namespace Poco::Net

View File

@ -124,6 +124,7 @@ void HTMLForm::addPart(const std::string& name, PartSource* pSource)
void HTMLForm::load(const HTTPRequest& request, std::istream& requestBody, PartHandler& handler)
{
clear();
if (request.getMethod() == HTTPRequest::HTTP_POST)
{
std::string mediaType;

View File

@ -1,7 +1,7 @@
//
// HTTPCookie.cpp
//
// $Id: //poco/svn/Net/src/HTTPCookie.cpp#2 $
// $Id: //poco/1.3/Net/src/HTTPCookie.cpp#2 $
//
// Library: Net
// Package: HTTP
@ -63,7 +63,8 @@ namespace Net {
HTTPCookie::HTTPCookie():
_version(0),
_secure(false),
_maxAge(-1)
_maxAge(-1),
_httpOnly(false)
{
}
@ -72,7 +73,8 @@ HTTPCookie::HTTPCookie(const std::string& name):
_version(0),
_name(name),
_secure(false),
_maxAge(-1)
_maxAge(-1),
_httpOnly(false)
{
}
@ -80,7 +82,8 @@ HTTPCookie::HTTPCookie(const std::string& name):
HTTPCookie::HTTPCookie(const NameValueCollection& nvc):
_version(0),
_secure(false),
_maxAge(-1)
_maxAge(-1),
_httpOnly(false)
{
for (NameValueCollection::ConstIterator it = nvc.begin(); it != nvc.end(); ++it)
{
@ -117,6 +120,10 @@ HTTPCookie::HTTPCookie(const NameValueCollection& nvc):
{
setVersion(NumberParser::parse(value));
}
else if (icompare(name, "HttpOnly") == 0)
{
setHttpOnly(true);
}
else
{
setName(name);
@ -131,7 +138,8 @@ HTTPCookie::HTTPCookie(const std::string& name, const std::string& value):
_name(name),
_value(value),
_secure(false),
_maxAge(-1)
_maxAge(-1),
_httpOnly(false)
{
}
@ -144,7 +152,8 @@ HTTPCookie::HTTPCookie(const HTTPCookie& cookie):
_domain(cookie._domain),
_path(cookie._path),
_secure(cookie._secure),
_maxAge(cookie._maxAge)
_maxAge(cookie._maxAge),
_httpOnly(cookie._httpOnly)
{
}
@ -158,14 +167,15 @@ HTTPCookie& HTTPCookie::operator = (const HTTPCookie& cookie)
{
if (&cookie != this)
{
_version = cookie._version;
_name = cookie._name;
_value = cookie._value;
_comment = cookie._comment;
_domain = cookie._domain;
_path = cookie._path;
_secure = cookie._secure;
_maxAge = cookie._maxAge;
_version = cookie._version;
_name = cookie._name;
_value = cookie._value;
_comment = cookie._comment;
_domain = cookie._domain;
_path = cookie._path;
_secure = cookie._secure;
_maxAge = cookie._maxAge;
_httpOnly = cookie._httpOnly;
}
return *this;
}
@ -219,6 +229,12 @@ void HTTPCookie::setMaxAge(int maxAge)
}
void HTTPCookie::setHttpOnly(bool flag)
{
_httpOnly = flag;
}
std::string HTTPCookie::toString() const
{
std::string result(_name);
@ -248,6 +264,10 @@ std::string HTTPCookie::toString() const
{
result.append("; secure");
}
if (_httpOnly)
{
result.append("; HttpOnly");
}
}
else
{
@ -283,6 +303,10 @@ std::string HTTPCookie::toString() const
{
result.append("; secure");
}
if (_httpOnly)
{
result.append("; HttpOnly");
}
result.append("; Version=\"1\"");
}
return result;

View File

@ -1,7 +1,7 @@
//
// HTTPCookieTest.cpp
//
// $Id: //poco/svn/Net/testsuite/src/HTTPCookieTest.cpp#2 $
// $Id: //poco/1.3/Net/testsuite/src/HTTPCookieTest.cpp#1 $
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
@ -63,6 +63,9 @@ void HTTPCookieTest::testCookie()
assert (cookie.toString() == "name=value; domain=appinf.com; path=/");
cookie.setSecure(true);
assert (cookie.toString() == "name=value; domain=appinf.com; path=/; secure");
cookie.setHttpOnly(true);
assert (cookie.toString() == "name=value; domain=appinf.com; path=/; secure; HttpOnly");
cookie.setHttpOnly(false);
cookie.setVersion(1);
assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; secure; Version=\"1\"");
@ -70,6 +73,9 @@ void HTTPCookieTest::testCookie()
cookie.setSecure(false);
cookie.setMaxAge(100);
assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Max-Age=\"100\"; Version=\"1\"");
cookie.setHttpOnly(true);
assert (cookie.toString() == "name=\"value\"; Comment=\"comment\"; Domain=\"appinf.com\"; Path=\"/\"; Max-Age=\"100\"; HttpOnly; Version=\"1\"");
}

View File

@ -166,6 +166,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\PocoNetSSLmtd.lib"/>
<Tool
Name="VCMIDLTool"/>
@ -219,6 +220,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\PocoNetSSLmt.lib"/>
<Tool
Name="VCMIDLTool"/>

View File

@ -254,6 +254,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\PocoNetSSLmtd.lib"
/>
<Tool
@ -329,6 +330,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\PocoNetSSLmt.lib"
/>
<Tool

View File

@ -245,6 +245,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\PocoNetSSLmtd.lib"
/>
<Tool
@ -318,6 +319,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="ws2_32.lib"
OutputFile="..\lib\PocoNetSSLmt.lib"
/>
<Tool

View File

@ -1,7 +1,7 @@
//
// XMLString.h
//
// $Id: //poco/svn/XML/include/Poco/XML/XMLString.h#2 $
// $Id: //poco/1.3/XML/include/Poco/XML/XMLString.h#1 $
//
// Library: XML
// Package: XML
@ -75,6 +75,8 @@ namespace XML {
XMLString toXMLString(const std::string& str);
/// Converts an UTF-8 encoded string into an
/// XMLString
#define XML_LIT(lit) L##lit
#elif defined(XML_UNICODE)
@ -95,6 +97,8 @@ namespace XML {
{
return str;
}
#define XML_LIT(lit) lit
#endif

View File

@ -1,7 +1,7 @@
//
// AttributesImpl.cpp
//
// $Id: //poco/svn/XML/src/AttributesImpl.cpp#3 $
// $Id: //poco/1.3/XML/src/AttributesImpl.cpp#2 $
//
// Library: XML
// Package: SAX
@ -44,14 +44,14 @@ namespace XML {
AttributesImpl::AttributesImpl()
{
_empty.specified = false;
_empty.type = "CDATA";
_empty.type = XML_LIT("CDATA");
}
AttributesImpl::AttributesImpl(const Attributes& attributes)
{
_empty.specified = false;
_empty.type = "CDATA";
_empty.type = XML_LIT("CDATA");
setAttributes(attributes);
}

View File

@ -1,7 +1,7 @@
//
// NamespaceStrategy.cpp
//
// $Id: //poco/svn/XML/src/NamespaceStrategy.cpp#3 $
// $Id: //poco/1.3/XML/src/NamespaceStrategy.cpp#2 $
//
// Library: XML
// Package: XML
@ -82,13 +82,13 @@ void NamespaceStrategy::splitName(const XMLChar* qname, XMLString& uri, XMLStrin
if (*p)
prefix.assign(++p);
else
prefix.assign("");
prefix.assign(XML_LIT(""));
}
else
{
uri.assign("");
uri.assign(XML_LIT(""));
localName = qname;
prefix.assign("");
prefix.assign(XML_LIT(""));
}
}

View File

@ -1,7 +1,7 @@
//
// ParserEngine.cpp
//
// $Id: //poco/svn/XML/src/ParserEngine.cpp#3 $
// $Id: //poco/1.3/XML/src/ParserEngine.cpp#4 $
//
// Library: XML
// Package: XML
@ -720,7 +720,7 @@ int ParserEngine::handleUnknownEncoding(void* encodingHandlerData, const XML_Cha
if (it != pThis->_encodings.end())
knownEncoding = it->second;
else
knownEncoding = Poco::TextEncoding::find(encoding);
knownEncoding = Poco::TextEncoding::find(fromXMLString(encoding));
if (knownEncoding)
{