Quellcode durchsuchen

flush mitm passthru cache when changing showBlockStats

pull/43/head
Jonathan Cobb vor 4 Jahren
Ursprung
Commit
b438b3a5de
1 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen
  1. +5
    -0
      bubble-server/src/main/java/bubble/service/cloud/StandardDeviceIdService.java

+ 5
- 0
bubble-server/src/main/java/bubble/service/cloud/StandardDeviceIdService.java Datei anzeigen

@@ -56,6 +56,10 @@ public class StandardDeviceIdService implements DeviceIdService {
// used in dnscrypt-proxy to determine how to respond to blocked requests
public static final String REDIS_KEY_DEVICE_REJECT_WITH = "bubble_device_reject_with_";

// used in mitmproxy to optimize passthru requests
// we flush keys with this prefix when changing showBlockStats flag
public static final String REDIS_KEY_CHUNK_FILTER_PASS = "__chunk_filter_pass__";

@Autowired private DeviceDAO deviceDAO;
@Autowired private AccountDAO accountDAO;
@Autowired private RedisService redis;
@@ -154,6 +158,7 @@ public class StandardDeviceIdService implements DeviceIdService {

public void initBlockStats (Account account) {
redis.set_plaintext(REDIS_KEY_ACCOUNT_SHOW_BLOCK_STATS+account.getUuid(), Boolean.toString(account.showBlockStats()));
redis.del_withPrefix(REDIS_KEY_CHUNK_FILTER_PASS);
for (Device device : deviceDAO.findByAccount(account.getUuid())) {
if (account.showBlockStats()) {
showBlockStats(device);


Laden…
Abbrechen
Speichern