Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
1bb0d63f
Unverified
Commit
1bb0d63f
authored
Nov 19, 2018
by
Luca Boccassi
Committed by
GitHub
Nov 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3310 from sigiesec/update-wepoll-1.5.4
Problem: wepoll 1.5.2 is outdated
parents
0e95c6c9
df91e1e8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
version.txt
external/wepoll/version.txt
+1
-1
wepoll.c
external/wepoll/wepoll.c
+24
-8
No files found.
external/wepoll/version.txt
View file @
1bb0d63f
https://github.com/piscisaureus/wepoll/tree/v1.5.
2
https://github.com/piscisaureus/wepoll/tree/v1.5.
4
external/wepoll/wepoll.c
View file @
1bb0d63f
...
...
@@ -286,7 +286,6 @@ typedef intptr_t ssize_t;
#define AFD_POLL_DISCONNECT 0x0008
#define AFD_POLL_ABORT 0x0010
#define AFD_POLL_LOCAL_CLOSE 0x0020
#define AFD_POLL_CONNECT 0x0040
#define AFD_POLL_ACCEPT 0x0080
#define AFD_POLL_CONNECT_FAIL 0x0100
/* clang-format on */
...
...
@@ -925,6 +924,18 @@ int init(void) {
return
0
;
}
/* Set up a workaround for the following problem:
* FARPROC addr = GetProcAddress(...);
* MY_FUNC func = (MY_FUNC) addr; <-- GCC 8 warning/error.
* MY_FUNC func = (MY_FUNC) (void*) addr; <-- MSVC warning/error.
* To compile cleanly with either compiler, do casts with this "bridge" type:
* MY_FUNC func = (MY_FUNC) (nt__fn_ptr_cast_t) addr; */
#ifdef __GNUC__
typedef
void
*
nt__fn_ptr_cast_t
;
#else
typedef
FARPROC
nt__fn_ptr_cast_t
;
#endif
#define X(return_type, attributes, name, parameters) \
WEPOLL_INTERNAL return_type(attributes* name) parameters = NULL;
NT_NTDLL_IMPORT_LIST
(
X
)
...
...
@@ -932,15 +943,17 @@ NT_NTDLL_IMPORT_LIST(X)
int
nt_global_init
(
void
)
{
HMODULE
ntdll
;
FARPROC
fn_ptr
;
ntdll
=
GetModuleHandleW
(
L"ntdll.dll"
);
if
(
ntdll
==
NULL
)
return
-
1
;
#define X(return_type, attributes, name, parameters) \
name = (return_type(attributes*) parameters) GetProcAddress(ntdll, #name); \
if (name == NULL) \
return -1;
fn_ptr = GetProcAddress(ntdll, #name); \
if (fn_ptr == NULL) \
return -1; \
name = (return_type(attributes*) parameters)(nt__fn_ptr_cast_t) fn_ptr;
NT_NTDLL_IMPORT_LIST
(
X
)
#undef X
...
...
@@ -1576,7 +1589,8 @@ static int sock__cancel_poll(sock_state_t* sock_state) {
/* CancelIoEx() may fail with ERROR_NOT_FOUND if the overlapped operation has
* already completed. This is not a problem and we proceed normally. */
if
(
!
CancelIoEx
(
afd_helper_handle
,
&
sock_state
->
overlapped
)
&&
if
(
!
HasOverlappedIoCompleted
(
&
sock_state
->
overlapped
)
&&
!
CancelIoEx
(
afd_helper_handle
,
&
sock_state
->
overlapped
)
&&
GetLastError
()
!=
ERROR_NOT_FOUND
)
return_map_error
(
-
1
);
...
...
@@ -1690,7 +1704,7 @@ static inline DWORD sock__epoll_events_to_afd_events(uint32_t epoll_events) {
if
(
epoll_events
&
(
EPOLLPRI
|
EPOLLRDBAND
))
afd_events
|=
AFD_POLL_RECEIVE_EXPEDITED
;
if
(
epoll_events
&
(
EPOLLOUT
|
EPOLLWRNORM
|
EPOLLWRBAND
))
afd_events
|=
AFD_POLL_SEND
|
AFD_POLL_CONNECT
;
afd_events
|=
AFD_POLL_SEND
;
if
(
epoll_events
&
(
EPOLLIN
|
EPOLLRDNORM
|
EPOLLRDHUP
))
afd_events
|=
AFD_POLL_DISCONNECT
;
if
(
epoll_events
&
EPOLLHUP
)
...
...
@@ -1708,14 +1722,16 @@ static inline uint32_t sock__afd_events_to_epoll_events(DWORD afd_events) {
epoll_events
|=
EPOLLIN
|
EPOLLRDNORM
;
if
(
afd_events
&
AFD_POLL_RECEIVE_EXPEDITED
)
epoll_events
|=
EPOLLPRI
|
EPOLLRDBAND
;
if
(
afd_events
&
(
AFD_POLL_SEND
|
AFD_POLL_CONNECT
)
)
if
(
afd_events
&
AFD_POLL_SEND
)
epoll_events
|=
EPOLLOUT
|
EPOLLWRNORM
|
EPOLLWRBAND
;
if
(
afd_events
&
AFD_POLL_DISCONNECT
)
epoll_events
|=
EPOLLIN
|
EPOLLRDNORM
|
EPOLLRDHUP
;
if
(
afd_events
&
AFD_POLL_ABORT
)
epoll_events
|=
EPOLLHUP
;
if
(
afd_events
&
AFD_POLL_CONNECT_FAIL
)
epoll_events
|=
EPOLLERR
;
/* Linux reports all these events after connect() has failed. */
epoll_events
|=
EPOLLIN
|
EPOLLOUT
|
EPOLLERR
|
EPOLLRDNORM
|
EPOLLWRNORM
|
EPOLLRDHUP
;
return
epoll_events
;
}
...
...
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