MCPcopy Create free account
hub / github.com/ByConity/ByConity / parseSessionTimeout

Function parseSessionTimeout

src/Server/HTTPHandler.cpp:226–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224
225
226static size_t parseSessionTimeout(const Poco::Util::AbstractConfiguration & config, const HTMLForm & params)
227{
228 unsigned session_timeout = config.getInt("default_session_timeout", 60);
229
230 if (params.has("session_timeout"))
231 {
232 unsigned max_session_timeout = config.getUInt("max_session_timeout", 3600);
233 std::string session_timeout_str = params.get("session_timeout");
234
235 ReadBufferFromString buf(session_timeout_str);
236 if (!tryReadIntText(session_timeout, buf) || !buf.eof())
237 throw Exception("Invalid session timeout: '" + session_timeout_str + "'", ErrorCodes::INVALID_SESSION_TIMEOUT);
238
239 if (session_timeout > max_session_timeout)
240 throw Exception(ErrorCodes::INVALID_SESSION_TIMEOUT,
241 "Session timeout '{}' is larger than max_session_timeout: {}. Maximum session timeout could be modified in configuration file.",
242 session_timeout_str, max_session_timeout);
243 }
244
245 return session_timeout;
246}
247
248
249void HTTPHandler::pushDelayedResults(Output & used_output)

Callers 1

processQueryMethod · 0.85

Calls 7

tryReadIntTextFunction · 0.85
ExceptionClass · 0.50
getIntMethod · 0.45
hasMethod · 0.45
getUIntMethod · 0.45
getMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected