ObjFW  History of src/OFKernelEventObserver.m of 27002f2efef50246

History of the file that is called src/OFKernelEventObserver.m at check-in 27002f2efef50246

2024-04-29
21:42
[0c63190dd8] part of check-in [f16bccc7b3] Properly hide private symbols (check-in: [f16bccc7b3] user: js, branch: trunk, size: 6455) [annotate] [blame] [check-ins using] [diff]
2024-04-03
02:16
[c5333a4c56] part of check-in [7413a728a7] Change license to LGPLv3 only (check-in: [7413a728a7] user: js, branch: trunk, size: 6452) [annotate] [blame] [check-ins using] [diff]
2024-04-01
15:59
[d1c33bf38e] part of check-in [cf0effe834] Remove #define __NO_EXT_QNX

It doesn't seem to be needed anymore. (check-in: [cf0effe834] user: js, branch: trunk, size: 6244) [annotate] [blame] [check-ins using] [diff]

2024-02-03
11:41
[97a87808e7] part of check-in [7324ec8590] Update copyright (check-in: [7324ec8590] user: js, branch: 1.0, size: 6207) [annotate] [blame] [check-ins using] [diff]
2024-01-02
17:17
[fd95409b3f] part of check-in [26ddd2e4e4] Update copyright (check-in: [26ddd2e4e4] user: js, branch: trunk, size: 6266) [annotate] [blame] [check-ins using] [diff]
2023-10-15
12:32
[d1361f5797] part of check-in [a61e0594b4] Add -[OFStream lowlevelIsAtEndOfStream]

This allows for a much cleaner solution to avoid the internal read
buffer of e.g. a TLS connection never being processed while waiting for
a delimiter. (check-in: [a61e0594b4] user: js, branch: trunk, size: 6266) [annotate] [blame] [check-ins using] [diff]

2023-04-10
15:08
[65045f52e2] part of check-in [abbed5c008] Work around newer amiga-gcc defining Class (check-in: [abbed5c008] user: js, branch: trunk, size: 6207) [annotate] [blame] [check-ins using] [diff]
2023-01-06
09:04
[f0b8cf939e] part of check-in [8939cbdb52] Update copyright (check-in: [8939cbdb52] user: js, branch: trunk, size: 6163) [annotate] [blame] [check-ins using] [diff]
2022-02-12
07:46
[8d008316fd] part of check-in [1a86b8175b] Update copyright (check-in: [1a86b8175b] user: js, branch: trunk, size: 6163) [annotate] [blame] [check-ins using] [diff]
2021-04-19
22:20
[bc5e41d427] part of check-in [e97b03815f] Rename all remaining enums (check-in: [e97b03815f] user: js, branch: new-naming-convention, size: 6163) [annotate] [blame] [check-ins using] [diff]
2021-04-18
23:18
[c8344a220c] part of check-in [4b587c8874] INVALID_SOCKET -> OFInvalidSocketHandle (check-in: [4b587c8874] user: js, branch: new-naming-convention, size: 6291) [annotate] [blame] [check-ins using] [diff]
22:56
[1b43b5b3cb] part of check-in [e73c65a849] Rename all symbols marked extern (check-in: [e73c65a849] user: js, branch: new-naming-convention, size: 6284) [annotate] [blame] [check-ins using] [diff]
20:51
[66fc5201d9] part of check-in [35de667566] Rename everything in several smaller files (check-in: [35de667566] user: js, branch: new-naming-convention, size: 6289) [annotate] [blame] [check-ins using] [diff]
15:55
[babf71ff85] part of check-in [7392685ffc] Rename all functions in macros.h (check-in: [7392685ffc] user: js, branch: new-naming-convention, size: 6287) [annotate] [blame] [check-ins using] [diff]
2021-04-17
00:51
[4e64aadcfc] part of check-in [8c0d76f782] of_time_interval_t -> OFTimeInterval (check-in: [8c0d76f782] user: js, branch: new-naming-convention, size: 6291) [annotate] [blame] [check-ins using] [diff]
2021-01-02
22:04
[9d77b8881b] part of check-in [374e1a1bfa] Update copyright (check-in: [374e1a1bfa] user: js, branch: trunk, size: 6295) [annotate] [blame] [check-ins using] [diff]
2020-11-29
02:44
[451fcb3cdf] part of check-in [d76213374e] OFKernelEventObserver: Reorder #ifdefs

