1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00
Commit Graph

21 Commits

Author SHA1 Message Date
Bram Matthys b39b953b8e Add debugging code to trace source of io.BUG_FD_SETSELECT_OUT_OF_RANGE (fd=-2). 2024-07-18 08:10:49 +02:00
Bram Matthys 89f75bd6e7 Fix some warnings: change an int to time_t and vice-versa 2023-04-01 09:52:19 +02:00
Bram Matthys 696d5f05fb Last argument in fd_open() is now used to indicate what should be done on a
later fd_close() call. This also removes fd_map() since fd_open w/FDCLOSE_NONE
now does that.

* If you use fd_socket() or fd_accept(), then no change.
  When fd_close() is called we call close() on *NIX and closesocket() on Win.
* If you use fd_fileopen(), then no change.
  When fd_close() is called we will call close() on both *NIX and Win.
* If you used fd_open() and then fd_unmap() because you didn't want us
  to close the socket, then use fd_open() with FDCLOSE_NONE and
  just call fd_close() instead of fd_unmap().
  We will not actually close the fd in fd_close() (FDCLOSE_NONE).
* If you called fd_open() with other intentions then either specify a
  FDCLOSE_SOCKET / FDCLOSE_FILE as the last argument, or more likely:
  don't use fd_open() at all and use fd_socket() or fd_fileopen() instead.

For reasons on this change, see previous patch. This way is more sane and
makes it harder to make mistakes even beyond Windows-specific issues.
2021-06-30 11:33:46 +02:00
Bram Matthys 329f48334c I/O engine: track if a fd is a file or socket, needed for Windows.
This fixes a file descriptor leak in Windows that happened in the
logging code. The most visible effect of this was if you had a
log::maxsize set then on Windows you would see:
"Max file size reached, starting new log file"
Every other line, forever (and not actually starting a new log).

fd_close() previously did not close the file descriptor of a file
on Windows because on Windows it needs to call close() for a file
and closesocket() for a socket, and it always did the latter.
On *NIX it's more easy and you can just always close() any fd.
2021-06-30 11:06:44 +02:00
Bram Matthys 022ed9ae71 Remove explicit setting of send/receive buffer as modern OSs don't
need this and it slows things down for servers.

For clients it's not much of an issue, since traffic rates are low.

However, for server-to-server links it is an entirely different matter.
It is (only) noticeable if you have lots of traffic, such as when there
is a lot to sync while linking two servers, and especially when the two
servers are geographically further apart.
Tested with 100,000 G-lines on both sides being synced (20MB traffic):
* 20ms RTT (same country/state): speed up of x3
* 200ms RTT (transpacific): speed up of x6
2021-03-14 16:04:43 +01:00
Bram Matthys 117a87dd8e I/O engine performance improvements (and fixes)
This is work in progress. The work was already done but the patch was
postponed until after alpha3 since it's not sufficiently stable yet.
2019-09-22 08:43:27 +02:00
Travis McArthur b747d00dea Fix kqueue behavior on fork 2015-10-16 15:32:10 -07:00
Bram Matthys 020bf7db2f this is probably a better idea. 2015-07-12 20:00:57 +02:00
Bram Matthys 101d2dd6a3 Big 3.4.x commit containing bug fixes and enhancements. Modularizing
user & channel modes. Fixing Windows build. Etc..
2014-05-11 20:56:02 +02:00
William Pitcock 4c2f110e19 - Add fd_fileopen() which wraps open(2) but tracks the FD in the FD table. 2013-05-06 23:16:39 +00:00
William Pitcock 4ca0156f84 - Remove remainder of fdlist code. 2012-11-24 20:55:38 +00:00
William Pitcock 275b4f507d - Replace oper_fdlist with oper_list. 2012-11-24 20:45:11 +00:00
William Pitcock b69b78de4b - Add support for tracking backend state for FD table entries. 2012-10-26 00:06:16 +00:00
William Pitcock 110aeceaec - Add support for oneshot I/O handlers. 2012-10-05 17:55:30 +00:00
William Pitcock 7608e3716f - Give IO event subscribers information on whether or not they are getting read or write events,
or both.
2012-10-05 08:57:52 +00:00
William Pitcock dfe8206c8e - First cut at new evented I/O system. Right now, we only implement support for poll(2).
Nothing is hooked up to it yet, I will cover that in the next few commits.
2012-10-05 08:21:29 +00:00
William Pitcock b26207df50 - Add support for proper FD accounting (rewrite of the fdlist code).
This is the first step to adding evented I/O.  Infact, writing the evented I/O code
  should now be quite easy.
2012-10-05 03:42:44 +00:00
codemastr 99bd34fbb9 Added module support for Windows 2004-05-12 22:02:05 +00:00
stskeeps 2ac54ecc8b *** empty log message *** 2001-10-07 08:56:11 +00:00
stskeeps 2e461cba19 +- Indentation and more SJ3 fixes 2000-07-14 20:22:59 +00:00
cmunk f110f47e65 Import of Unreal3.0 (STABLE) 2000-02-28 22:45:44 +00:00