Disable writing on the NetEvent @a ne. @param nh Nethandler that owns @a ne. @param ne The @c NetEvent to modify. - If read is already disable, also disable the inactivity timeout. - clear write enabled flag. - Remove the @c epoll WRITE flag. - Take @a ne out of the write ready list. */
| 238 | - Take @a ne out of the write ready list. |
| 239 | */ |
| 240 | static inline void |
| 241 | write_disable(NetHandler *nh, NetEvent *ne) |
| 242 | { |
| 243 | if (!ne->read.enabled) { |
| 244 | // Clear the next scheduled inactivity time, but don't clear inactivity_timeout_in, |
| 245 | // so the current timeout is used when the NetEvent is reenabled and not the default inactivity timeout |
| 246 | ne->next_inactivity_timeout_at = 0; |
| 247 | Dbg(NetHandler::dbg_ctl_socket, "write_disable updating inactivity_at %" PRId64 ", NetEvent=%p", ne->next_inactivity_timeout_at, |
| 248 | ne); |
| 249 | } |
| 250 | ne->write.enabled = 0; |
| 251 | nh->write_ready_list.remove(ne); |
| 252 | ne->ep.modify(-EVENTIO_WRITE); |
| 253 | } |
no test coverage detected