Skip to content

Commit

Permalink
Fixes live packet capture on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Jul 19, 2014
1 parent 83f4882 commit 8b12569
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gns3/ports/port.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,15 @@ def startPacketCaptureReader(self):
info.wShowWindow = subprocess.SW_HIDE
if hasattr(sys, "frozen"):
env = {"PATH": os.path.dirname(os.path.abspath(sys.executable))} # for Popen to find tail.exe
command1 = command1.strip()
command2 = command2.strip()
else:
command1 = shlex.split(command1)
command2 = shlex.split(command2)

self._tail_process = subprocess.Popen(command1, startupinfo=info, stdout=subprocess.PIPE, env=env)
self._capture_reader_process = subprocess.Popen(command2, stdin=self._tail_process.stdout)
self._capture_reader_process = subprocess.Popen(command2, stdin=self._tail_process.stdout, stdout=subprocess.PIPE)
self._tail_process.stdout.close()
else:
# normal traffic capture
if not sys.platform.startswith("win"):
Expand Down

0 comments on commit 8b12569

Please sign in to comment.