TS-32: temp fix the overrun problem in PollDescriptor::alloc() may need better solution on pollfd.
Signed-off-by: Zhao Yongming <ming....@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1d01716c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1d01716c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1d01716c Branch: refs/heads/5.0.x Commit: 1d01716ceb2febf4fdcde2f2aae38f55e369d414 Parents: cf054cb Author: Gota Adachi <a...@iij.ad.jp> Authored: Tue Dec 24 15:16:12 2013 +0800 Committer: Zhao Yongming <ming....@gmail.com> Committed: Sun Dec 29 18:45:20 2013 +0800 ---------------------------------------------------------------------- iocore/net/P_UnixPollDescriptor.h | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d01716c/iocore/net/P_UnixPollDescriptor.h ---------------------------------------------------------------------- diff --git a/iocore/net/P_UnixPollDescriptor.h b/iocore/net/P_UnixPollDescriptor.h index f694670..af3d9e7 100644 --- a/iocore/net/P_UnixPollDescriptor.h +++ b/iocore/net/P_UnixPollDescriptor.h @@ -106,6 +106,10 @@ struct PollDescriptor Pollfd *alloc() { #if TS_USE_EPOLL + // XXX : We need restrict max size based on definition. + if (nfds >= POLL_DESCRIPTOR_SIZE) { + nfds = 0; + } return &pfd[nfds++]; #else return 0;