Check for AmigaOS first, as we have a special implementation for it that
uses WaitSelect() instead. This way, we no longer need to match $host_os
to manually disable the pipe() check, which would break if one of the
AmigaOS variants adds pipe() later on. (check-in: [d76213374e] user: js, branch: trunk, size: 6384) [annotate] [blame] [check-ins using] [diff]

2020-10-31
18:27
[0cbb2bba17] part of check-in [0b478d8138] OFKernelEventObserver: Allow mutation in observe (check-in: [0b478d8138] user: js, branch: trunk, size: 6336) [annotate] [blame] [check-ins using] [diff]
2020-06-28
15:03
[58babda954] part of check-in [b6cb3addd0] Use OF_DIRECT(_MEMBERS) where appropriate (check-in: [b6cb3addd0] user: js, branch: trunk, size: 6238) [annotate] [blame] [check-ins using] [diff]
2020-01-07
22:59
[2c737f6572] part of check-in [23ff70bec4] OFKernelEventObserver: Fix read buffers, select() (check-in: [23ff70bec4] user: js, branch: trunk, size: 6226) [annotate] [blame] [check-ins using] [diff]
20:28
[6cc4e842a3] part of check-in [24eff635db] OFKernelEventObserver: Remove queueing of actions

This removes the ability to let a thread add or remove objects for
another thread. This features wasn't used at all, but caused significant
problems with kqueue and epoll, as this often resulted in removing a
file descriptor after it had already been closed. (check-in: [24eff635db] user: js, branch: trunk, size: 6160) [annotate] [blame] [check-ins using] [diff]

2020-01-02
01:51
[fac1be8914] part of check-in [c7f0229795] Update copyright (check-in: [c7f0229795] user: js, branch: trunk, size: 9301) [annotate] [blame] [check-ins using] [diff]
2019-09-01
15:20
[836f39f0f7] part of check-in [b7badc68a0] Use u suffix on a few constants (check-in: [b7badc68a0] user: js, branch: trunk, size: 9298) [annotate] [blame] [check-ins using] [diff]
2019-08-31
17:13
[d45077c20a] part of check-in [8941b1d974] Make -[OFKernelEventObserver cancel] work on Amiga (check-in: [8941b1d974] user: js, branch: trunk, size: 9296) [annotate] [blame] [check-ins using] [diff]
12:40
[6f6bd90234] part of check-in [e9eb87694a] OFKernelEventObserver: Support for Exec Signals (check-in: [e9eb87694a] user: js, branch: trunk, size: 9004) [annotate] [blame] [check-ins using] [diff]
2019-08-09
23:44
[8f3db9a0ca] part of check-in [3dec8ecf2e] Support sockets on AmigaOS 3 (check-in: [3dec8ecf2e] user: js, branch: trunk, size: 8933) [annotate] [blame] [check-ins using] [diff]
2019-06-17
02:33
[b61a7255dc] part of check-in [17d57e01ff] Remove underscores from class names (check-in: [17d57e01ff] user: js, branch: trunk, size: 8951) [annotate] [blame] [check-ins using] [diff]
2019-03-08
00:35
[68149c85a6] part of check-in [bceb7ed4c9] Use dot syntax (check-in: [bceb7ed4c9] user: js, branch: trunk, size: 8959) [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
[97baff6c86] part of check-in [0509d7a844] Update copyright (check-in: [0509d7a844] user: js, branch: trunk, size: 8973) [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
[3b2e1e8697] part of check-in [7e5c81e186] Update copyright notice (check-in: [7e5c81e186] user: js, branch: trunk, size: 8967) [annotate] [blame] [check-ins using] [diff]
2017-10-17
00:33
[10e66eceba] part of check-in [2f4e0df8be] Do not use implicit method return types

Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (check-in: [2f4e0df8be] user: js, branch: trunk, size: 8944) [annotate] [blame] [check-ins using] [diff]

2017-07-22
20:50
[c21bd55fb9] part of check-in [c8f7b90082] Split OFDataArray into OFData and OFMutableData (check-in: [c8f7b90082] user: js, branch: trunk, size: 8916) [annotate] [blame] [check-ins using] [diff]
2017-05-21
23:57
[01c61511ac] part of check-in [b4cd87cd81] Use closesocket() instead of close()

Previously, socket_helpers.h would just define close() to whatever is
needed to close a socket. However, this makes it possible to
accidentally call a socket-specific close on something that is not a
socket. Having to explicitly call closesocket() (and defining it to
close() on platforms where it's the same) prevents this. (check-in: [b4cd87cd81] user: js, branch: trunk, size: 8919) [annotate] [blame] [check-ins using] [diff]

21:28
[1a2dbaaf85] part of check-in [6b77a5dd8b] Prefix private methods with of_ instead of OF_

This matches Apple's style. (check-in: [6b77a5dd8b] user: js, branch: trunk, size: 8794) [annotate] [blame] [check-ins using] [diff]

20:13
[9bc4c1ecdf] part of check-in [32e8c1ee4c] OFKernelEventObserver: #if HAVE_* -> #ifdef HAVE_* (check-in: [32e8c1ee4c] user: js, branch: trunk, size: 8794) [annotate] [blame] [check-ins using] [diff]
20:03
[75fadf5f06] part of check-in [c658e97994] Cast several socket-related arguments to void *

This is required to make it work on MorphOS with -noixemul, as socket
functions take UBYTE * arguments instead then, resulting in a warning
about signedness because char is signed. (check-in: [c658e97994] user: js, branch: trunk, size: 8788) [annotate] [blame] [check-ins using] [diff]

2017-05-17
20:31
[57631eb71f] part of check-in [a29197bd35] configure: Better poll() and select() checks (check-in: [a29197bd35] user: js, branch: trunk, size: 8763) [annotate] [blame] [check-ins using] [diff]
2017-05-07
20:10
[687f558fe2] part of check-in [4af49a13c3] Small code style change

Casts are now written like types in variable declarations. (check-in: [4af49a13c3] user: js, branch: trunk, size: 8881) [annotate] [blame] [check-ins using] [diff]

2017-01-09
17:36
[02536e25d0] part of check-in [44f45c2e35] Update copyright

Forgot to add 2017, even though I already did quite some changes in
2017. (check-in: [44f45c2e35] user: js, branch: trunk, size: 8868) [annotate] [blame] [check-ins using] [diff]

2016-03-27
23:10
[abf69b00a7] part of check-in [12b8a7552e] Add socket support for Nintendo 3DS

This removes the port registry that existed for the Wii and instead
tries binding to random ports in a loop until it succeeds or errno is
not EADDRINUSE. This is done for the Wii and Nintendo 3DS now.

This also includes several other socket-related cleanups. (check-in: [12b8a7552e] user: js, branch: trunk, size: 8862) [annotate] [blame] [check-ins using] [diff]

2016-03-20
14:19
[2f243bf470] part of check-in [85917ea0dd] Use the locked queue for kqueue and epoll as well

_readObjects must only be changed from the thread running the observer
and not from a thread adding or removing objects to observe. This is
already handled by the locked queue used by poll and select, so the best
way to solve this is to use the locked queue for kqueue and epoll as
well. (check-in: [85917ea0dd] user: js, branch: 0.8, size: 8743) [annotate] [blame] [check-ins using] [diff]

14:07
[e992bd3e10] part of check-in [45518ae7b7] Use the locked queue for kqueue and epoll as well

_readObjects must only be changed from the thread running the observer
and not from a thread adding or removing objects to observe. This is
already handled by the locked queue used by poll and select, so the best
way to solve this is to use the locked queue for kqueue and epoll as
well. (check-in: [45518ae7b7] user: js, branch: trunk, size: 8571) [annotate] [blame] [check-ins using] [diff]

12:05
[b44fb07041] part of check-in [b84490ab4f] Never block when the read buffer is non-empty

This was broken by 88f2f03. The problem only existed when something was
in the read buffer, but not processed completely, as after processing
the read buffer, it would go on to wait for data - but since not the
entire read buffer had been processed, it meant there was still data
left there that needed to be handled first. (check-in: [b84490ab4f] user: js, branch: 0.8, size: 5712) [annotate] [blame] [check-ins using] [diff]

11:57
[1613a72d1b] part of check-in [7ae17af9f0] Never block when the read buffer is non-empty

This was broken by 88f2f03. The problem only existed when something was
in the read buffer, but not processed completely, as after processing
the read buffer, it would go on to wait for data - but since not the
entire read buffer had been processed, it meant there was still data
left there that needed to be handled first. (check-in: [7ae17af9f0] user: js, branch: trunk, size: 5487) [annotate] [blame] [check-ins using] [diff]

2016-01-03
01:14
[5d44afb3d5] part of check-in [cb0fd980f9] Make more use of fast enumeration (check-in: [cb0fd980f9] user: js, branch: trunk, size: 5288) [annotate] [blame] [check-ins using] [diff]
00:43
[74500121cd] part of check-in [cec0f072f8] Update copyright

While at it, also update the mail address. (check-in: [cec0f072f8] user: js, branch: 0.8, size: 5514) [annotate] [blame] [check-ins using] [diff]

00:41
[39f30ed249] part of check-in [2a27cf3000] Update copyright

While at it, also update the mail address. (check-in: [2a27cf3000] user: js, branch: trunk, size: 5387) [annotate] [blame] [check-ins using] [diff]

00:36
[5076db7548] part of check-in [d1c4c46706] Fix a regression from the previous refactorization

kqueue and epoll were not updating _readObjects and _writeObjects
anymore, since this was done by the queue handling code, which they no
longer use after the refactorization. (check-in: [d1c4c46706] user: js, branch: 0.8, size: 5510) [annotate] [blame] [check-ins using] [diff]

00:35
[952d94c390] part of check-in [258b8a4944] Fix a regression from the previous refactorization

kqueue and epoll were not updating _readObjects and _writeObjects
anymore, since this was done by the queue handling code, which they no
longer use after the refactorization. (check-in: [258b8a4944] user: js, branch: trunk, size: 5383) [annotate] [blame] [check-ins using] [diff]

2015-12-29
21:42
[8054f8aa66] part of check-in [c5f0c5f9ba] Refactor OFKernelEventObserver

This moves the locked queue for actions to
OFKernelEventObserver_LockedQueue, which is now used for select and
poll, but skipped for kqueue and epoll, as they natively support changes
from another thread.

This fixes the problem that removing an object is delayed until the next
observe call - at which point it might have already been closed, meaning
the fd is no longer available. This was mainly a problem with kqueue, as
closing the fd already removed it from the kqueue, which then resulted
in an error being returned when trying to manually remove the fd from
the kqueue. (check-in: [c5f0c5f9ba] user: js, branch: 0.8, size: 5343) [annotate] [blame] [check-ins using] [diff]

21:33
[898e307ee4] part of check-in [e9b4700cb6] Refactor OFKernelEventObserver

This moves the locked queue for actions to
OFKernelEventObserver_LockedQueue, which is now used for select and
poll, but skipped for kqueue and epoll, as they natively support changes
from another thread.

This fixes the problem that removing an object is delayed until the next
observe call - at which point it might have already been closed, meaning
the fd is no longer available. This was mainly a problem with kqueue, as
closing the fd already removed it from the kqueue, which then resulted
in an error being returned when trying to manually remove the fd from
the kqueue. (check-in: [e9b4700cb6] user: js, branch: trunk, size: 5216) [annotate] [blame] [check-ins using] [diff]

2015-11-29
11:43
[d6c5a9d524] part of check-in [48980f2297] Make properties a requirement and clean up code

This increases the required GCC version from 4.0 to 4.6 (exception:
Apple GCC, which already supports this with >= 4.0 starting with OS X
10.5). Since even GCC 4.6 is really old by now, there is no point in
still supporting something even older and making the code ugly because
of that. While some hardware and OS support was dropped from GCC 4.6
compared to GCC 4.0, there is nothing in there that would be an
interesting target with the exception of BeOS maybe - but a port to BeOS
can also be achieved using the Haiku support. The other dropped OSes are
mostly old versions of OSes while newer ones are still being supported
(and those newer versions of those OSes still support the same
hardware). (check-in: [48980f2297] user: js, branch: trunk, size: 8050) [annotate] [blame] [check-ins using] [diff]

2015-10-19
22:15
[6ae3a0050f] part of check-in [1ba08eebc5] Add platform.h & make platform defines consistent (check-in: [1ba08eebc5] user: js, branch: trunk, size: 8180) [annotate] [blame] [check-ins using] [diff]
2015-10-17
10:59
[23a24b058b] part of check-in [ed4549ddd3] Add a port registry for the Wii

This is necessary as the Wii does not allow picking a random free port,
and thus we need to track which ports are used. (check-in: [ed4549ddd3] user: js, branch: trunk, size: 8179) [annotate] [blame] [check-ins using] [diff]

2015-10-04
11:11
[b0c771eac2] part of check-in [4cecf82254] Special cases for the Wii's weird network stack

This fixes the tests on Wii. (check-in: [4cecf82254] user: js, branch: trunk, size: 8177) [annotate] [blame] [check-ins using] [diff]

2015-05-09
18:13
[b099b55bf8] part of check-in [220513a3f5] More OFKernelEventObserver refactoring

This was necessary because select(), poll() and kevent() on FreeBSD and
OS X would sometimes return 0 events, even if there are some, and
sometimes return the correct number of events that were pending, meaning
the number of events returned is unreliable. To make things worse,
whether it returns 0 or the number of events that were pending is
completely non-deterministic on both FreeBSD and OS X (running the same
tests multiple times in a row would make it sometimes work and sometimes
fail).

In order to prevent code from depending on the return value of
-[observeForTimeInterval:] (which would depend on select(), poll() and
kevent() returning the correct number), OFKernelObserver no longer
returns whether there were pending events. It is expected that
-[observe] or -[observeForTimeInterval:] is just called in a loop as
long as events should be handled.

The tests have been changed as well to reflect this. What they do now is
set a deadline and call -[observeForTimeInterval:] with a small timeout
in a loop until the deadline is reached or all events have been handled.

Note: DragonFlyBSD has not been tested, but will most likely behave like
FreeBSD and OS X. (check-in: [220513a3f5] user: js, branch: trunk, size: 7927) [annotate] [blame] [check-ins using] [diff]

2015-05-04
20:34
[80d7681218] part of check-in [bbe4040126] Refactor OFKernelEventObserver (check-in: [bbe4040126] user: js, branch: trunk, size: 8160) [annotate] [blame] [check-ins using] [diff]
14:30
[566a494d67] part of check-in [ed4a6f396b] Add OFKernelEventObserver_epoll (check-in: [ed4a6f396b] user: js, branch: trunk, size: 9243) [annotate] [blame] [check-ins using] [diff]
2015-04-26
10:42
[57b253b8a0] part of check-in [f9ceddcb7d] OFKernelEventObserver: Keep FD -> object mapping

Removing the FD from the FD -> object mapping results in
OF_processReadBuffers passing nil to objectIsReadyForReading: if there's
still something in the read buffer.

Additionally, this also broke when observing the same object for reading
and writing and then removing it for either reading or writing. (check-in: [f9ceddcb7d] user: js, branch: trunk, size: 9210) [annotate] [blame] [check-ins using] [diff]

10:40
[6b86d2ab72] part of check-in [bd05eb8de3] OFKernelEventObserver: Rename a private method (check-in: [bd05eb8de3] user: js, branch: trunk, size: 9128) [annotate] [blame] [check-ins using] [diff]
2015-04-14
19:34
[628ba88c27] part of check-in [5924cc3a92] OFKernelEventObserver*.m: Minor cleanup (check-in: [5924cc3a92] user: js, branch: trunk, size: 9101) [annotate] [blame] [check-ins using] [diff]
2015-02-18
22:56
[e8b15decf5] part of check-in [f18615e057] Add of_getsockname() and make use of it

of_getsockname() calls getsockname() after acquiring a mutex. This is
necessary as some implementations of getsockname() are not thread-safe. (check-in: [f18615e057] user: js, branch: trunk, size: 9103) [annotate] [blame] [check-ins using] [diff]

2015-02-16
08:39
[83e01ba01e] part of check-in [62e2de30b9] Explicitly pass errno to exceptions

The old behaviour where the exception would access errno directly on
creation of the exception was very fragile. The two main problems with
it were that sometimes it would pick up an errno even though none had
been set and in other cases that when the exception was created errno
had already been overridden.

This also greatly increases errno handling on Win32, especially in
conjunction with sockets. It can still be improved further, though. (check-in: [62e2de30b9] user: js, branch: trunk, size: 9076) [annotate] [blame] [check-ins using] [diff]

2015-01-03
20:57
[d24665c090] part of check-in [cfd374b906] Update copyright (check-in: [cfd374b906] user: js, branch: trunk, size: 9077) [annotate] [blame] [check-ins using] [diff]
2014-08-22
19:09
[3ffd7510cd] part of check-in [1dbe9a4e4e] Retain sockets until after removal from observer

Not retaining them caused kevent() to be called on an invalid fd. (check-in: [1dbe9a4e4e] user: js, branch: trunk, size: 9071) [annotate] [blame] [check-ins using] [diff]

2014-06-21
21:43
[380728b304] part of check-in [13ee56edf3] Move all macros from OFObject.h to macros.h

This means that OFObject.h imports macros.h now, making it unnecessary
to manually import macros.h in almost every file. And while at it, also
import autorelease.h in OFObject.h, so that this doesn't need to be
manually imported in almost every file as well. (check-in: [13ee56edf3] user: js, branch: trunk, size: 8962) [annotate] [blame] [check-ins using] [diff]

2014-06-16
15:06
[cb71953a13] part of check-in [68d32a92c1] Make return type of -[OFArray objects] const

After all, this might (and does for OFArray_adjacent!) return an
internal representation that must not be changed, so changes should be
prevented at compile-time. (check-in: [68d32a92c1] user: js, branch: trunk, size: 9005) [annotate] [blame] [check-ins using] [diff]

2014-05-31
17:57
[fb20fdd1d1] part of check-in [acc999a75e] OFStream: Add -[hasDataInReadBuffer].

This replaces -[numberOfBytesInReadBuffer], as it's not always known how
many bytes there are exactly and thus the number would often be wrong
(e.g. because data is compressed). (check-in: [acc999a75e] user: js, branch: trunk, size: 8993) [annotate] [blame] [check-ins using] [diff]

2014-03-05
00:34
[2dacb355e7] part of check-in [a2f2a3289d] OFKernelEventObserver: Only use 1 internal socket (check-in: [a2f2a3289d] user: js, branch: trunk, size: 9003) [annotate] [blame] [check-ins using] [diff]
2014-02-18
00:22
[a663dc04e8] part of check-in [f9d12201f8] Move around a few defines to be more consistent (check-in: [f9d12201f8] user: js, branch: trunk, size: 9215) [annotate] [blame] [check-ins using] [diff]
2014-02-04
09:41
[8aa249806a] part of check-in [41ca862453] OFKernelEventObserver_kqueue: Ignore EBADF

Removed file descriptors were returned in the event list with EBADF if
the file descriptor has been closed before removing them. Interpreting
that as a read event caused problems, as the file descriptor could not
be mapped to an object anymore, thus the entry in the event list is
skipped now if there was a EBADF error. (check-in: [41ca862453] user: js, branch: trunk, size: 9215) [annotate] [blame] [check-ins using] [diff]

2014-02-03
19:11
[5a67a78a49] part of check-in [678dd1cdc7] OFKernelEventObserver: Fix a typo (check-in: [678dd1cdc7] user: js, branch: trunk, size: 9215) [annotate] [blame] [check-ins using] [diff]
14:43
[e92efb6b43] part of check-in [414c87ec13] Move socket initialization to a single place (check-in: [414c87ec13] user: js, branch: trunk, size: 9216) [annotate] [blame] [check-ins using] [diff]
2014-01-29
15:54
[71bb648f05] part of check-in [c694569d86] Generalize OFKernelEventObserver

It is no longer limited to streams now. (check-in: [c694569d86] user: js, branch: trunk, size: 9111) [annotate] [blame] [check-ins using] [diff]

2014-01-28
22:50
Added: [106e3c4be1] part of check-in [96e20b8093] Rename OFStreamObserver -> OFKernelEventObserver (check-in: [96e20b8093] user: js, branch: trunk, size: 8964) [annotate] [blame] [check-ins using]