mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Avoid redundant invocations of init_extension_functions for IOCP
This commit is contained in:
parent
e64a2b0b11
commit
3b77d62829
@ -141,6 +141,8 @@ get_extension_function(SOCKET s, const GUID *which_fn)
|
|||||||
{0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
|
{0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int extension_fns_initialized = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_extension_functions(struct win32_extension_fns *ext)
|
init_extension_functions(struct win32_extension_fns *ext)
|
||||||
{
|
{
|
||||||
@ -155,10 +157,11 @@ init_extension_functions(struct win32_extension_fns *ext)
|
|||||||
ext->GetAcceptExSockaddrs = get_extension_function(s,
|
ext->GetAcceptExSockaddrs = get_extension_function(s,
|
||||||
&getacceptexsockaddrs);
|
&getacceptexsockaddrs);
|
||||||
closesocket(s);
|
closesocket(s);
|
||||||
|
|
||||||
|
extension_fns_initialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct win32_extension_fns the_extension_fns;
|
static struct win32_extension_fns the_extension_fns;
|
||||||
static int extension_fns_initialized = 0;
|
|
||||||
|
|
||||||
const struct win32_extension_fns *
|
const struct win32_extension_fns *
|
||||||
event_get_win32_extension_fns(void)
|
event_get_win32_extension_fns(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user