| 149 | } |
| 150 | |
| 151 | boost::optional<seconds32> http_parser::header_duration(string_view const key) const |
| 152 | { |
| 153 | // at least GCC-5.4 for ARM (on travis) has a libstdc++ whose debug map$ |
| 154 | // doesn't seem to support transparent comparators$ |
| 155 | #if ! defined _GLIBCXX_DEBUG |
| 156 | auto const i = m_header.find(key); |
| 157 | #else |
| 158 | auto const i = m_header.find(std::string(key)); |
| 159 | #endif |
| 160 | if (i == m_header.end()) return boost::none; |
| 161 | auto const val = std::atol(i->second.c_str()); |
| 162 | if (val <= 0) return boost::none; |
| 163 | return seconds32(val); |
| 164 | } |
| 165 | |
| 166 | http_parser::~http_parser() = default; |
| 167 | |