Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/common/tio.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-08-30 16:55:30 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-08-30 18:27:15 +0200
commitc9e2f9778e9267348bdfa4bf2a8d950bcf5fbd50 (patch)
tree37e7fa0ca48f1e4db1107933f39319b3d2145881 /common/tio.c
parent7140d2197ab2132b33553bacc5f8d8240ed13bbe (diff)
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
Diffstat (limited to 'common/tio.c')
-rw-r--r--common/tio.c4
1 files changed, 2 insertions, 2 deletions
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 */