Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8721 having some trouble #5769

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

jessemchung
Copy link

Overview

Briefly describe the purpose, goals, and changes or improvements made in this pull request.

Related Issues

Specify any related issues or pull requests by linking to them.

Checklist

  • Update help
  • Update changelog
  • Run ./gradlew spotlessApply for code formatting
  • Write tests
  • Check code coverage
  • Sign-off commits
  • Squash commits
  • Use a descriptive title

For more details, please refer to the developer rules and guidelines.

@jessemchung
Copy link
Author

@thc202 Hey, sorry to bother you, but we got pretty stuck trying to figure out the best way to fix this. We are stuck trying to get resumeScan to work in attackThread. It seems like it should just match 1 to 1 in the spider thing but it doesn't seem to be working that way. Sorry this whole file is a mess at the moment, we just have been trying to add comments in places to try to fix things but the main issue right now is in AttackThread.java

If you have any guidance on the matter, it would be really helpful. I think we are missing something to link the resumeScan function to the corrresponding component in the spider dependency.

Comment on lines +52 to +53
private boolean pauseAttack = false;
private boolean resumeAttack = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you have two variables for this? Either it's paused or not. Trying to keep track of 4 possible values is just a headache

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to find a good trigger for unpausing and I wasn't sure how to best have it trigger. Right now there is a check to see if it is stopped which triggers the stopscan feature and I needed things for pause and resume scan. The issue though was if I just check if pauseAttack is false, I risk causing trouble in the code where it will try to resume scan.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn’t paused false be the same as resumed true?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, starting out, both are false. This means it is just starting. But once the pause button is pressed, pause is true and resume is false and ideally pausing happens. Then, when resume happens, pause is false but resume is true which ideally should cause the app to resume instead of using start.

@@ -263,6 +263,7 @@ private JToggleButton getPauseScanButton() {
new ImageIcon(getClass().getResource("/resource/icon/16/131.png")));
pauseScanButton.setEnabled(false);
pauseScanButton.addActionListener(e -> pauseScan());
// something is amiss
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you futzing with token gen?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're trying to figure out other places that pause the Scan to try and see what can imitated with the resumescan feature. So we have a couple comments to mark things of interest

if (pauseAttack) {
LOGGER.debug("Attack paused manually");
// extension.notifyProgress(Progress.paused);
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These pause checks outside the "wait loops" should wait instead of return (which would behave like stopping).

@@ -121,7 +142,15 @@ public void run() {
if (this.stopAttack) {
spiderScan.stopScan();
break;
} else if (this.pauseAttack) {
spiderScan.pauseScan();
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't break here nor in the resume.

if (stopAttack) {
LOGGER.debug("Attack stopped manually");
extension.notifyProgress(Progress.stopped);
return;
}

if (pauseAttack) {
LOGGER.debug("Attack paused manually");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use error and you will even see them in the output tab :)

@thc202
Copy link
Member

thc202 commented Sep 27, 2024

#5769 (comment) I think the/a problem is #5769 (comment) since that would make the (quick start) scan continue when paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants