Merge pull request #1176 from bettercap/reduce_overhead

Reduce overhead for proxied HTTP/DNS packets
This commit is contained in:
Simone Margaritelli 2025-03-13 14:07:43 +01:00 committed by GitHub
commit fc02767e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 12 deletions

View file

@ -355,3 +355,11 @@ func (j *JSQuery) WasModified() bool {
// check if any of the fields has been changed
return j.NewHash() != j.refHash
}
func (j *JSQuery) CheckIfModifiedAndUpdateHash() bool {
// check if query was changed and update its hash
newHash := j.NewHash()
wasModified := j.refHash != newHash
j.refHash = newHash
return wasModified
}