From: Stephen D. <sd...@us...> - 2005-07-06 07:12:46
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/nsd Modified Files: connio.c driver.c nsconf.c nsconf.h nsd.h queue.c return.c server.c Log Message: * nsd/connio.c: * nsd/queue.c: * nsd/return.c: * nsd/driver.c: * nsd/server.c: * nsd/nsd.h: * nsd/nsconf.c: * nsd/nsconf.h: Cleanup default configuration by removing unneeded values and actually using the defaults throughout the code where appropriate. Some per-server limits have been made per-driver. Index: nsconf.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsconf.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nsconf.h 16 Feb 2005 08:39:53 -0000 1.1.1.1 --- nsconf.h 6 Jul 2005 07:12:18 -0000 1.2 *************** *** 1,7 **** /* ! * The contents of this file are subject to the AOLserver Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at ! * http://aolserver.com/. * * Software distributed under the License is distributed on an "AS IS" --- 1,7 ---- /* ! * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at ! * http://mozilla.org/. * * Software distributed under the License is distributed on an "AS IS" *************** *** 28,100 **** */ #ifndef NSCONF_H #define NSCONF_H - #define LOG_EXPANDED_BOOL NS_FALSE - #define LOG_DEBUG_BOOL NS_FALSE - #define LOG_NOTICE_BOOL NS_TRUE - #define LOG_DEV_BOOL NS_FALSE - #define LOG_ROLL_BOOL NS_TRUE - #define LOG_USEC_BOOL NS_FALSE - #define LOG_MAXBUFFER_INT 10 - #define LOG_MAXLEVEL_INT INT_MAX - #define LOG_MAXBACK_INT 10 - #define LOG_FLUSHINT_INT 10 ! #define THREAD_MUTEXMETER_BOOL NS_FALSE ! #define THREAD_STACKSIZE_INT (64*1024) ! ! #define SCHED_MAXELAPSED_INT 2 ! #define SHUTDOWNTIMEOUT 20 ! #define IOBUFSIZE 16000 ! #define BACKLOG 32 ! #define DNS_CACHE_BOOL NS_TRUE ! #define DNS_TIMEOUT_INT 60 ! #define KEEPALIVE_MAXKEEP_INT 100 ! #define KEEPALIVE_TIMEOUT_INT 30 ! #define SERV_AOLPRESS_BOOL NS_FALSE ! #define SERV_CONNSPERTHREAD_INT 0 ! #define SERV_ERRORMINSIZE_INT 514 ! #define SERV_GLOBALSTATS_BOOL NS_FALSE ! #define SERV_MAXCONNS_INT 100 ! #define SERV_MAXDROPPED_INT 0 ! #define SERV_MAXTHREADS_INT 20 ! #define SERV_MAXURLSTATS_INT 1000 ! #define SERV_MINTHREADS_INT 0 ! #define SERV_NOTICEDETAIL_BOOL NS_TRUE ! #define SERV_SENDFDMIN_INT 2048 ! #define SERV_THREADTIMEOUT_INT 120 ! #define SERV_URLSTATS_BOOL NS_FALSE ! #define SERV_QUIET_BOOL NS_FALSE - #define ADP_CACHESIZE_INT 5000*1024 - #define ADP_CACHE_BOOL NS_TRUE - #define ADP_ENABLEDEBUG_BOOL NS_FALSE - #define ADP_ENABLEEXPIRE_BOOL NS_FALSE - #define ADP_TAGLOCKS_BOOL NS_FALSE ! #define CONN_FLUSHCONTENT_BOOL NS_FALSE ! #define CONN_MAXHEADERS_INT 16384 ! #define CONN_MAXLINE_INT 8192 ! #define CONN_MAXPOST_INT 65536 ! #define CONN_MODSINCE_BOOL NS_TRUE ! #define FASTPATH_CACHEMAXENTRY_INT 8192 ! #define FASTPATH_CACHESIZE_INT 5000*1024 ! #define FASTPATH_CACHE_BOOL NS_TRUE ! #define FASTPATH_MMAP_BOOL NS_FALSE - #define TCL_AUTOCLOSE_BOOL NS_TRUE - #define TCL_DEBUG_BOOL NS_FALSE - #define TCL_NSVBUCKETS_INT 8 - #define TCL_STATLEVEL_INT 0 - #define TCL_STATMAXBUF_INT 1000 - #define TCL_INITLCK_BOOL NS_FALSE #endif --- 28,107 ---- */ + /* + * nsconf.h -- + * + * Default configuration values used by the core server. + * + * $Header$ + */ + #ifndef NSCONF_H #define NSCONF_H ! #define LOG_EXPANDED_BOOL NS_FALSE ! #define LOG_DEBUG_BOOL NS_FALSE ! #define LOG_NOTICE_BOOL NS_TRUE ! #define LOG_DEV_BOOL NS_FALSE ! #define LOG_ROLL_BOOL NS_TRUE ! #define LOG_USEC_BOOL NS_FALSE ! #define LOG_MAXBUFFER_INT 10 ! #define LOG_MAXLEVEL_INT INT_MAX ! #define LOG_MAXBACK_INT 10 ! #define LOG_FLUSHINT_INT 10 ! #define THREAD_STACKSIZE_INT (64*1024) ! #define SCHED_MAXELAPSED_INT 2 ! #define SHUTDOWNTIMEOUT_INT 20 ! #define SOCKLISTENBACKLOG_INT 32 ! #define DNS_CACHE_BOOL NS_TRUE ! #define DNS_TIMEOUT_INT 60 ! #define SERV_MAXCONNS_INT 100 ! #define SERV_MAXCONNSPERTHREAD_INT 0 ! #define SERV_MAXTHREADS_INT 10 ! #define SERV_MINTHREADS_INT 0 ! #define SERV_THREADTIMEOUT_INT 120 ! #define SERV_MODSINCE_BOOL NS_TRUE ! #define SERV_FLUSHCONTENT_BOOL NS_FALSE ! #define SERV_NOTICEDETAIL_BOOL NS_TRUE ! #define SERV_ERRORMINSIZE_INT 514 ! #define DRV_BUFSIZE_INT 16000 ! #define DRV_MAXINPUT_INT 1000*1024 ! #define DRV_MININPUT_INT 1024 ! #define DRV_MAXLINE_INT 4*1024 ! #define DRV_MINLINE_INT 256 ! #define DRV_MAXHEADERS_INT 64*1024 ! #define DRV_RCVBUF_INT 0 ! #define DRV_SNDBUF_INT 0 ! #define DRV_RCVWAIT_INT 30 ! #define DRV_SNDWAIT_INT 30 ! #define DRV_KEEPWAIT_INT 30 ! #define DRV_CLOSEWAIT_INT 2 ! #define DRV_KEEPWAIT_INT 30 ! #define DRV_KEEPALLMETHODS_BOOL NS_FALSE ! #define FASTPATH_CACHESIZE_INT 5000*1024 ! #define FASTPATH_CACHEMAXENTRY_INT 8192 ! #define FASTPATH_MMAP_BOOL NS_FALSE + #define VHOST_ENABLED_BOOL NS_FALSE + #define VHOST_HASHMIN_INT 0 + #define VHOST_HASHMAX_INT 5 ! #define ADP_CACHESIZE_INT 5000*1024 ! #define ADP_ENABLEEXPIRE_BOOL NS_FALSE ! #define ADP_ENABLEDEBUG_BOOL NS_FALSE ! #define ADP_DEBUGINIT_STRING "ns_adp_debuginit" ! #define ADP_DEFPARSER_STRING "adp" ! #define ADP_ENABLECOMPRESS_BOOL NS_FALSE ! #define ADP_COMPRESSLEVEL_INT 4 + #define TCL_NSVBUCKETS_INT 8 + #define TCL_INITLCK_BOOL NS_FALSE #endif Index: return.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/return.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** return.c 29 Jun 2005 03:45:49 -0000 1.9 --- return.c 6 Jul 2005 07:12:18 -0000 1.10 *************** *** 209,212 **** --- 209,213 ---- char *key, *lengthHdr; Conn *connPtr; + Driver *drvPtr; int doChunkEncoding = 0; *************** *** 216,219 **** --- 217,221 ---- connPtr = (Conn *) conn; + drvPtr = connPtr->drvPtr; sprintf(buf, "%d", connPtr->responseStatus); reason = "Unknown Reason"; *************** *** 255,259 **** */ ! if (nsconf.keepalive.enabled && connPtr->headers != NULL && connPtr->request != NULL && --- 257,261 ---- */ ! if (drvPtr->keepwait > 0 && connPtr->headers != NULL && connPtr->request != NULL && *************** *** 262,266 **** connPtr->responseLength == length) || doChunkEncoding)) || (connPtr->responseStatus == 304 || connPtr->responseStatus == 201 || connPtr->responseStatus == 207) ) && ! (nsconf.keepalive.allmethods == NS_TRUE || STREQ(connPtr->request->method, "GET")) && (key = Ns_SetIGet(conn->headers, "connection")) != NULL && --- 264,268 ---- connPtr->responseLength == length) || doChunkEncoding)) || (connPtr->responseStatus == 304 || connPtr->responseStatus == 201 || connPtr->responseStatus == 207) ) && ! (drvPtr->keepallmethods == NS_TRUE || STREQ(connPtr->request->method, "GET")) && (key = Ns_SetIGet(conn->headers, "connection")) != NULL && *************** *** 703,707 **** */ if (status >= 400) { ! while (ds.length < servPtr->limits.errorminsize) { Ns_DStringAppend(&ds, " "); } --- 705,709 ---- */ if (status >= 400) { ! while (ds.length < servPtr->opts.errorminsize) { Ns_DStringAppend(&ds, " "); } Index: nsd.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsd.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** nsd.h 19 Jun 2005 16:31:58 -0000 1.19 --- nsd.h 6 Jul 2005 07:12:18 -0000 1.20 *************** *** 36,39 **** --- 36,40 ---- #include "ns.h" + #include "nsconf.h" #include <assert.h> #include <sys/stat.h> *************** *** 208,219 **** struct { - bool enabled; - int timeout; - int maxkeep; - int npending; - int allmethods; - } keepalive; - - struct { char *sharedlibrary; char *version; --- 209,212 ---- *************** *** 374,377 **** --- 367,371 ---- int closewait; /* Graceful close timeout. */ int keepwait; /* Keepalive timeout. */ + int keepallmethods; /* Keepalive all methods or just GET? */ SOCKET sock; /* Listening socket. */ int pidx; /* poll() index. */ *************** *** 381,384 **** --- 375,379 ---- int maxinput; /* Maximum request bytes to read. */ int maxline; /* Maximum request line size. */ + int maxheaders; /* Maximum number of request headers. */ unsigned int loggingFlags; /* Logging control flags */ *************** *** 572,575 **** --- 567,571 ---- bool modsince; bool noticedetail; + int errorminsize; char *realm; Ns_HeaderCaseDisposition hdrcase; *************** *** 587,603 **** Tcl_Encoding urlEncoding; } encoding; - - /* - * The following struct maintains conn-related limits. - */ struct { - int maxheaders; - int maxline; - int sendfdmin; - int errorminsize; - } limits; - - struct { char *serverdir; /* Virtual server files path */ char *pagedir; /* Path to public pages */ --- 583,588 ---- Index: queue.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/queue.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** queue.c 12 Jun 2005 14:42:44 -0000 1.3 --- queue.c 6 Jul 2005 07:12:18 -0000 1.4 *************** *** 331,335 **** case SKeepaliveIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(nsconf.keepalive.npending)); break; --- 331,335 ---- case SKeepaliveIdx: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); break; *************** *** 554,558 **** path = Ns_ConfigGetPath(servPtr->server, NULL, NULL); if (!Ns_ConfigGetInt(path, "connsperthread", &cpt)) { ! cpt = 0; /* == unlimited # of connections */ } --- 554,558 ---- path = Ns_ConfigGetPath(servPtr->server, NULL, NULL); if (!Ns_ConfigGetInt(path, "connsperthread", &cpt)) { ! cpt = SERV_MAXCONNSPERTHREAD_INT; } Index: server.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/server.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** server.c 16 Jun 2005 19:42:48 -0000 1.8 --- server.c 6 Jul 2005 07:12:18 -0000 1.9 *************** *** 230,242 **** if (!Ns_ConfigGetBool(path, "checkmodifiedsince", &servPtr->opts.modsince)) { ! servPtr->opts.modsince = 1; } if (!Ns_ConfigGetBool(path, "flushcontent", &servPtr->opts.flushcontent)) { ! servPtr->opts.flushcontent = 0; } if (!Ns_ConfigGetBool(path, "noticedetail", &servPtr->opts.noticedetail)) { ! servPtr->opts.noticedetail = 1; } p = Ns_ConfigGetValue(path, "headercase"); --- 230,246 ---- if (!Ns_ConfigGetBool(path, "checkmodifiedsince", &servPtr->opts.modsince)) { ! servPtr->opts.modsince = SERV_MODSINCE_BOOL; } if (!Ns_ConfigGetBool(path, "flushcontent", &servPtr->opts.flushcontent)) { ! servPtr->opts.flushcontent = SERV_FLUSHCONTENT_BOOL; } if (!Ns_ConfigGetBool(path, "noticedetail", &servPtr->opts.noticedetail)) { ! servPtr->opts.noticedetail = SERV_NOTICEDETAIL_BOOL; ! } ! if (!Ns_ConfigGetInt(path, "errorminsize", ! &servPtr->opts.errorminsize)) { ! servPtr->opts.errorminsize = SERV_ERRORMINSIZE_INT; } p = Ns_ConfigGetValue(path, "headercase"); *************** *** 286,310 **** /* - * Set some server limits. - */ - - if (!Ns_ConfigGetInt(path, "sendfdthreshold", - &servPtr->limits.sendfdmin)) { - servPtr->limits.sendfdmin = 2048; - } - if (!Ns_ConfigGetInt(path, "errorminsize", - &servPtr->limits.errorminsize)) { - servPtr->limits.errorminsize = 514; - } - if (!Ns_ConfigGetInt(path, "maxline", - &servPtr->limits.maxline)) { - servPtr->limits.maxline = 16 * 1024; /* 16k */ - } - if (!Ns_ConfigGetInt(path, "maxheaders", - &servPtr->limits.maxheaders)) { - servPtr->limits.maxheaders = 64 * 1024; /* 64k */ - } - - /* * Initialize Tcl. */ --- 290,293 ---- *************** *** 325,329 **** Ns_RWLockInit(&servPtr->tcl.lock); if (!Ns_ConfigGetInt(path, "nsvbuckets", &n) || n < 1) { ! n = 8; } servPtr->nsv.nbuckets = n; --- 308,312 ---- Ns_RWLockInit(&servPtr->tcl.lock); if (!Ns_ConfigGetInt(path, "nsvbuckets", &n) || n < 1) { ! n = TCL_NSVBUCKETS_INT; } servPtr->nsv.nbuckets = n; *************** *** 350,357 **** if (!Ns_ConfigGetBool(path, "cache", &i) || i) { if (!Ns_ConfigGetInt(path, "cachemaxsize", &n)) { ! n = 5 * 1024 * 1000; } if (!Ns_ConfigGetInt(path, "cachemaxentry", &i) || i < 0) { ! i = n / 10; } servPtr->fastpath.cachemaxentry = i; --- 333,340 ---- if (!Ns_ConfigGetBool(path, "cache", &i) || i) { if (!Ns_ConfigGetInt(path, "cachemaxsize", &n)) { ! n = FASTPATH_CACHESIZE_INT; } if (!Ns_ConfigGetInt(path, "cachemaxentry", &i) || i < 0) { ! i = FASTPATH_CACHEMAXENTRY_INT; } servPtr->fastpath.cachemaxentry = i; *************** *** 359,363 **** } if (!Ns_ConfigGetBool(path, "mmap", &servPtr->fastpath.mmap)) { ! servPtr->fastpath.mmap = 0; } dirf = Ns_ConfigGetValue(path, "directoryfile"); --- 342,346 ---- } if (!Ns_ConfigGetBool(path, "mmap", &servPtr->fastpath.mmap)) { ! servPtr->fastpath.mmap = FASTPATH_MMAP_BOOL; } dirf = Ns_ConfigGetValue(path, "directoryfile"); *************** *** 418,422 **** path = Ns_ConfigGetPath(server, NULL, "vhost", NULL); ! Ns_ConfigGetBool(path, "enabled", &servPtr->vhost.enabled); if (servPtr->vhost.enabled && Ns_PathIsAbsolute(servPtr->fastpath.pagedir)) { --- 401,407 ---- path = Ns_ConfigGetPath(server, NULL, "vhost", NULL); ! if (!Ns_ConfigGetBool(path, "enabled", &servPtr->vhost.enabled)) { ! servPtr->vhost.enabled = VHOST_ENABLED_BOOL; ! } if (servPtr->vhost.enabled && Ns_PathIsAbsolute(servPtr->fastpath.pagedir)) { *************** *** 483,502 **** if (!Ns_ConfigGetBool(path, "enableexpire", &servPtr->adp.enableexpire)) { ! servPtr->adp.enableexpire = 0; } if (!Ns_ConfigGetBool(path, "enabledebug", &servPtr->adp.enabledebug)) { ! servPtr->adp.enabledebug = 0; } servPtr->adp.debuginit = Ns_ConfigGetValue(path, "debuginit"); if (servPtr->adp.debuginit == NULL) { ! servPtr->adp.debuginit = "ns_adp_debuginit"; } servPtr->adp.defaultparser = Ns_ConfigGetValue(path, "defaultparser"); if (servPtr->adp.defaultparser == NULL) { ! servPtr->adp.defaultparser = "adp"; } if (!Ns_ConfigGetInt(path, "cachesize", &n)) { ! n = 5 * 1024 * 1000; } servPtr->adp.cachesize = n; --- 468,487 ---- if (!Ns_ConfigGetBool(path, "enableexpire", &servPtr->adp.enableexpire)) { ! servPtr->adp.enableexpire = ADP_ENABLEEXPIRE_BOOL; } if (!Ns_ConfigGetBool(path, "enabledebug", &servPtr->adp.enabledebug)) { ! servPtr->adp.enabledebug = ADP_ENABLEDEBUG_BOOL; } servPtr->adp.debuginit = Ns_ConfigGetValue(path, "debuginit"); if (servPtr->adp.debuginit == NULL) { ! servPtr->adp.debuginit = ADP_DEBUGINIT_STRING; } servPtr->adp.defaultparser = Ns_ConfigGetValue(path, "defaultparser"); if (servPtr->adp.defaultparser == NULL) { ! servPtr->adp.defaultparser = ADP_DEFPARSER_STRING; } if (!Ns_ConfigGetInt(path, "cachesize", &n)) { ! n = ADP_CACHESIZE_INT; } servPtr->adp.cachesize = n; *************** *** 508,515 **** path = Ns_ConfigGetPath(server, NULL, "adp", "compress", NULL); if (!Ns_ConfigGetBool(path, "enable", &servPtr->adp.compress.enable)) { ! servPtr->adp.compress.enable = 0; } if (!Ns_ConfigGetInt(path, "level", &n) || n < 1 || n > 9) { ! n = 4; } servPtr->adp.compress.level = n; --- 493,500 ---- path = Ns_ConfigGetPath(server, NULL, "adp", "compress", NULL); if (!Ns_ConfigGetBool(path, "enable", &servPtr->adp.compress.enable)) { ! servPtr->adp.compress.enable = ADP_ENABLECOMPRESS_BOOL; } if (!Ns_ConfigGetInt(path, "level", &n) || n < 1 || n > 9) { ! n = ADP_COMPRESSLEVEL_INT; } servPtr->adp.compress.level = n; *************** *** 631,635 **** if (!Ns_ConfigGetInt(path, "maxconnections", &maxconns)) { ! maxconns = 100; } connBufPtr = ns_calloc((size_t) maxconns, sizeof(Conn)); --- 616,620 ---- if (!Ns_ConfigGetInt(path, "maxconnections", &maxconns)) { ! maxconns = SERV_MAXCONNS_INT; } connBufPtr = ns_calloc((size_t) maxconns, sizeof(Conn)); *************** *** 643,688 **** if (!Ns_ConfigGetInt(path, "minthreads", &poolPtr->threads.min)) { ! poolPtr->threads.min = 0; ! } ! if (!Ns_ConfigGetInt(path, "maxthreads", ! &poolPtr->threads.max)) { ! poolPtr->threads.max = 10; ! } ! if (!Ns_ConfigGetInt(path, "threadtimeout", ! &poolPtr->threads.timeout)) { ! poolPtr->threads.timeout = 120; ! } ! ! /* ! * Determine the minimum and maximum number of threads, adjusting the ! * values as needed. The threadtimeout value is the maximum number of ! * seconds a thread will wait for a connection before exiting if the ! * current number of threads is above the minimum. ! */ ! ! if (poolPtr->threads.max > maxconns) { ! Ns_Log(Warning, "serv: cannot have more maxthreads than maxconns: " ! "%d max threads adjusted down to %d max connections", ! poolPtr->threads.max, maxconns); ! poolPtr->threads.max = maxconns; ! } ! if (poolPtr->threads.min > poolPtr->threads.max) { ! Ns_Log(Warning, "serv: cannot have more minthreads than maxthreads: " ! "%d min threads adjusted down to %d max threads", ! poolPtr->threads.min, poolPtr->threads.max); ! poolPtr->threads.min = poolPtr->threads.max; ! } ! ! if (!Ns_ConfigGetInt(path, "minthreads", ! &poolPtr->threads.min)) { ! poolPtr->threads.min = 0; } if (!Ns_ConfigGetInt(path, "maxthreads", &poolPtr->threads.max)) { ! poolPtr->threads.max = 10; } if (!Ns_ConfigGetInt(path, "threadtimeout", &poolPtr->threads.timeout)) { ! poolPtr->threads.timeout = 120; } --- 628,640 ---- if (!Ns_ConfigGetInt(path, "minthreads", &poolPtr->threads.min)) { ! poolPtr->threads.min = SERV_MINTHREADS_INT; } if (!Ns_ConfigGetInt(path, "maxthreads", &poolPtr->threads.max)) { ! poolPtr->threads.max = SERV_MAXTHREADS_INT; } if (!Ns_ConfigGetInt(path, "threadtimeout", &poolPtr->threads.timeout)) { ! poolPtr->threads.timeout = SERV_THREADTIMEOUT_INT; } Index: nsconf.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsconf.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nsconf.c 10 Jun 2005 17:58:39 -0000 1.3 --- nsconf.c 6 Jul 2005 07:12:18 -0000 1.4 *************** *** 35,39 **** #include "nsd.h" - #include "nsconf.h" NS_RCSID("@(#) $Header$"); --- 35,38 ---- *************** *** 208,212 **** */ ! nsconf.shutdowntimeout = GetInt("shutdowntimeout", SHUTDOWNTIMEOUT); /* --- 207,211 ---- */ ! nsconf.shutdowntimeout = GetInt("shutdowntimeout", SHUTDOWNTIMEOUT_INT); /* *************** *** 220,224 **** */ ! nsconf.backlog = GetInt("listenbacklog", BACKLOG); /* --- 219,223 ---- */ ! nsconf.backlog = GetInt("listenbacklog", SOCKLISTENBACKLOG_INT); /* *************** *** 236,250 **** /* - * keepalive.c - */ - - nsconf.keepalive.timeout = GetInt("keepalivetimeout", KEEPALIVE_TIMEOUT_INT); - if (nsconf.keepalive.timeout > 0) { - nsconf.keepalive.enabled = 1; - } - nsconf.keepalive.maxkeep = GetInt("maxkeepalive", KEEPALIVE_MAXKEEP_INT); - nsconf.keepalive.allmethods = GetBool("keepaliveallmethods", NS_FALSE); - - /* * tclinit.c */ --- 235,238 ---- Index: driver.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/driver.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** driver.c 24 Jun 2005 08:36:29 -0000 1.15 --- driver.c 6 Jul 2005 07:12:17 -0000 1.16 *************** *** 156,160 **** { char *path,*address, *host, *bindaddr, *defproto, *defserver; ! int i, n, sockwait, defport, controlFlag; ServerMap *mapPtr; Tcl_HashEntry *hPtr; --- 156,160 ---- { char *path,*address, *host, *bindaddr, *defproto, *defserver; ! int i, n, defport, controlFlag; ServerMap *mapPtr; Tcl_HashEntry *hPtr; *************** *** 271,317 **** #define _MIN(x,y) ((x) > (y) ? (y) : (x)) if (!Ns_ConfigGetInt(path, "bufsize", &n) || n < 1) { ! n = 16000; /* ~16k */ } drvPtr->bufsize = n; if (!Ns_ConfigGetInt(path, "rcvbuf", &n)) { ! n = 0; /* Use OS default. */ } drvPtr->rcvbuf = n; if (!Ns_ConfigGetInt(path, "sndbuf", &n)) { ! n = 0; /* Use OS default. */ } drvPtr->sndbuf = n; - if (!Ns_ConfigGetInt(path, "socktimeout", &n) || n < 1) { - n = 30; /* 30 seconds. */ - } - sockwait = n; if (!Ns_ConfigGetInt(path, "sendwait", &n) || n < 1) { ! n = sockwait; /* Use previous socktimeout option. */ } drvPtr->sendwait = n; if (!Ns_ConfigGetInt(path, "recvwait", &n) || n < 1) { ! n = sockwait; /* Use previous socktimeout option. */ } drvPtr->recvwait = n; if (!Ns_ConfigGetInt(path, "closewait", &n) || n < 0) { ! n = 2; /* 2 seconds */ } drvPtr->closewait = n; if (!Ns_ConfigGetInt(path, "keepwait", &n) || n < 0) { ! n = 30; /* 30 seconds */ } drvPtr->keepwait = n; if (!Ns_ConfigGetInt(path, "backlog", &n) || n < 1) { ! n = 5; /* 5 pending connections. */ } drvPtr->backlog = n; if (!Ns_ConfigGetInt(path, "maxinput", &n) || n < 1) { ! n = 1000 * 1024; /* 1m. */ } ! drvPtr->maxinput = _MAX(n, 1024); if (!Ns_ConfigGetInt(path, "maxline", &n) || n < 1) { ! n = 4 * 1024; /* 4k. */ } ! drvPtr->maxline = _MAX(n, 256); /* --- 271,317 ---- #define _MIN(x,y) ((x) > (y) ? (y) : (x)) if (!Ns_ConfigGetInt(path, "bufsize", &n) || n < 1) { ! n = DRV_BUFSIZE_INT; } drvPtr->bufsize = n; if (!Ns_ConfigGetInt(path, "rcvbuf", &n)) { ! n = DRV_RCVBUF_INT; } drvPtr->rcvbuf = n; if (!Ns_ConfigGetInt(path, "sndbuf", &n)) { ! n = DRV_SNDBUF_INT; } drvPtr->sndbuf = n; if (!Ns_ConfigGetInt(path, "sendwait", &n) || n < 1) { ! n = DRV_SNDWAIT_INT; } drvPtr->sendwait = n; if (!Ns_ConfigGetInt(path, "recvwait", &n) || n < 1) { ! n = DRV_RCVWAIT_INT; } drvPtr->recvwait = n; if (!Ns_ConfigGetInt(path, "closewait", &n) || n < 0) { ! n = DRV_CLOSEWAIT_INT; } drvPtr->closewait = n; if (!Ns_ConfigGetInt(path, "keepwait", &n) || n < 0) { ! n = DRV_KEEPWAIT_INT; } drvPtr->keepwait = n; + if (!Ns_ConfigGetBool(path, "keepallmethods", &n)) { + n = DRV_KEEPALLMETHODS_BOOL; + } + drvPtr->keepallmethods = n; if (!Ns_ConfigGetInt(path, "backlog", &n) || n < 1) { ! n = nsconf.backlog; } drvPtr->backlog = n; if (!Ns_ConfigGetInt(path, "maxinput", &n) || n < 1) { ! n = DRV_MAXINPUT_INT; } ! drvPtr->maxinput = _MAX(n, DRV_MININPUT_INT); if (!Ns_ConfigGetInt(path, "maxline", &n) || n < 1) { ! n = DRV_MAXLINE_INT; } ! drvPtr->maxline = _MAX(n, DRV_MINLINE_INT); /* Index: connio.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/connio.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** connio.c 19 Jun 2005 16:37:54 -0000 1.3 --- connio.c 6 Jul 2005 07:12:17 -0000 1.4 *************** *** 560,564 **** Conn *connPtr = (Conn *) conn; Request *reqPtr = connPtr->reqPtr; ! NsServer *servPtr = connPtr->servPtr; char *eol; int nread, ncopy; --- 560,564 ---- Conn *connPtr = (Conn *) conn; Request *reqPtr = connPtr->reqPtr; ! Driver *drvPtr = connPtr->drvPtr; char *eol; int nread, ncopy; *************** *** 566,570 **** if (connPtr->sockPtr == NULL || (eol = strchr(reqPtr->next, '\n')) == NULL ! || (nread = (eol - reqPtr->next)) > servPtr->limits.maxline) { return NS_ERROR; } --- 566,570 ---- if (connPtr->sockPtr == NULL || (eol = strchr(reqPtr->next, '\n')) == NULL ! || (nread = (eol - reqPtr->next)) > drvPtr->maxline) { return NS_ERROR; } *************** *** 610,614 **** Ns_DStringInit(&ds); nread = 0; ! maxhdr = servPtr->limits.maxheaders; status = NS_OK; while (nread < maxhdr && status == NS_OK) { --- 610,614 ---- Ns_DStringInit(&ds); nread = 0; ! maxhdr = connPtr->drvPtr->maxheaders; status = NS_OK; while (nread < maxhdr && status == NS_OK) { |