-
Notifications
You must be signed in to change notification settings - Fork 624
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
Refactor Sockets #1727
Refactor Sockets #1727
Conversation
9a2473e
to
097b3f5
Compare
097b3f5
to
2282ff5
Compare
7dcea47
to
d8bd846
Compare
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuesrust/Cargo.lock
Allowed Licenses: 0BSD, AGPL-3.0-or-later, Apache-2.0, BlueOak-1.0.0, BSD-2-Clause, BSD-3-Clause-Clear, BSD-3-Clause, BSL-1.0, CAL-1.0, CC-BY-3.0, CC-BY-4.0, CC-BY-SA-4.0, CC0-1.0, EPL-2.0, GPL-2.0-only, GPL-2.0-or-later, GPL-2.0, GPL-3.0-or-later, ISC, LGPL-2.0-only, LGPL-2.0-or-later, LGPL-2.1-only, LGPL-2.1-or-later, LGPL-2.1, LGPL-3.0-only, LGPL-3.0, LGPL-3.0-or-later, MIT, MPL-1.1, MPL-2.0, OFL-1.1, PSF-2.0, Python-2.0, Python-2.0.1, Unicode-DFS-2016, Unlicense OpenSSF ScorecardScorecard details
Scanned Files
|
6e08dc7
to
d1fc46d
Compare
d1fc46d
to
1effe4c
Compare
1effe4c
to
98d3bbd
Compare
e98e23a
to
c4076d5
Compare
There were some issues with the socket functions: - The position of the context argument must be the last argument of a nasl function - The named argument `len` for `recv()` must be called `length` instead
Before it was not possible anymore to receive the target, as it was neer set within the context
Also implements the buffer for TCP connections, as received messages must be buffered in order to read them line by line.
Split socket into different modules for handling tcp and udp connections. This reduces complexety of the socket module.
Split socket into different modules for handling tcp and udp connections. This reduces complexety of the socket module.
c4076d5
to
c3d88ba
Compare
c3d88ba
to
423af69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One general comment that I just noticed now:
Is the NaslSocket::Closed
variant really necessary? If we kept track of the current fd in the NaslSockets
struct and never re-used pre-existing ids we could just delete closed sockets immediately and wouldn't have to check for the closed socket case every time. Of course, the error message would change (from "socket already closed" to "socket not found"), but this could be fixed too by keeping track of the closed sockets
423af69
to
b70f084
Compare
This PR contains a refactoring of the sockets module, as well, as the implementation of
recv_line
andftp_log_in
.The refactoring divides the monolith socket implementation into the
tcp
,tls
andudp
modules.This PR is part of SC-1120
For testing the FTP function I uploaded an example script, which can be executed by:
I used this test server: https://dlptest.com/ftp-test/ which for the time being resolves into 44.241.66.173