Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
974dbc4b
Commit
974dbc4b
authored
15 years ago
by
Phil
Browse files
Options
Downloads
Patches
Plain Diff
Simplify automaton control loop
parent
36f92713
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/automaton.py
+4
-11
4 additions, 11 deletions
scapy/automaton.py
with
4 additions
and
11 deletions
scapy/automaton.py
+
4
−
11
View file @
974dbc4b
...
...
@@ -395,9 +395,8 @@ class Automaton:
def
do_control
(
self
):
singlestep
=
True
self
.
debug
(
3
,
"
Starting control thread [tid=%i]
"
%
self
.
threadid
)
stop
=
False
try
:
while
not
stop
:
while
True
:
c
=
self
.
cmdin
.
recv
()
self
.
debug
(
5
,
"
Received command %s
"
%
c
.
type
)
if
c
.
type
==
_ATMT_Command
.
RUN
:
...
...
@@ -409,21 +408,15 @@ class Automaton:
while
True
:
try
:
state
=
self
.
do_next
()
except
KeyboardInterrupt
:
self
.
debug
(
1
,
"
Interrupted by user
"
)
stop
=
True
break
except
self
.
CommandMessage
:
break
except
StopIteration
,
e
:
c
=
Message
(
type
=
_ATMT_Command
.
END
,
result
=
e
.
args
[
0
])
self
.
cmdout
.
send
(
c
)
stop
=
True
break
if
singlestep
:
c
=
Message
(
type
=
_ATMT_Command
.
SINGLESTEP
,
state
=
state
)
self
.
cmdout
.
send
(
c
)
break
except
StopIteration
,
e
:
c
=
Message
(
type
=
_ATMT_Command
.
END
,
result
=
e
.
args
[
0
])
self
.
cmdout
.
send
(
c
)
except
Exception
,
e
:
self
.
debug
(
3
,
"
Transfering exception [%s] from tid=%i
"
%
(
e
,
self
.
threadid
))
m
=
Message
(
type
=
_ATMT_Command
.
EXCEPTION
,
exception
=
e
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment