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 --- nss/common.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'nss') diff --git a/nss/common.h b/nss/common.h index 7c21484..254a5bb 100644 --- a/nss/common.h +++ b/nss/common.h @@ -2,7 +2,7 @@ common.h - common functions for NSS lookups Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong + Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,10 @@ #include "solnss.h" #endif /* NSS_FLAVOUR_SOLARIS */ +/* skip timeout determines the maximum time to wait when closing the + connection and reading whatever data that is available */ +#define SKIP_TIMEOUT 500 + /* These are macros for handling read and write problems, they are NSS specific due to the return code so are defined here. They genrally close the open file, set an error code and return with @@ -127,7 +131,7 @@ /* close socket and we're done */ \ if ((retv == NSS_STATUS_SUCCESS) || (retv == NSS_STATUS_TRYAGAIN)) \ { \ - (void)tio_skipall(fp); \ + (void)tio_skipall(fp, SKIP_TIMEOUT); \ (void)tio_close(fp); \ } \ return retv; @@ -188,7 +192,7 @@ NSS_AVAILCHECK; \ if (fp != NULL) \ { \ - (void)tio_skipall(fp); \ + (void)tio_skipall(fp, SKIP_TIMEOUT); \ (void)tio_close(fp); \ fp = NULL; \ } \ -- cgit v1.2.3