httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: Agenda for 1.2b7
Date Fri, 07 Feb 1997 01:54:21 GMT
On Wed, 5 Feb 1997, Ed Korthof wrote:

> On Wed, 5 Feb 1997, Marc Slemko wrote:
> 
> >   * accept errors EPROTO and ECONNABORTED should not be logged
> >        Status: no patch, ditto above, but will require ifdefs
> 
> I'll put together a patch for this -- it's not hard if all we
> have to ifdef on is 'defined(EPROTO)' and 'defined(ECONNABORTED)'.
> If there's more complexity to it than that, someone else ought to
> take a look at it... I'm not that familiar with sockets.

Check the archives for a message I forwraded on Jan 18th (Message-ID:
<Pine.BSF.3.95.970118153350.7986M-100000@alive.ampr.ab.ca>) from Mukesh
Kacker at Sun.


> > Planning/design items:
> > 
> >     * Should we change the default timeout of 1200?
> > 	Status: discussion ongoing, +1 concept Jim, Randy, Marc
> 
> I would also like to add a timeout for reading the request; but
> some people consider that a feature addition.  If so, I'll work on
> other stuff now and do that later as a patch.

Yup, I think it is a bit much of a feature right now.  I would recommend
rewriting the entire timeout code to allow for multiple pending timeouts,
etc.

> 
> > Contrib stuff / future:
> > 
> >     * Chris Adams <cadams@ro.com> patch to mod_log_config to add %m
> >       and %c.
> > 
> >     * "Large groups cause authentication errors" on FreeBSD
> >       [salari@cs.ubc.ca]; problem looks to be MAX_STRING_LEN buffer
> >       in groups_for_user.  
> > 
> >   * mod_log_config patch for conditional logging
> > 	Status: contrib, not in server
> > 
> >     * Jim has patch for time taken to handle a request in status module
> 
> Also, I have a patch for limiting connections by remote IP.  It's
> much better developed than the original one I posted here; it has
> separate timeouts for requests in the Read status and all requests,
> and it returns a 503 error.  Unfortunately, it requires some violation
> of modularity (I declare die as an external function in
> http_protocol.c; OTOH, it'd allow us to abort with an approrpriate
> error code in other conditions (specifically, a 414)).
> 
> Anyway, it's all contained in 
> #if defined(LIMIT_CONNECTIONS_BY_IP)'s, so it could be added w/o
> messing with anything unless the person compiling wants to use
> this feature. 

Noted in the status report.  

> 
> The one change I'd like to make is to get remote addresses in 16 bit
> numbers, and do numeric comparisons rather than strcmp's (I minimize
> those, but w/ 200+ servers running...). 

How exactly are you planning to store them in 16 bit fields?  2^8=256,
8*4=32.

> 
>      -- Ed Korthof        |  Web Server Engineer --
>      -- ed@organic.com    |  Organic Online, Inc --
>      -- (415) 278-5676    |  Fax: (415) 284-6891 --
> 
> The patch mentioned above (for buffering mod_include output).  Most
> of the changes are just because the buffering required me to
> remove the 'return' statement from the GET_CHAR macro so I
> could flush the buffer first.

I posted my quick hack which could be modified to be half-reasonable a
while back.  Is it really necessary to make things as complicated as they
are below?  My patches essentially just replace rputc with PUT_CHAR, then
define a FLUSH_CHAR that is used when necessary.

Some of the things you are doing don't make sense (ie. look broken) to me. 
More later when I can look more.  I'll clean up my patches a touch and
repost them. 

