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

lib/posix-socket: Extend socket events #1279

Merged

Conversation

marcrittinghaus
Copy link
Member

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): [N/A]
  • Platform(s): [N/A]
  • Application(s): [N/A]

Additional configuration

  • CONFIG_LIBPOSIX_SOCKET_EVENTS

Description of changes

This commit extends the socket events so that each socket keeps track of its current state. This allows event handlers to determine when a socket function is called multiple times in a row (e.g., nginx calls listen twice) and, for what type of socket a close is performed (e.g., listen socket).

As part of this extension, the single socket event is split up into dedicated event objects per event. This avoids calling the hook for events that are not of interest.

@marcrittinghaus marcrittinghaus added kind/enhancement New feature or request lib/posix-socket Abstraction for communication sockets labels Jan 24, 2024
@marcrittinghaus marcrittinghaus requested a review from a team as a code owner January 24, 2024 18:58
@github-actions github-actions bot added area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ labels Jan 24, 2024
This commit extends the socket events so that each socket
keeps track of its current state. This allows event handlers
to determine when a socket function is called multiple times in
a row (e.g., nginx calls listen twice) and, for what type of
socket a close is performed (e.g., listen socket).

As part of this extension, the single socket event is split
up into dedicated event objects per event. This avoids calling
the hook for events that are not of interest.

Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Copy link
Member

@skuenzer skuenzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, works now as we discussed. Thanks a lot!

Reviewed-by: Simon Kuenzer simon@unikraft.io
Approved-by: Simon Kuenzer simon@unikraft.io

@skuenzer skuenzer added the merge Label to trigger merge action label Jan 26, 2024
@unikraft-bot unikraft-bot changed the base branch from staging to staging-1279 January 26, 2024 13:36
@unikraft-bot unikraft-bot merged commit 8e0bf63 into unikraft:staging-1279 Jan 26, 2024
12 of 13 checks passed
razvand pushed a commit that referenced this pull request Jan 26, 2024
This commit extends the socket events so that each socket
keeps track of its current state. This allows event handlers
to determine when a socket function is called multiple times in
a row (e.g., nginx calls listen twice) and, for what type of
socket a close is performed (e.g., listen socket).

As part of this extension, the single socket event is split
up into dedicated event objects per event. This avoids calling
the hook for events that are not of interest.

Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
GitHub-Closes: #1279
@razvand razvand added this to the v0.16.2 milestone Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary kind/enhancement New feature or request lang/c Issues or PRs to do with C/C++ lib/posix-socket Abstraction for communication sockets merge Label to trigger merge action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants