Comment: | Rename OFObserve{ -> KernelEvents}FailedException |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
80ccb46fc476bac25a39a990808ca9b2 |
User & Date: | js on 2022-09-24 16:49:50 |
Other Links: | manifest | tags |
2022-09-24
| ||
17:03 | Document more exceptions check-in: 5202319334 user: js tags: trunk | |
16:49 | Rename OFObserve{ -> KernelEvents}FailedException check-in: 80ccb46fc4 user: js tags: trunk | |
16:38 | Document more exceptions check-in: 5650ccc643 user: js tags: trunk | |
Modified src/OFEpollKernelEventObserver.m from [ddd2075d1e] to [a510ac5746].
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + | #import "OFEpollKernelEventObserver.h" #import "OFArray.h" #import "OFMapTable.h" #import "OFNull.h" #import "OFInitializationFailedException.h" |
︙ | |||
100 101 102 103 104 105 106 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | + - - + + | memset(&event, 0, sizeof(event)); event.events = (int)events | addEvents; event.data.ptr = object; if (epoll_ctl(_epfd, (events == 0 ? EPOLL_CTL_ADD : EPOLL_CTL_MOD), fd, &event) == -1) @throw [OFObserveKernelEventsFailedException |
︙ | |||
125 126 127 128 129 130 131 | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | - + - + | if (epoll_ctl(_epfd, EPOLL_CTL_DEL, fd, NULL) == -1) /* * When an async connect fails, it seems the socket is * automatically removed from epoll, meaning ENOENT is * returned when we try to remove it after it failed. */ if (errno != ENOENT) |
︙ | |||
196 197 198 199 200 201 202 | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | + - - + + | if ([self of_processReadBuffers]) return; events = epoll_wait(_epfd, eventList, eventListSize, (timeInterval != -1 ? timeInterval * 1000 : -1)); if (events < 0) @throw [OFObserveKernelEventsFailedException |
︙ |
Modified src/OFKqueueKernelEventObserver.m from [bcb05813e9] to [ef6117c8da].
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + | #include <sys/event.h> #include <sys/time.h> #import "OFKqueueKernelEventObserver.h" #import "OFArray.h" #import "OFInitializationFailedException.h" |
︙ | |||
90 91 92 93 94 95 96 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | + - - + + + - - + + + - - + + + - - + + + - - + + - + | /* * Ugly hack required for NetBSD: NetBSD used `intptr_t` for udata, but * switched this to `void *` in NetBSD 10. */ event.udata = (__typeof__(event.udata))object; if (kevent(_kernelQueue, &event, 1, NULL, 0, NULL) != 0) @throw [OFObserveKernelEventsFailedException |
︙ |
Modified src/OFPollKernelEventObserver.m from [458ef336b0] to [e4119778c6].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | # include <poll.h> #endif #import "OFPollKernelEventObserver.h" #import "OFData.h" #import "OFSocket+Private.h" |
︙ | |||
70 71 72 73 74 75 76 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | + - - + + | addObject(OFPollKernelEventObserver *self, id object, int fd, short events) { struct pollfd *FDs; size_t count; bool found; if (fd < 0) @throw [OFObserveKernelEventsFailedException |
︙ | |||
106 107 108 109 110 111 112 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | + - - + + | static void removeObject(OFPollKernelEventObserver *self, id object, int fd, short events) { struct pollfd *FDs; size_t nFDs; if (fd < 0) @throw [OFObserveKernelEventsFailedException |
︙ | |||
181 182 183 184 185 186 187 | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | + - - + + | @throw [OFOutOfRangeException exception]; #endif events = poll(FDs, (nfds_t)nFDs, (int)(timeInterval != -1 ? timeInterval * 1000 : -1)); if (events < 0) @throw [OFObserveKernelEventsFailedException |
︙ |
Modified src/OFRunLoop.m from [e671b17f7b] to [ccade11e78].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | # import "OFCondition.h" #endif #import "OFSortedList.h" #import "OFTimer.h" #import "OFTimer+Private.h" #import "OFDate.h" |
︙ | |||
1647 1648 1649 1650 1651 1652 1653 | 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 | - + | if (timeout < 0) timeout = 0; #if defined(OF_HAVE_SOCKETS) @try { [state->_kernelEventObserver observeForTimeInterval: timeout]; |
︙ | |||
1675 1676 1677 1678 1679 1680 1681 | 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 | - + | * No more timers and no deadline: Just watch for I/O * until we get an event. If a timer is added by * another thread, it cancels the observe. */ #if defined(OF_HAVE_SOCKETS) @try { [state->_kernelEventObserver observe]; |
︙ |
Modified src/OFSelectKernelEventObserver.m from [14ac36d0e0] to [178271bdfe].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + | #include <sys/time.h> #import "OFSelectKernelEventObserver.h" #import "OFArray.h" #import "OFSocket+Private.h" #import "OFInitializationFailedException.h" |
︙ | |||
80 81 82 83 84 85 86 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | + - - + + | } - (void)addObjectForReading: (id <OFReadyForReadingObserving>)object { int fd = object.fileDescriptorForReading; if (fd < 0) @throw [OFObserveKernelEventsFailedException |
︙ | |||
104 105 106 107 108 109 110 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | + - - + + | } - (void)addObjectForWriting: (id <OFReadyForWritingObserving>)object { int fd = object.fileDescriptorForWriting; if (fd < 0) @throw [OFObserveKernelEventsFailedException |
︙ | |||
130 131 132 133 134 135 136 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | + - - + + + - - + + | - (void)removeObjectForReading: (id <OFReadyForReadingObserving>)object { /* TODO: Adjust _maxFD */ int fd = object.fileDescriptorForReading; if (fd < 0) @throw [OFObserveKernelEventsFailedException |
︙ | |||
202 203 204 205 206 207 208 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | + - - + + | #else timeout.tv_sec = (long)timeInterval; #endif timeout.tv_usec = (int)((timeInterval - timeout.tv_sec) * 1000000); #ifdef OF_AMIGAOS if ((cancelSignal = AllocSignal(-1)) == (BYTE)-1) @throw [OFObserveKernelEventsFailedException |
︙ | |||
227 228 229 230 231 232 233 | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | - + | Permit(); #else events = select(_maxFD + 1, &readFDs, &writeFDs, NULL, (timeInterval != -1 ? &timeout : NULL)); #endif if (events < 0) |
︙ |
Modified src/ObjFW.h from [98fd736ae6] to [f2f8142302].
︙ | |||
202 203 204 205 206 207 208 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | - + | #endif #import "OFLockFailedException.h" #import "OFMalformedXMLException.h" #import "OFMoveItemFailedException.h" #import "OFNotImplementedException.h" #import "OFNotOpenException.h" #ifdef OF_HAVE_SOCKETS |
︙ |
Modified src/exceptions/Makefile from [881f8fa2e4] to [cb823e99e8].
︙ | |||
56 57 58 59 60 61 62 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | - + | SRCS_SOCKETS = OFAcceptFailedException.m \ OFAlreadyConnectedException.m \ OFBindFailedException.m \ OFConnectionFailedException.m \ OFDNSQueryFailedException.m \ OFHTTPRequestFailedException.m \ OFListenFailedException.m \ |
︙ |
Renamed and modified src/exceptions/OFObserveFailedException.h [1e54133af2] to src/exceptions/OFObserveKernelEventsFailedException.h [a11562c534].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - - + + + - + - + | #import "OFException.h" OF_ASSUME_NONNULL_BEGIN @class OFKernelEventObserver; /** |
︙ |
Renamed and modified src/exceptions/OFObserveFailedException.m [1a09e82eb7] to src/exceptions/OFObserveKernelEventsFailedException.m [1f89b66175].
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + - + | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" |
︙ |