> 
> *** mod_include.c.orig	Fri Jan 31 09:45:28 1997
> --- mod_include.c	Mon Feb  3 01:12:34 1997
> ***************
> *** 116,124 ****
>   #define GET_CHAR(f,c,r,p) \
>    { \
>      int i = getc(f); \
> !    if(feof(f) || ferror(f) || (i == -1)) { \
>           pfclose(p,f); \
> -         return r; \
>      } \
>      c = (char)i; \
>    }
> --- 116,126 ----
>   #define GET_CHAR(f,c,r,p) \
>    { \
>      int i = getc(f); \
> !    if (i == EOF) { /* either EOF or error--needs error handling if latter */ \
> !         if (ferror(f)) \
> !             fprintf(stderr, \
> !                     "encountered error in GET_CHAR macro, mod_include.\n"); \
>           pfclose(p,f); \
>      } \
>      c = (char)i; \
>    }
> ***************
> *** 129,153 ****
>    * matter much, but this is an inner loop...
>    */
>   
>   int find_string(FILE *in,char *str, request_rec *r, int printing) {
> !     int x,l=strlen(str),p;
>       char c;
>   
>       p=0;
>       while(1) {
>           GET_CHAR(in,c,1,r->pool);
>           if(c == str[p]) {
> !             if((++p) == l)
>                   return 0;
>           }
>           else {
>               if (printing) {
> !                 for(x=0;x<p;x++) {
> !                     rputc(str[x],r);
>                   }
> !                 rputc(c,r);
>               }
> -             p=0;
>           }
>       }
>   }
> --- 131,185 ----
>    * matter much, but this is an inner loop...
>    */
>   
> + #ifndef LONG_STRING_LEN
> + #define LONG_STRING_LEN 4096
> + #endif
> + 
> + #define PUSH_BUFFER(b,l,r,t) \
> + { \
> +     t = rwrite(b,l,r); \
> +     if (t == l) { \
> +         b[0]='\0'; \
> +         l = 0; \
> +     } \
> + }
> + 
>   int find_string(FILE *in,char *str, request_rec *r, int printing) {
> !     int x,l=strlen(str),p,count_in_buffer=0,test;
> !     char buffer[LONG_STRING_LEN];
>       char c;
>   
>       p=0;
>       while(1) {
>           GET_CHAR(in,c,1,r->pool);
> +         if (c == EOF)
> +         {
> +             PUSH_BUFFER(buffer,count_in_buffer,r,test);
> +             return 1;
> +         }
>           if(c == str[p]) {
> !             if((++p) == l) {
> !                 if (printing && count_in_buffer) {
> !                     PUSH_BUFFER(buffer,count_in_buffer,r,test);
> !                 } else {
> !                     printf ("not printing: %d, %d\n",printing,count_in_buffer);
> !                 }
>                   return 0;
> +             }
>           }
>           else {
>               if (printing) {
> !                 if ((count_in_buffer + 1 + p) >= LONG_STRING_LEN)
> !                 {                      /* make sure not to overflow */
> !                     PUSH_BUFFER(buffer,count_in_buffer,r,test);
>                   }
> !                 if (p) {
> !                     strncpy (buffer+count_in_buffer,str,p);
> !                     count_in_buffer+=p;
> !                     p=0;
> !                 }
> !                 buffer[count_in_buffer++] = c;
>               }
>           }
>       }
>   }
> ***************
> *** 250,264 ****
>       n = 0;
>   
>       do { /* skip whitespace */
> ! 	GET_CHAR(in,c,NULL,p);
>       } while (isspace(c));
>   
>       /* tags can't start with - */
>       if(c == '-') {
> !         GET_CHAR(in,c,NULL,p);
>           if(c == '-') {
>               do {
> ! 		GET_CHAR(in,c,NULL,p);
>   	    } while (isspace(c));
>               if(c == '>') {
>                   strncpy(tag,"done", tagbuf_len-1);
> --- 282,296 ----
>       n = 0;
>   
>       do { /* skip whitespace */
> ! 	GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;
>       } while (isspace(c));
>   
>       /* tags can't start with - */
>       if(c == '-') {
> !         GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;
>           if(c == '-') {
>               do {
> ! 		GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;
>   	    } while (isspace(c));
>               if(c == '>') {
>                   strncpy(tag,"done", tagbuf_len-1);
> ***************
> *** 277,289 ****
>           }
>   	if(c == '=' || isspace(c)) break;
>   	*(t++) = tolower(c);
> !         GET_CHAR(in,c,NULL,p);
>       }
>   
>       *t++ = '\0';
>       tag_val = t;
>   
> !     while (isspace(c)) GET_CHAR(in, c, NULL,p); /* space before = */
>       if (c != '=') {
>           ungetc(c, in);
>           return NULL;
> --- 309,321 ----
>           }
>   	if(c == '=' || isspace(c)) break;
>   	*(t++) = tolower(c);
> !         GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;
>       }
>   
>       *t++ = '\0';
>       tag_val = t;
>   
> !     while (isspace(c)) GET_CHAR(in, c, NULL,p); if (c == EOF) return NULL; /* space
before = */
>       if (c != '=') {
>           ungetc(c, in);
>           return NULL;
> ***************
> *** 290,296 ****
>       }
>   
>       do {
> ! 	GET_CHAR(in,c,NULL,p);  /* space after = */
>       } while (isspace(c));
>   
>       /* we should allow a 'name' as a value */
> --- 322,328 ----
>       }
>   
>       do {
> ! 	GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;  /* space after = */
>       } while (isspace(c));
>   
>       /* we should allow a 'name' as a value */
> ***************
> *** 298,304 ****
>       if (c != '"' && c != '\'') return NULL;
>       term = c;
>       while(1) {
> ! 	GET_CHAR(in,c,NULL,p);
>   	if(++n == tagbuf_len) {
>   	    t[tagbuf_len - 1] = '\0';
>   	    return NULL;
> --- 330,336 ----
>       if (c != '"' && c != '\'') return NULL;
>       term = c;
>       while(1) {
> ! 	GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;
>   	if(++n == tagbuf_len) {
>   	    t[tagbuf_len - 1] = '\0';
>   	    return NULL;
> ***************
> *** 306,312 ****
>   /* Want to accept \" as a valid character within a string. */
>   	if (c == '\\') {
>   	    *(t++) = c; /* Add backslash */
> ! 	    GET_CHAR(in,c,NULL,p);
>   	    if (c == term) /* Only if */
>   		*(--t) = c; /* Replace backslash ONLY for terminator */
>   	} else if (c == term) break;
> --- 338,344 ----
>   /* Want to accept \" as a valid character within a string. */
>   	if (c == '\\') {
>   	    *(t++) = c; /* Add backslash */
> ! 	    GET_CHAR(in,c,NULL,p); if (c == EOF) return NULL;
>   	    if (c == term) /* Only if */
>   		*(--t) = c; /* Replace backslash ONLY for terminator */
>   	} else if (c == term) break;
> ***************
> *** 323,329 ****
>   
>       /* skip initial whitespace */
>       while(1) {
> !         GET_CHAR(in,c,1,p);
>           if(!isspace(c))
>               break;
>       }
> --- 355,361 ----
>   
>       /* skip initial whitespace */
>       while(1) {
> !         GET_CHAR(in,c,1,p); if (c == EOF) return 1;
>           if(!isspace(c))
>               break;
>       }
> ***************
> *** 330,336 ****
>       /* now get directive */
>       while(1) {
>           *d++ = tolower(c);
> !         GET_CHAR(in,c,1,p);
>           if(isspace(c))
>               break;
>       }
> --- 362,368 ----
>       /* now get directive */
>       while(1) {
>           *d++ = tolower(c);
> !         GET_CHAR(in,c,1,p); if (c == EOF) return 1;
>           if(isspace(c))
>               break;
>       }
> 


Mime
View raw message