| 74 | } |
| 75 | |
| 76 | bool Cache::lookup(const string &s) { |
| 77 | static const string default_value("XXX"); |
| 78 | // Alive IR is bulky, so send a hash of it over to the cache. If |
| 79 | // this still uses too much RAM, the next step will be to use a |
| 80 | // Bloom filter |
| 81 | string remote_data, crc_string = to_string(string_crc(s)); |
| 82 | if (remote_get(crc_string, remote_data, ctx)) { |
| 83 | assert(remote_data == default_value); |
| 84 | return true; |
| 85 | } else { |
| 86 | remote_set(crc_string, default_value, ctx); |
| 87 | return false; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | Cache::Cache(unsigned port, bool allow_version_mismatch) { |
| 92 | const char *hostname = "127.0.0.1"; |
nothing calls this directly
no test coverage detected