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

Start server before initialize the vts. #196

Merged
merged 3 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
[#166](https://github.com/greenbone/ospd-openvas/pull/166)
- Set self.vts to None if there is a pending feed. [#172](https://github.com/greenbone/ospd-openvas/pull/172)
- Use the new method clear() from Vts class. [#193](https://github.com/greenbone/ospd-openvas/pull/193)
- Start server before initialize the vts. [#196](https://github.com/greenbone/ospd-openvas/pull/196)

### Fixed
- Check vt_aux for None before trying to access it. [#177](https://github.com/greenbone/ospd-openvas/pull/177)
Expand Down
8 changes: 7 additions & 1 deletion ospd_openvas/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

from ospd.errors import OspdError
from ospd.ospd import OSPDaemon
from ospd.server import BaseServer
from ospd.main import main as daemon_main
from ospd.cvss import CVSS
from ospd.vtfilter import VtsFilter
Expand Down Expand Up @@ -306,7 +307,10 @@ def __init__(self, *, niceness=None, **kwargs):

self.temp_vts_dict = None

def init(self):
def init(self, server: BaseServer) -> None:

server.start(self.handle_client_stream)

self.scanner_info['version'] = Openvas.get_version()

self.set_params_from_openvas_settings()
Expand All @@ -323,6 +327,8 @@ def init(self):

self.load_vts()

self.initialized = True

def set_params_from_openvas_settings(self):
""" Set OSPD_PARAMS with the params taken from the openvas executable.
"""
Expand Down