| 44 | } |
| 45 | |
| 46 | int RequestCache::Hash(const Request& req, uint64_t* key) { |
| 47 | uint64_t log_id = req.log_id(); |
| 48 | bool profile_server = req.profile_server(); |
| 49 | Request* r = const_cast<Request*>(&req); |
| 50 | r->clear_log_id(); |
| 51 | r->clear_profile_server(); |
| 52 | std::string buf = req.SerializeAsString(); |
| 53 | *key = std::hash<std::string>{}(buf); |
| 54 | r->set_log_id(log_id); |
| 55 | r->set_profile_server(profile_server); |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | int RequestCache::Get(const Request& req, Response* res, uint64_t* key) { |
| 60 | if (!Enabled()) { |
nothing calls this directly
no outgoing calls
no test coverage detected