|
146 | 146 |
|
147 | 147 | // Add the server socket to the fd_set |
148 | 148 | int server_fd = sockfd; |
149 | | - if (__darwin_check_fd_set_overflow(server_fd, &writefds, 0)) { |
150 | | - FD_SET(server_fd, &writefds); |
151 | | - } |
| 149 | + FD_SET(server_fd, &writefds); |
152 | 150 |
|
153 | 151 | // Find the maximum file descriptor and add all connection sockets |
154 | 152 | int max_fd = server_fd; |
|
158 | 156 | auto connection_data = connections.data(); |
159 | 157 | for (size_t i = 0; i < connection_count; ++i) { |
160 | 158 | int conn_fd = connection_data[i]->sockfd; |
161 | | - if (__darwin_check_fd_set_overflow(conn_fd, &writefds, 0)) { |
162 | | - FD_SET(conn_fd, &writefds); |
163 | | - } |
| 159 | + FD_SET(conn_fd, &writefds); |
164 | 160 | if (max_fd < conn_fd) { |
165 | 161 | max_fd = conn_fd; |
166 | 162 | } |
|
181 | 177 | // Continue the loop on EAGAIN |
182 | 178 | continue; |
183 | 179 | } |
184 | | - |
| 180 | + |
185 | 181 | // Check if server socket is ready for new connections |
186 | | - if (__darwin_check_fd_set_overflow(server_fd, &writefds, 0) && |
187 | | - FD_ISSET(server_fd, &writefds)) { |
| 182 | + if (FD_ISSET(server_fd, &writefds)) { |
188 | 183 | accept_handler((void *)this); |
189 | 184 | accepted_connection = true; |
190 | 185 | } |
|
196 | 191 | auto connection = connections.data()[i].get(); |
197 | 192 | int conn_fd = connection->sockfd; |
198 | 193 |
|
199 | | - if (__darwin_check_fd_set_overflow(conn_fd, &writefds, 0) && |
200 | | - FD_ISSET(conn_fd, &writefds)) { |
| 194 | + if (FD_ISSET(conn_fd, &writefds)) { |
201 | 195 |
|
202 | 196 | // Clear the FD from the set before processing |
203 | 197 | FD_CLR(conn_fd, &writefds); |
|
0 commit comments