Commit 0831301c authored by baire's avatar baire
Browse files

support case-insensitive matching of header names

parent 72e7d20f
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -582,8 +582,8 @@ public:

	static const Entry& GetByName (const std::string& key)
	{
		const std::map<std::string, Entry*>& m = msInstance.mMapName;
		std::map <std::string, Entry*>::const_iterator it = m.find (key);
		const mMapName_t& m = msInstance.mMapName;
		mMapName_t::const_iterator it = m.find (key);
		if (it != m.end()) {
			return *it->second;
		} else {
@@ -660,8 +660,17 @@ private:
	std::list<Entry>		mEntries;
	Entry*				mUndef;

	class StringCaseInsensitiveComparator
	{
	public:
		bool operator() (const std::string& a, const std::string& b) const
		{
			return (strcasecmp (a.c_str(), b.c_str()) < 0);
		}
	};

	std::map <std::string, Entry*>	mMapName;
	typedef std::map <std::string, Entry*, StringCaseInsensitiveComparator>	mMapName_t;
	mMapName_t			mMapName;
	std::map <std::string, Entry*>	mMapIdFieldName;
	std::map <int, Entry*>		mMapIdMessageHeader;