diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-02-12 22:28:10 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-02-12 22:28:10 +0100 |
commit | dbb142cc655e7115cff840faae39da9c854932d9 (patch) | |
tree | 5060fdac2231051bd2b24947b2c76e658a3c1949 /nss/common.c | |
parent | 3e84a5fcf55c7f295ae95dcdaf5cdad11a4fdc91 (diff) |
implement resizable I/O buffers and tune buffer sizes to normal requests
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@630 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/common.c')
-rw-r--r-- | nss/common.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nss/common.c b/nss/common.c index 00aebf2..4466f1a 100644 --- a/nss/common.c +++ b/nss/common.c @@ -39,6 +39,12 @@ #include "common.h" #include "common/tio.h" +/* buffer sizes for I/O */ +#define READBUFFER_MINSIZE 1024 +#define READBUFFER_MAXSIZE 32*1024 +#define WRITEBUFFER_MINSIZE 32 +#define WRITEBUFFER_MAXSIZE 32 + /* returns a socket to the server or NULL on error (see errno), socket should be closed with fclose() */ TFILE *nslcd_client_open() @@ -67,7 +73,9 @@ TFILE *nslcd_client_open() writetimeout.tv_sec=1; /* nslcd could be loaded with requests */ writetimeout.tv_usec=500000; /* create a stream object */ - if ((fp=tio_fdopen(sock,&readtimeout,&writetimeout))==NULL) + if ((fp=tio_fdopen(sock,&readtimeout,&writetimeout, + READBUFFER_MINSIZE,READBUFFER_MAXSIZE, + WRITEBUFFER_MINSIZE,WRITEBUFFER_MAXSIZE))==NULL) { (void)close(sock); return NULL; |