aboutsummaryrefslogtreecommitdiff
path: root/src/socketengines/socketengine_kqueue.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tweak the workaround for NetBSD's kqueue using intptr_t for udata.Gravatar Peter Powell2019-10-051-2/+2
| | | | Thanks to @niacat for getting this fixed upstream.
* Work around NetBSD's EV_SET using intptr_t instead of void*.Gravatar Peter Powell2019-05-031-4/+19
| | | | Reported by @ensra.
* Deduplicate error handling in the socket engines.Gravatar Peter Powell2017-10-221-9/+2
|
* Convert GetMaxFds() to size_t and deduplicate setting code.Gravatar Peter Powell2017-10-221-14/+1
|
* Improve and centralize socket engine event counters.Gravatar Robin Burchell2017-07-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The write counters were close to useless because they were only incremented on a write "event" which is only triggered when writing would block. Read handling was a little more useful in that all reads must happen through the socket engine, so these were happening at the correct time, but we can clean this up by doing it in the SE itself rather than each platform port. This means that both read and write events are now easily and usefully defined as "a syscall of either read or write was attempted". We also count empty read and write events as being an event, because they still were an attempt to poll a socket in some way. This may help to identify "bad" code which is repeatedly trying to read a socket for some reason. Lastly, we check for failed read/write calls, and log them as an error event. A lot of the time, this is how sockets are determined as being disconnected (ie. at read/write time). While we're at it, split Update() in two to make the calls more self-describing. This has no real impact since only one call is made at a time anyway.
* Dispatch EventHandler events to dedicated virtual functionsGravatar Attila Molnar2015-04-121-3/+3
| | | | Remove enum EventType
* Kill needless #includes in source filesGravatar Attila Molnar2014-06-141-1/+0
|
* Change the number reported by SocketEngine::GetMaxFds() to be informalGravatar Attila Molnar2014-06-071-6/+1
| | | | Do not exit if we can't determine it
* Relax fd bounds checkingGravatar Attila Molnar2014-06-071-2/+2
| | | | We can cope with fds greater than SocketEngine::GetMaxFds() since 3752b3f59d5216d7dc6221a361efc76b9ad2273d
* Store the EventHandler* in the kevent/epoll_event/portev structGravatar Attila Molnar2014-02-091-7/+8
| | | | This removes the need to call GetRef() for every socket in DispatchEvents()
* Queue changes in socketengine_kqueue and submit them as we poll for new eventsGravatar Adam2014-02-091-42/+26
|
* Change all socketengine methods to be staticGravatar Attila Molnar2014-02-081-33/+19
|
* Move socketengine stats into a new classGravatar Attila Molnar2014-02-081-4/+4
|
* Update SocketEngine::CurrentSetSize in AddFdRef()/DelFdRef()Gravatar Attila Molnar2014-02-081-3/+0
|
* Rename SocketEngine::AddFd() and DelFd() to AddFdRef() and DelFdRef()Gravatar Attila Molnar2014-02-081-2/+2
|
* Move variables in socketenginesGravatar Attila Molnar2014-02-081-3/+1
| | | | Move timespec to DispatchEvents() in kqueue, there is no reason for it to be a member variable
* Replace SocketEngine::GetName() with INSPIRCD_SOCKETENGINE_NAME defineGravatar Attila Molnar2014-02-081-6/+0
|
* socketengine_kqueue Remove dead codeGravatar Attila Molnar2014-02-051-5/+1
|
* Fix oversight in 3752b3f59d5216d7dc6221a361efc76b9ad2273dGravatar Attila Molnar2014-02-051-4/+8
|
* Coding style changes in socketenginesGravatar Adam2014-02-041-6/+3
|
* New socketengine stuff:Gravatar Adam2014-02-041-20/+21
| | | | | Use vectors that grow as necessary instead of mass allocating everything at once Rework poll engine logic to make sense
* Merge insp20Gravatar attilamolnar2013-08-301-2/+2
|\
| * Fix low risk crash when we can't determine maximum open socket count.Gravatar Peter Powell2013-07-071-2/+2
| |
* | Fix spacing in calls to LogManager::Log.Gravatar Peter Powell2013-05-191-10/+10
| |
* | Add LOG_ prefix to the log level enum values.Gravatar Peter Powell2013-04-121-11/+11
|/
* OpenBSD does not have KERN_MAXFILESPERPROC.Gravatar Peter Powell2012-12-251-1/+5
|
* Replace printf(_c) with iostreamGravatar ChrisTX2012-10-141-3/+4
|
* Replace copyright headers with headers granting specific authors copyrightGravatar Robby-2012-04-191-8/+16
|
* Fix excessive memory use in kqueueGravatar Daniel De Graaf2011-03-031-1/+1
| | | | | The maximum number of file descriptors was incorrectly using the OS maximum, not the process maximum. Thanks to Liath for finding & testing.
* Fix mismatched return value in kqueue DelFdGravatar danieldg2010-03-161-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12639 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix typo in kqueueGravatar danieldg2010-03-161-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12638 e03df62e-2008-0410-955e-edbf42e46eb7
* DelFd should not fail, it will leave a bad dangling pointer in that caseGravatar danieldg2010-03-021-6/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12584 e03df62e-2008-0410-955e-edbf42e46eb7
* Don't send events for removed FDs when both read and write are readyGravatar danieldg2010-03-021-0/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12582 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix kqueue to not report 0 maximum open socketsGravatar danieldg2010-02-131-26/+14
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12449 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove excessive gettimeofday system callsGravatar danieldg2010-01-181-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12293 e03df62e-2008-0410-955e-edbf42e46eb7
* ...because every now and again, i have to do a massive commit.Gravatar brain2010-01-111-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove include/inspircd_se_config.h and socketengine-specific headersGravatar danieldg2009-09-301-1/+60
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11784 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix linking errors on BSDGravatar danieldg2009-09-281-5/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11774 e03df62e-2008-0410-955e-edbf42e46eb7
* Add FD_WANT_SINGLE_WRITE to efficiently replace FD_WANT_POLL_WRITEGravatar danieldg2009-09-261-6/+6
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11762 e03df62e-2008-0410-955e-edbf42e46eb7
* Clean up SocketEngine interface to allow edge-triggered I/O and sockets that ↵Gravatar danieldg2009-09-261-49/+47
| | | | | | do not force readability. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11760 e03df62e-2008-0410-955e-edbf42e46eb7
* Create StreamSocket for IO hooking implementationGravatar danieldg2009-09-211-3/+3
| | | | | | | | | | | | | | Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
* Update all wiki links to point to the new wiki. This was done automatically ↵Gravatar psychon2009-03-151-1/+1
| | | | | | | | | with the following command, only .Makefile.inc got some indent fixups by hand. for file in $(find -type f -and -not -path '*/.svn/*' -and -not -name '*.so') ; do sed -e 's#http://www.inspircd.org/wiki#http://wiki.inspircd.org#' -e 's#http://wiki.inspircd.org/index.php/#http://wiki.inspircd.org/#' -i $file ; done git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11223 e03df62e-2008-0410-955e-edbf42e46eb7
* Nuke trailing spacesGravatar peavey2009-02-141-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11105 e03df62e-2008-0410-955e-edbf42e46eb7
* Some fixes to the kqueue socket engineGravatar psychon2009-02-061-20/+33
| | | | | | | | | | | | The old code choked badly if a socket which was !eh->Readable() was added (it went into an endless loop where kqueue would keep reporting that socket for writeability). This also fixes a bug where DelFd() failed to clean up properly which caused the next AddFd() for an identical fd number to fail. Oh and this also adds some error messages and does some minor cleanup... git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11033 e03df62e-2008-0410-955e-edbf42e46eb7
* Missed one, thx peavey!Gravatar w00t2009-01-181-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10972 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix what should have been the (real) problems with kqueue, so far so good ↵Gravatar w00t2009-01-181-4/+3
| | | | | | for me.. this *does* need more testing though. Fix spotted by dz (check .filter, not .flags, and don't try to use it as a bitmask). TOR, ratbox, and similar projects use code like this, so I am fairly confident it is ok. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10971 e03df62e-2008-0410-955e-edbf42e46eb7
* Revert "Revert some of w00ts kqueue massacre from september, for some reason ↵Gravatar w00t2009-01-181-2/+4
| | | | | | | | its not too stable, e.g. placing wantwrite sockets into oneshot wantread? :P" This reverts commit 11302829a008263dc306d08d675ad49d7d3f62ab. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10970 e03df62e-2008-0410-955e-edbf42e46eb7
* Revert some of w00ts kqueue massacre from september, for some reason its not ↵Gravatar brain2009-01-141-4/+2
| | | | | | | | | too stable, e.g. placing wantwrite sockets into oneshot wantread? :P randomly uses 100% cpu with the newer code, seems kqueue doesnt quite like to work exactly the same as epoll and poll. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10960 e03df62e-2008-0410-955e-edbf42e46eb7
* Update copyrights for 2009.Gravatar w00t2009-01-021-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10932 e03df62e-2008-0410-955e-edbf42e46eb7
* Backport from socket branch: allow read and write events to be triggered on ↵Gravatar w00t2008-12-231-1/+2
| | | | | | one kqueue iteration git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10906 e03df62e-2008-0410-955e-edbf42e46eb7