mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
reds: Pass RedState instance to reds_accept()
Rather than relying on a global 'reds' variable, we can pass the needed instance through the callback user data. Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
3fa733a800
commit
35d1fbff1d
@ -2374,6 +2374,7 @@ static void reds_accept_ssl_connection(int fd, int event, void *data)
|
||||
|
||||
static void reds_accept(int fd, int event, void *data)
|
||||
{
|
||||
RedsState *reds = data;
|
||||
int socket;
|
||||
|
||||
if ((socket = accept(reds->listen_socket, NULL, 0)) == -1) {
|
||||
@ -2537,7 +2538,7 @@ static int reds_init_net(RedsState *reds)
|
||||
}
|
||||
reds->listen_watch = core->watch_add(core, reds->listen_socket,
|
||||
SPICE_WATCH_EVENT_READ,
|
||||
reds_accept, NULL);
|
||||
reds_accept, reds);
|
||||
if (reds->listen_watch == NULL) {
|
||||
spice_warning("set fd handle failed");
|
||||
return -1;
|
||||
@ -2563,7 +2564,7 @@ static int reds_init_net(RedsState *reds)
|
||||
reds->listen_socket = reds->spice_listen_socket_fd;
|
||||
reds->listen_watch = core->watch_add(core, reds->listen_socket,
|
||||
SPICE_WATCH_EVENT_READ,
|
||||
reds_accept, NULL);
|
||||
reds_accept, reds);
|
||||
if (reds->listen_watch == NULL) {
|
||||
spice_warning("set fd handle failed");
|
||||
return -1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user