Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ccbc17c9
Commit
ccbc17c9
authored
May 11, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
May 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a helper to post socket events.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9fd8a298
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
26 deletions
+16
-26
sock.c
server/sock.c
+16
-26
No files found.
server/sock.c
View file @
ccbc17c9
...
...
@@ -612,50 +612,40 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error )
return
event
;
}
static
void
post_socket_event
(
struct
sock
*
sock
,
unsigned
int
event_bit
,
unsigned
int
error
)
{
unsigned
int
event
=
(
1
<<
event_bit
);
sock
->
pmask
|=
event
;
sock
->
hmask
|=
event
;
sock
->
errors
[
event_bit
]
=
error
;
}
static
void
sock_dispatch_events
(
struct
sock
*
sock
,
int
prevstate
,
int
event
,
int
error
)
{
if
(
prevstate
&
FD_CONNECT
)
{
sock
->
pmask
|=
FD_CONNECT
;
sock
->
hmask
|=
FD_CONNECT
;
sock
->
errors
[
FD_CONNECT_BIT
]
=
sock_get_error
(
error
);
post_socket_event
(
sock
,
FD_CONNECT_BIT
,
sock_get_error
(
error
)
);
goto
end
;
}
if
(
prevstate
&
FD_WINE_LISTENING
)
{
sock
->
pmask
|=
FD_ACCEPT
;
sock
->
hmask
|=
FD_ACCEPT
;
sock
->
errors
[
FD_ACCEPT_BIT
]
=
sock_get_error
(
error
);
post_socket_event
(
sock
,
FD_ACCEPT_BIT
,
sock_get_error
(
error
)
);
goto
end
;
}
if
(
event
&
POLLIN
)
{
sock
->
pmask
|=
FD_READ
;
sock
->
hmask
|=
FD_READ
;
sock
->
errors
[
FD_READ_BIT
]
=
0
;
}
post_socket_event
(
sock
,
FD_READ_BIT
,
0
);
if
(
event
&
POLLOUT
)
{
sock
->
pmask
|=
FD_WRITE
;
sock
->
hmask
|=
FD_WRITE
;
sock
->
errors
[
FD_WRITE_BIT
]
=
0
;
}
post_socket_event
(
sock
,
FD_WRITE_BIT
,
0
);
if
(
event
&
POLLPRI
)
{
sock
->
pmask
|=
FD_OOB
;
sock
->
hmask
|=
FD_OOB
;
sock
->
errors
[
FD_OOB_BIT
]
=
0
;
}
post_socket_event
(
sock
,
FD_OOB_BIT
,
0
);
if
(
event
&
(
POLLERR
|
POLLHUP
))
{
sock
->
pmask
|=
FD_CLOSE
;
sock
->
hmask
|=
FD_CLOSE
;
sock
->
errors
[
FD_CLOSE_BIT
]
=
sock_get_error
(
error
);
}
post_socket_event
(
sock
,
FD_CLOSE_BIT
,
sock_get_error
(
error
)
);
end:
sock_wake_up
(
sock
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment