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

server: Make client context available in de-registration callback #666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlasch
Copy link
Contributor

@mlasch mlasch commented Jun 15, 2022

Remove the client from server context only after calling the monitoring callback when handling a de-registration. A as result, the client information is still available in the server context during the callback.

Signed-off-by: Marc Lasch [email protected]

Copy link
Contributor

@rettichschnidi rettichschnidi left a comment

Choose a reason for hiding this comment

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

How did this get tested? Any chance for an automated test?

core/registration.c Outdated Show resolved Hide resolved
core/registration.c Outdated Show resolved Hide resolved
Remove the client context from server only after calling the monitoring
callback when handling a de-registration. A as result, the client
information is still available in the server context during the callback.

Signed-off-by: Marc Lasch <[email protected]>
@mlasch mlasch force-pushed the gardena/ml/client-unregister-context branch from 18f08f9 to 715f274 Compare February 24, 2023 15:36
Copy link
Contributor

@rettichschnidi rettichschnidi left a comment

Choose a reason for hiding this comment

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

Why not just changing the interface of the monitor callback to include a reference to client instead of just the clientID? This way, the client reference can (not sure if sensible) be removed from the list before calling the monitor callback.

break;

default:
fprintf(stdout, "\r\nMonitor callback called with an unknown status: %d.\r\n", status);
break;
}
prv_dump_client(clientP);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intended to do this even when returning COAP_202_DELETED?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants