mirror of https://github.com/aria2/aria2
2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/HttpHeader.cc (get): Rewritten.pull/1/head
parent
e1c1c010b8
commit
7235f2657f
|
@ -1,3 +1,7 @@
|
|||
2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
* src/HttpHeader.cc (get): Rewritten.
|
||||
|
||||
2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Make HttpHeader::getFirst(...) return const reference.
|
||||
|
|
|
@ -94,10 +94,17 @@ const std::string& HttpHeader::getFirst(const std::string& name) const {
|
|||
|
||||
std::deque<std::string> HttpHeader::get(const std::string& name) const {
|
||||
std::deque<std::string> v;
|
||||
|
||||
std::string n(Util::toLower(name));
|
||||
for(std::multimap<std::string, std::string>::const_iterator i = table.find(n);
|
||||
i != table.end() && (*i).first == n; ++i) {
|
||||
v.push_back((*i).second);
|
||||
|
||||
std::multimap<std::string, std::string>::const_iterator first =
|
||||
table.lower_bound(n);
|
||||
std::multimap<std::string, std::string>::const_iterator last =
|
||||
table.upper_bound(n);
|
||||
|
||||
while(first != last) {
|
||||
v.push_back((*first).second);
|
||||
++first;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue