From fc5e685fdf2a82901556322801b74da1a171b229 Mon Sep 17 00:00:00 2001 From: Tijme Gommers Date: Thu, 24 May 2018 15:26:57 +0200 Subject: [PATCH] Extra docblocks. --- extension/Extension.py | 2 +- extension/GraphWave.py | 2 +- extension/GraphWaveHttpListener.py | 9 +++++---- extension/GraphWaveResponse.py | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/extension/Extension.py b/extension/Extension.py index 80b5a32..36ed15e 100644 --- a/extension/Extension.py +++ b/extension/Extension.py @@ -187,7 +187,7 @@ def burpThreadLooper(self): self.shouldRefreshInterface = False Platform.runLater(ExtensionRunnable(self.refreshInterfaceFunc)) - threading.Timer(0.5, self.burpThreadLooper).start() + threading.Timer(1.0, self.burpThreadLooper).start() def loadConfigFromJson(self): """Start loading config from JSON in the main thread.""" diff --git a/extension/GraphWave.py b/extension/GraphWave.py index 60b18fa..b9d4d17 100644 --- a/extension/GraphWave.py +++ b/extension/GraphWave.py @@ -222,7 +222,7 @@ def getMatchingPoints(self, response, properties): stylometry_value = 0 for response_in_graph in self.responses(): - similarity = response.getSimilarity(response_in_graph, response.url) + similarity = response.getSimilarity(response_in_graph) if similarity > self.options["mst"]: stylometry_count += 1 stylometry_value += similarity diff --git a/extension/GraphWaveHttpListener.py b/extension/GraphWaveHttpListener.py index c1eab6d..7f6be85 100644 --- a/extension/GraphWaveHttpListener.py +++ b/extension/GraphWaveHttpListener.py @@ -86,12 +86,14 @@ def processHttpMessage(self, toolFlag, messageIsRequest, requestResponse): response = self._helpers.analyzeResponse(requestResponse.getResponse()) html = self._helpers.bytesToString(requestResponse.getResponse()) - # self._lock.acquire() - if self.shouldContinueWithMessage(request, response, html): response = GraphWaveResponse(request.getUrl().toString(), html) - if self._graph.addResponse(response) == False: + # self._lock.acquire() + response_was_added = self._graph.addResponse(response) + # self._lock.release() + + if response_was_added == False: self._config.exclude(request.getUrl().toString()) else: self._config.include(request.getUrl().toString()) @@ -99,7 +101,6 @@ def processHttpMessage(self, toolFlag, messageIsRequest, requestResponse): self._config.include(request.getUrl().toString()) self._refreshInterface() - # self._lock.release() def shouldContinueWithMessage(self, request, response, html): """Check if a message could be ignored. A message can't be ignored if diff --git a/extension/GraphWaveResponse.py b/extension/GraphWaveResponse.py index f6c66a3..bccb0d4 100644 --- a/extension/GraphWaveResponse.py +++ b/extension/GraphWaveResponse.py @@ -89,7 +89,7 @@ def __ne__(self, other): return str(self) != str(other) - def getSimilarity(self, other, url): + def getSimilarity(self, other): """Check if the given response is similar to this response. Returns: