MCPcopy Create free account
hub / github.com/arvidn/libtorrent / header_duration

Method header_duration

src/http_parser.cpp:151–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

TORRENT_TESTFunction · 0.80
handle_errorMethod · 0.80
on_receiveMethod · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by 1

TORRENT_TESTFunction · 0.64