diff --git a/lib/core/ogs-epoll.c b/lib/core/ogs-epoll.c index 5e7b087d8..833f64975 100644 --- a/lib/core/ogs-epoll.c +++ b/lib/core/ogs-epoll.c @@ -227,7 +227,22 @@ static int epoll_process(ogs_pollset_t *pollset, ogs_time_t timeout) received = context->event_list[i].events; if (received & EPOLLERR) { + /* + * The libevent library has OGS_POLLOUT turned on in EPOLLERR. + * + * However, SIGPIPE can occur if write() is called + * when the peer connection is closed. + * + * Therefore, Open5GS turns off OGS_POLLOUT + * so that write() cannot be called in case of EPOLLERR. + * + * See also #2411 and #2312 + */ +#if 0 when = OGS_POLLIN|OGS_POLLOUT; +#else + when = OGS_POLLIN; +#endif } else if ((received & EPOLLHUP) && !(received & EPOLLRDHUP)) { when = OGS_POLLIN|OGS_POLLOUT; } else {