Исправлен хэш UA
This commit is contained in:
@@ -2,12 +2,6 @@ package ru.serega6531.packmate.repository;
|
|||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import ru.serega6531.packmate.model.Pattern;
|
import ru.serega6531.packmate.model.Pattern;
|
||||||
import ru.serega6531.packmate.model.enums.PatternDirectionType;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface PatternRepository extends JpaRepository<Pattern, Integer> {
|
public interface PatternRepository extends JpaRepository<Pattern, Integer> {
|
||||||
|
|
||||||
List<Pattern> findAllByTypeEqualsOrTypeEquals(PatternDirectionType type, PatternDirectionType both);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,13 +68,15 @@ public class PatternService {
|
|||||||
String content = new String(bytes);
|
String content = new String(bytes);
|
||||||
final java.util.regex.Pattern regex = compilePattern(pattern);
|
final java.util.regex.Pattern regex = compilePattern(pattern);
|
||||||
final Matcher matcher = regex.matcher(content);
|
final Matcher matcher = regex.matcher(content);
|
||||||
|
int startPos = 0;
|
||||||
|
|
||||||
while (matcher.find()) {
|
while (matcher.find(startPos)) {
|
||||||
found.add(FoundPattern.builder()
|
found.add(FoundPattern.builder()
|
||||||
.patternId(pattern.getId())
|
.patternId(pattern.getId())
|
||||||
.startPosition(matcher.start())
|
.startPosition(matcher.start())
|
||||||
.endPosition(matcher.end())
|
.endPosition(matcher.end())
|
||||||
.build());
|
.build());
|
||||||
|
startPos = matcher.end() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class StreamService {
|
|||||||
private final boolean ignoreEmptyPackets;
|
private final boolean ignoreEmptyPackets;
|
||||||
|
|
||||||
private final byte[] GZIP_HEADER = {0x1f, (byte) 0x8b, 0x08};
|
private final byte[] GZIP_HEADER = {0x1f, (byte) 0x8b, 0x08};
|
||||||
private final java.util.regex.Pattern userAgentPattern = java.util.regex.Pattern.compile("User-Agent: (.+)\\n");
|
private final java.util.regex.Pattern userAgentPattern = java.util.regex.Pattern.compile("User-Agent: (.+)\\r\\n");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public StreamService(StreamRepository repository,
|
public StreamService(StreamRepository repository,
|
||||||
|
|||||||
@@ -20,4 +20,5 @@ account-login: BinaryBears
|
|||||||
account-password: 123456
|
account-password: 123456
|
||||||
udp-stream-timeout: 20 # секунд
|
udp-stream-timeout: 20 # секунд
|
||||||
tcp-stream-timeout: 40 # секунд
|
tcp-stream-timeout: 40 # секунд
|
||||||
timeout-stream-check-interval: 10 # секунд
|
timeout-stream-check-interval: 10 # секунд
|
||||||
|
ignore-empty-packets: true
|
||||||
Reference in New Issue
Block a user