diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-08-27 17:34:07 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-08-27 17:34:07 (GMT) |
commit | 7f931ab66d8294a20267f1008540532828ab0d20 (patch) | |
tree | c6bd3a2a33ac0f099b1624db5f0ec7831d71dc22 /Swiften/JID/JID.cpp | |
parent | 8da2a30bab8640944de750abd1ba26f8543f12ca (diff) | |
parent | 8dbae452004e7bc3c3a6e855f365b9bb348e8f2d (diff) | |
download | swift-contrib-7f931ab66d8294a20267f1008540532828ab0d20.zip swift-contrib-7f931ab66d8294a20267f1008540532828ab0d20.tar.bz2 |
Merge branch 'swift-1.x'
* swift-1.x:
Update last used certificate file correctly.
Mark JIDs with empty domains as invalid when StringPrep cache is disabled.
Added StringPrep unit test.
Diffstat (limited to 'Swiften/JID/JID.cpp')
-rw-r--r-- | Swiften/JID/JID.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Swiften/JID/JID.cpp b/Swiften/JID/JID.cpp index 653ac6a..66d6ff6 100644 --- a/Swiften/JID/JID.cpp +++ b/Swiften/JID/JID.cpp @@ -173,10 +173,6 @@ void JID::nameprepAndSetComponents(const std::string& node, const std::string& d r.first->second = StringPrep::getPrepared(domain, StringPrep::XMPPNodePrep); } domain_ = r.first->second; - if (domain_.empty()) { - valid_ = false; - return; - } r = resourcePrepCache.insert(std::make_pair(resource, std::string())); if (r.second) { @@ -184,6 +180,11 @@ void JID::nameprepAndSetComponents(const std::string& node, const std::string& d } resource_ = r.first->second; #endif + + if (domain_.empty()) { + valid_ = false; + return; + } } catch (const std::exception&) { valid_ = false; |