]> granicus.if.org Git - libevent/commitdiff
Avoid redundant invocations of init_extension_functions for IOCP
authorNick Mathewson <nickm@torproject.org>
Fri, 1 Nov 2013 18:20:25 +0000 (14:20 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 1 Nov 2013 18:20:25 +0000 (14:20 -0400)
event_iocp.c

index 4321281002b7816012f4014a42242a55e8cd51fa..9648366d8d868d447e67cc89a7426fe3a61eabb5 100644 (file)
@@ -141,6 +141,8 @@ get_extension_function(SOCKET s, const GUID *which_fn)
        {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
 #endif
 
+static int extension_fns_initialized = 0;
+
 static void
 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,
            &getacceptexsockaddrs);
        closesocket(s);
+
+       extension_fns_initialized = 1;
 }
 
 static struct win32_extension_fns the_extension_fns;
-static int extension_fns_initialized = 0;
 
 const struct win32_extension_fns *
 event_get_win32_extension_fns(void)