From be46e428ada0f21ec44feee800de90e846e9bcbc Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 11 Nov 2014 11:25:52 +0800 Subject: [PATCH] research st, for bug #193, remove the code with bug, exit when fork. --- trunk/research/st/event.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/trunk/research/st/event.c b/trunk/research/st/event.c index 9747ee876..439c8fa9f 100644 --- a/trunk/research/st/event.c +++ b/trunk/research/st/event.c @@ -308,26 +308,10 @@ ST_HIDDEN void _st_epoll_dispatch(void) timeout = (int) (min_timeout / 1000); } - // TODO: WINLIN: remove it for bug introduced. - // @see: https://github.com/winlinvip/simple-rtmp-server/issues/193 if (_st_epoll_data->pid != getpid()) { - /* We probably forked, reinitialize epoll set */ - close(_st_epoll_data->epfd); - _st_epoll_data->epfd = epoll_create(_st_epoll_data->fd_hint); - if (_st_epoll_data->epfd < 0) { - /* There is nothing we can do here, will retry later */ - return; - } - fcntl(_st_epoll_data->epfd, F_SETFD, FD_CLOEXEC); - _st_epoll_data->pid = getpid(); - - /* Put all descriptors on ioq into new epoll set */ - memset(_st_epoll_data->fd_data, 0, _st_epoll_data->fd_data_size * sizeof(_epoll_fd_data_t)); - _st_epoll_data->evtlist_cnt = 0; - for (q = _ST_IOQ.next; q != &_ST_IOQ; q = q->next) { - pq = _ST_POLLQUEUE_PTR(q); - _st_epoll_pollset_add(pq->pds, pq->npds); - } + // WINLIN: remove it for bug introduced. + // @see: https://github.com/winlinvip/simple-rtmp-server/issues/193 + exit(-1); } /* Check for I/O operations */