From c9e2f9778e9267348bdfa4bf2a8d950bcf5fbd50 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 30 Aug 2013 16:55:30 +0200 Subject: Use a timeout when skipping remaining result data When the NSS modules closes the connection and skips any remaining result data, wait for up to 500 msec to read any available data. See: https://bugzilla.redhat.com/show_bug.cgi?id=1003011 --- common/tio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/tio.c') diff --git a/common/tio.c b/common/tio.c index 0039fd1..3b81a55 100644 --- a/common/tio.c +++ b/common/tio.c @@ -292,7 +292,7 @@ int tio_skip(TFILE *fp, size_t count) } /* Read all available data from the stream and empty the read buffer. */ -int tio_skipall(TFILE *fp) +int tio_skipall(TFILE *fp, int skiptimeout) { struct pollfd fds[1]; int rv; @@ -312,7 +312,7 @@ int tio_skipall(TFILE *fp) /* see if any data is available */ fds[0].fd = fp->fd; fds[0].events = POLLIN; - rv = poll(fds, 1, 0); + rv = poll(fds, 1, skiptimeout); /* check the poll() result */ if (rv == 0) return 0; /* no file descriptor ready */ -- cgit v1.2.3