diff --git a/gns3server/handlers/api/controller/link_handler.py b/gns3server/handlers/api/controller/link_handler.py index 6ec5e466..96d89cfc 100644 --- a/gns3server/handlers/api/controller/link_handler.py +++ b/gns3server/handlers/api/controller/link_handler.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os import asyncio import aiohttp @@ -196,9 +197,12 @@ class LinkHandler: project = yield from Controller.instance().get_loaded_project(request.match_info["project_id"]) link = project.get_link(request.match_info["link_id"]) - if link.capture_file_path is None: + while link.capture_file_path is None: raise aiohttp.web.HTTPNotFound(text="pcap file not found") + while not os.path.isfile(link.capture_file_path): + yield from asyncio.sleep(0.5) + try: with open(link.capture_file_path, "rb") as f: