Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss
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 /nss
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 'nss')
-rw-r--r--nss/common.h10
1 files changed, 7 insertions, 3 deletions
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; \
} \