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

Handle KeyboardInterrupts cleanly #10

Closed
wants to merge 5 commits into from
Closed

Handle KeyboardInterrupts cleanly #10

wants to merge 5 commits into from

Conversation

cambrant
Copy link
Contributor

When using traceflow interactively, it's cleaner to gracefully catch KeyboardInterrupts instead of throwing an exception. Ideally it would be less ugly to put the packet sending code in the main loop in a separate method and wrap that in a try..except block.

@cambrant cambrant changed the title Clean keyboardinterrupt Clean KeyboardInterrupt Oct 12, 2019
@cambrant cambrant changed the title Clean KeyboardInterrupt Handle KeyboardInterrupts cleanly Oct 13, 2019
@rucarrol
Copy link
Owner

Hey @cambrant ! Thank you for the PR. I can see the interrupt handled correctly during the initial discovery run:

python3.6 traceflow/__main__.py 1.1.1.1
Resolved 1.1.1.1 to 1.1.1.1
Looking at Path ID 1 (src port:33453 , dst port:33452)
Looking at Path ID 2 (src port:33454 , dst port:33452)
Looking at Path ID 3 (src port:33455 , dst port:33452)
^C
Aborted.

However while serving viz via httpd.serve_forever(), we do not seem to intercept correctly. Can you import sys in printer.py please and re-commit?

@cambrant
Copy link
Contributor Author

cambrant commented Nov 1, 2019

Hi, you are right about that. This is fixed and updated now, assuming I understood your remark properly.

@awlx
Copy link
Collaborator

awlx commented Nov 10, 2019

Could you please once more rebase on current master? Thank you!

@cambrant cambrant closed this by deleting the head repository May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants