listener.c


Log

Author Commit Date CI Message
Nick Mathewson a0912e32 2012-07-26T10:39:05 Check more setsockopt return values when binding sockets. Found by coverity
Nick Mathewson e49e2891 2012-02-10T17:29:53 Update copyright notices to 2012
Nick Mathewson ecfc720a 2012-01-09T11:49:41 Make evconnlistener work around bug in older Linux when getting nmapped Older Linuxes sometimes respond to some nmap probes by having accept() return a success but with socklen 0. That can lead to confusing behavior when you go to process the sockaddr.
Nick Mathewson 3c824bd3 2011-10-24T13:18:09 Update copyright dates to 2011.
Peter Rosin 816115a1 2011-05-26T10:10:57 InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403.
Evan Jones fbe64f21 2010-12-02T10:26:12 Use relative includes instead of system includes consistently.
Kelly Brock 2599b2d5 2010-11-30T11:34:26 Minor fix for IOCP shutdown handling fix Call setsockopt() on the actual new socket, not on as->s, which was set to INVALID_SOCKET.
Nick Mathewson 52aa419b 2010-11-04T15:40:44 Set SO_UPDATE_ACCEPT_CONTEXT on sockets from AcceptEx so that shutdown() can work Based on patch (and lots of debugging work) by Kelly Brock.
Christopher Davis 7b40a000 2010-10-28T10:08:17 Make sure IOCP evconnlistener uses virtual events.
Nick Mathewson 46ee061c 2010-10-25T11:47:05 Add a function to change a listener's callback. You can also now initialize listeners with no callbacks set; if so, they won't get enabled until the callback is set to non-NULL.
Nick Mathewson 12057035 2010-10-07T18:05:01 Turn some booleans in evconnlistener_iocp into one-bit bitfields.
Christopher Davis 62b429af 2010-10-07T13:41:39 Make iocp/listener/error work; don't accept again if lev is disabled.
Nick Mathewson 481ef920 2010-09-23T17:41:49 Fix allocation error for IOCP listeners. Probably harmless, since struct event is big
Nick Mathewson 127d4f21 2010-09-23T16:49:58 Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners
Nick Mathewson 5b7a3706 2010-10-05T14:29:48 Fix warnings on mingw with gcc 4.5
Nick Mathewson 045eef4c 2010-09-23T14:23:45 Unit tests for listener error callbacks
Simon Perreault c4be8d82 2010-09-20T12:47:39 Add error callback to evconnlistener
Nick Mathewson 42090072 2010-09-06T15:47:07 Move the "function to getsockname() on a listener" to regress_testutils This reverts commit fab50488fcb741884ccdfa7b83643eac3e5c9cbf. The function was, on reflection, not important enough to break the feature freeze, since it's trivial to build on your own.
Nick Mathewson fab50488 2010-09-03T16:41:16 Expose a function to getsockname() on a listener's fd.
Nick Mathewson ec347b92 2010-07-07T16:45:03 Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional.
Sebastian Sjöberg 899c1dcc 2010-04-14T15:42:57 Replace EVUTIL_CLOSESOCKET macro with a function The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your source for POSIX. We might as well turn it into a function: an extra function call is going to be cheap in comparison with the system call. We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new evutil_closesocket() function. (commit message from email by Nick and Sebastian)
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Nick Mathewson e5cf9879 2010-02-18T17:46:56 Clean up formatting: remove trailing spaces
Nick Mathewson cb52838f 2010-02-18T00:27:35 When working without a current event base, don't try to use IOCP listeners This fixes a bug turned up with the http unit tests, where we create the evhttp object using an implicit (NULL) event_base. This failed pretty badly when we tried to use IOCP-based listeners. We could hunt for the current base from inside listener.c in the future, or get the iocp base some other way, but for now this is probably the safest solution.
Nick Mathewson cef61a2f 2010-01-26T12:08:17 Use ev_[u]intptr_t types in place of [u]intptr_t
Nick Mathewson a19b4a05 2010-01-25T13:38:07 Call event_debug_unassign on internal events I don't expect that many users will be so religious about calling unassign, but we need to be so that it's at least possible to use debug mode without eating memory.
Jardel Weyrich 510ab6bc 2009-12-30T19:24:39 Comestic changes in evconnlistener_new(), new_accepting_socket(), accepted_socket_invoke_user_cb() and iocp_listener_enable().
Jardel Weyrich fec66f96 2009-12-30T19:22:23 Improved error handling in evconnlistener_new_async(). Also keeping the fd open because it is not opened by this function, so the caller is responsible for closing it. Additionally, since evconnlistener_new_bind() creates a socket and passes it to the function above, it required error checking to close the same socket.
Jardel Weyrich 4367a33a 2009-12-30T19:09:14 Fixed a fd leak in start_accepting(), plus cosmetic changes
Jardel Weyrich d0939d2b 2009-12-29T16:21:26 Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD. Use this to eliminate the various macros that called F_SETFD throughout the code.
Jardel Weyrich 24fb502f 2009-12-28T16:01:12 Fix an fd leak in evconnlistener_new_bind().
Nick Mathewson 784b8773 2009-11-06T21:46:57 We do not work any more without an event-config.h; stop pretending that it is meaningful to check for HAVE_CONFIG_H svn:r1516
Nick Mathewson 0aa6f513 2009-11-02T20:59:13 Fix remaining AcceptEx issues. svn:r1492
Nick Mathewson e794d716 2009-11-02T20:20:40 Clean up acceptex code some more: add locking, single-threading, enable/disable. svn:r1491
Nick Mathewson a84c87d7 2009-11-02T19:51:26 Refactor IOCP callback interface Chris Davis points out that GetQueuedCompletionStatus sometimes returns false not to report "No events for you!" but instead to report "An overlapped operation failed." Add a way to tell an event_overlapped that its operation failed. svn:r1490
Nick Mathewson 9a772148 2009-11-02T19:31:29 Compilation and correctness fixes for IOCP listener code. svn:r1489
Nick Mathewson 5d2c1650 2009-11-02T17:42:09 More refactoring for IOCP listener code svn:r1486
Nick Mathewson 20f5bdfd 2009-10-29T19:25:33 Refactor evconnlistener to allow multiple implementations; add an (incomplete, not-yet-integrated) IOCP implementation. svn:r1480
Nick Mathewson 75fe762e 2009-07-30T17:00:56 Accessor function to get a listener's associated fd svn:r1390
Nick Mathewson 1ee65b7f 2009-05-21T20:59:17 Do not assume we know the value for FD_CLOEXEC. svn:r1301
Nick Mathewson 7e3ea82e 2009-05-21T20:59:09 Disallow backlog==0 in evconnlistener_new_bind(). svn:r1300
Nick Mathewson ed1bbc7a 2009-05-18T16:15:56 Tweak the evconnlistener interface a little. svn:r1295
Nick Mathewson 659d54d5 2009-05-05T02:59:26 Add new code to make and accept connections. This is stuff that it's easy to get wrong (as I noticed when writing bench_http), and that takes up a fair amount of space (see http.c). Also, it's something that we'll eventually want to abstract to use IOCP, where available. svn:r1272