summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2008-06-06 14:18:53 +0000
committerArthur de Jong <arthur@arthurdejong.org>2008-06-06 14:18:53 +0000
commitb1e43aac2b2e01442cf8024be9cc0e8517386ed4 (patch)
treebbec96625967689fa554c5eaf3f3aceaf3fa188a
parent4a86f16e54efbf9693529c1bfd2b947146913583 (diff)
increase write buffer size in nslcd to free up threads earlier and increase timeout for nslcd to nss communication to one minute (at both places)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@743 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd/nslcd.c4
-rw-r--r--nss/common.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index 083258b..9b77b8f 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -67,7 +67,7 @@
#define READBUFFER_MINSIZE 32
#define READBUFFER_MAXSIZE 64
#define WRITEBUFFER_MINSIZE 64
-#define WRITEBUFFER_MAXSIZE 64*1024
+#define WRITEBUFFER_MAXSIZE 1*1024*1024
/* the definition of the environment */
extern char **environ;
@@ -349,7 +349,7 @@ static void handleconnection(int sock,MYLDAP_SESSION *session)
/* set the timeouts */
readtimeout.tv_sec=0; /* clients should send their request quickly */
readtimeout.tv_usec=500000;
- writetimeout.tv_sec=5; /* clients could be taking some time to process the results */
+ writetimeout.tv_sec=60; /* clients could be taking some time to process the results */
writetimeout.tv_usec=0;
/* create a stream object */
if ((fp=tio_fdopen(sock,&readtimeout,&writetimeout,
diff --git a/nss/common.c b/nss/common.c
index 85be9c4..6428bc2 100644
--- a/nss/common.c
+++ b/nss/common.c
@@ -2,7 +2,7 @@
common.c - common functions for NSS lookups
Copyright (C) 2006 West Consulting
- Copyright (C) 2006, 2007 Arthur de Jong
+ Copyright (C) 2006, 2007, 2008 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
@@ -45,6 +45,12 @@
#define WRITEBUFFER_MINSIZE 32
#define WRITEBUFFER_MAXSIZE 32
+/* Note that the READBUFFER_MAXSIZE should be large enough to hold any single
+ result entity as defined in nslcd.h because the get*ent() functions expect
+ to be able to tio_reset() the stream to re-read the current entity.
+ Since group entities can grow arbitrarily large, this setting limits the
+ number of users that can be put in a group. */
+
/* returns a socket to the server or NULL on error (see errno),
socket should be closed with fclose() */
TFILE *nslcd_client_open()
@@ -68,7 +74,7 @@ TFILE *nslcd_client_open()
return NULL;
}
/* set the timeouts */
- readtimeout.tv_sec=20; /* looking up stuff may take some time */
+ readtimeout.tv_sec=60; /* looking up stuff may take some time */
readtimeout.tv_usec=0;
writetimeout.tv_sec=10; /* nslcd could be loaded with requests */
writetimeout.tv_usec=0;