httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@hyperreal.org>
Subject cvs commit: apachen/src/main dummy.c fnmatch.c fnmatch.h rfc1413.c
Date Tue, 16 Sep 1997 00:35:45 GMT
dgaudet     97/09/15 17:35:44

  Modified:    src      INDENT
               src/main dummy.c fnmatch.c fnmatch.h rfc1413.c
  Log:
  indent
  
  Revision  Changes    Path
  1.20      +14 -14    apachen/src/INDENT
  
  Index: INDENT
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/INDENT,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- INDENT	1997/09/16 00:25:43	1.19
  +++ INDENT	1997/09/16 00:35:39	1.20
  @@ -8,14 +8,14 @@
      alloc.h			DONE by Dean
      buff.c			DONE by Dean
      buff.h			DONE by Dean
  -   conf.h			DONe by Dean
  -   dummy.c
  -   explain.c
  -   explain.h
  -   fnmatch.c			RESERVED by Dean
  -   fnmatch.h			RESERVED by Dean
  -   http_bprintf.c
  -   http_conf_globals.h		DONe by Dean
  +   conf.h			DONE by Dean
  +   dummy.c			DONE by Dean
  +   explain.c			RESERVED by Dean
  +   explain.h			RESERVED by Dean
  +   fnmatch.c			DONE by Dean
  +   fnmatch.h			DONE by Dean
  +   http_bprintf.c		RESERVED by Dean
  +   http_conf_globals.h		DONE by Dean
      http_config.c		DONE by Dean
      http_config.h		DONE by Dean
      http_core.c			RESERVED by Randy
  @@ -28,12 +28,12 @@
      http_protocol.h		DONE by Roy
      http_request.c		DONE by Roy
      http_request.h		DONE by Roy
  -   httpd.h			DONe by Dean
  -   md5.h
  -   md5c.c
  -   multithread.h
  -   rfc1413.c			RESERVED by Dean
  -   rfc1413.h			RESERVED by Dean
  +   httpd.h			DONE by Dean
  +   md5.h			RESERVED by Dean
  +   md5c.c			RESERVED by Dean
  +   multithread.h		RESERVED by Dean
  +   rfc1413.c			DONE by Dean
  +   rfc1413.h			DONE by Dean
      scoreboard.h			DONE by Dean
      util.c			DONE by Randy
      util_date.c			DONE by Randy
  
  
  
  1.4       +2 -2      apachen/src/main/dummy.c
  
  Index: dummy.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/dummy.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- dummy.c	1997/07/21 18:57:17	1.3
  +++ dummy.c	1997/09/16 00:35:40	1.4
  @@ -1,3 +1,3 @@
   void dummy()
  -    {
  -    }
  +{
  +}
  
  
  
  1.4       +116 -115  apachen/src/main/fnmatch.c
  
  Index: fnmatch.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/fnmatch.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- fnmatch.c	1997/08/08 09:40:23	1.3
  +++ fnmatch.c	1997/09/16 00:35:40	1.4
  @@ -1,6 +1,6 @@
   /*
    * Copyright (c) 1989, 1993, 1994
  - *	The Regents of the University of California.  All rights reserved.
  + *      The Regents of the University of California.  All rights reserved.
    *
    * This code is derived from software contributed to Berkeley by
    * Guido van Rossum.
  @@ -15,8 +15,8 @@
    *    documentation and/or other materials provided with the distribution.
    * 3. All advertising materials mentioning features or use of this software
    *    must display the following acknowledgement:
  - *	This product includes software developed by the University of
  - *	California, Berkeley and its contributors.
  + *      This product includes software developed by the University of
  + *      California, Berkeley and its contributors.
    * 4. Neither the name of the University nor the names of its contributors
    *    may be used to endorse or promote products derived from this software
    *    without specific prior written permission.
  @@ -48,132 +48,132 @@
   
   #define	EOS	'\0'
   
  -static const char *rangematch (const char *, int, int);
  +static const char *rangematch(const char *, int, int);
   
  -int
  -fnmatch(pattern, string, flags)
  -	const char *pattern, *string;
  -	int flags;
  +int fnmatch(pattern, string, flags)
  +     const char *pattern, *string;
  +     int flags;
   {
  -	const char *stringstart;
  -	char c, test;
  +    const char *stringstart;
  +    char c, test;
   
  -	for (stringstart = string;;)
  -		switch (c = *pattern++) {
  -		case EOS:
  -			return (*string == EOS ? 0 : FNM_NOMATCH);
  -		case '?':
  -			if (*string == EOS)
  -				return (FNM_NOMATCH);
  -			if (*string == '/' && (flags & FNM_PATHNAME))
  -				return (FNM_NOMATCH);
  -			if (*string == '.' && (flags & FNM_PERIOD) &&
  -			    (string == stringstart ||
  -			    ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
  -				return (FNM_NOMATCH);
  -			++string;
  -			break;
  -		case '*':
  -			c = *pattern;
  -			/* Collapse multiple stars. */
  -			while (c == '*')
  -				c = *++pattern;
  -
  -			if (*string == '.' && (flags & FNM_PERIOD) &&
  -			    (string == stringstart ||
  -			    ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
  -				return (FNM_NOMATCH);
  -
  -			/* Optimize for pattern with * at end or before /. */
  -			if (c == EOS)
  -				if (flags & FNM_PATHNAME)
  -					return (strchr(string, '/') == NULL ?
  -					    0 : FNM_NOMATCH);
  -				else
  -					return (0);
  -			else if (c == '/' && flags & FNM_PATHNAME) {
  -				if ((string = strchr(string, '/')) == NULL)
  -					return (FNM_NOMATCH);
  -				break;
  -			}
  -
  -			/* General case, use recursion. */
  -			while ((test = *string) != EOS) {
  -				if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
  -					return (0);
  -				if (test == '/' && flags & FNM_PATHNAME)
  -					break;
  -				++string;
  -			}
  -			return (FNM_NOMATCH);
  -		case '[':
  -			if (*string == EOS)
  -				return (FNM_NOMATCH);
  -			if (*string == '/' && flags & FNM_PATHNAME)
  -				return (FNM_NOMATCH);
  -			if ((pattern =
  -			    rangematch(pattern, *string, flags)) == NULL)
  -				return (FNM_NOMATCH);
  -			++string;
  -			break;
  -		case '\\':
  -			if (!(flags & FNM_NOESCAPE)) {
  -				if ((c = *pattern++) == EOS) {
  -					c = '\\';
  -					--pattern;
  -				}
  -			}
  -			/* FALLTHROUGH */
  -		default:
  -			if (c != *string++)
  -				return (FNM_NOMATCH);
  -			break;
  +    for (stringstart = string;;)
  +	switch (c = *pattern++) {
  +	case EOS:
  +	    return (*string == EOS ? 0 : FNM_NOMATCH);
  +	case '?':
  +	    if (*string == EOS)
  +		return (FNM_NOMATCH);
  +	    if (*string == '/' && (flags & FNM_PATHNAME))
  +		return (FNM_NOMATCH);
  +	    if (*string == '.' && (flags & FNM_PERIOD) &&
  +		(string == stringstart ||
  +		 ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
  +		return (FNM_NOMATCH);
  +	    ++string;
  +	    break;
  +	case '*':
  +	    c = *pattern;
  +	    /* Collapse multiple stars. */
  +	    while (c == '*')
  +		c = *++pattern;
  +
  +	    if (*string == '.' && (flags & FNM_PERIOD) &&
  +		(string == stringstart ||
  +		 ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
  +		return (FNM_NOMATCH);
  +
  +	    /* Optimize for pattern with * at end or before /. */
  +	    if (c == EOS)
  +		if (flags & FNM_PATHNAME)
  +		    return (strchr(string, '/') == NULL ?
  +			    0 : FNM_NOMATCH);
  +		else
  +		    return (0);
  +	    else if (c == '/' && flags & FNM_PATHNAME) {
  +		if ((string = strchr(string, '/')) == NULL)
  +		    return (FNM_NOMATCH);
  +		break;
  +	    }
  +
  +	    /* General case, use recursion. */
  +	    while ((test = *string) != EOS) {
  +		if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
  +		    return (0);
  +		if (test == '/' && flags & FNM_PATHNAME)
  +		    break;
  +		++string;
  +	    }
  +	    return (FNM_NOMATCH);
  +	case '[':
  +	    if (*string == EOS)
  +		return (FNM_NOMATCH);
  +	    if (*string == '/' && flags & FNM_PATHNAME)
  +		return (FNM_NOMATCH);
  +	    if ((pattern =
  +		 rangematch(pattern, *string, flags)) == NULL)
  +		return (FNM_NOMATCH);
  +	    ++string;
  +	    break;
  +	case '\\':
  +	    if (!(flags & FNM_NOESCAPE)) {
  +		if ((c = *pattern++) == EOS) {
  +		    c = '\\';
  +		    --pattern;
   		}
  -	/* NOTREACHED */
  +	    }
  +	    /* FALLTHROUGH */
  +	    default:
  +		if (c != *string++)
  +		return (FNM_NOMATCH);
  +	    break;
  +	}
  +    /* NOTREACHED */
   }
   
   static const char *
  -rangematch(pattern, test, flags)
  -	const char *pattern;
  -	int test, flags;
  +     rangematch(pattern, test, flags)
  +     const char *pattern;
  +     int test, flags;
   {
  -	int negate, ok;
  -	char c, c2;
  +    int negate, ok;
  +    char c, c2;
   
  -	/*
  -	 * A bracket expression starting with an unquoted circumflex
  -	 * character produces unspecified results (IEEE 1003.2-1992,
  -	 * 3.13.2).  This implementation treats it like '!', for
  -	 * consistency with the regular expression syntax.
  -	 * J.T. Conklin (conklin@ngai.kaleida.com)
  -	 */
  -	if ((negate = (*pattern == '!' || *pattern == '^')))
  -		++pattern;
  -
  -	for (ok = 0; (c = *pattern++) != ']';) {
  -		if (c == '\\' && !(flags & FNM_NOESCAPE))
  -			c = *pattern++;
  -		if (c == EOS)
  -			return (NULL);
  -		if (*pattern == '-'
  -		    && (c2 = *(pattern+1)) != EOS && c2 != ']') {
  -			pattern += 2;
  -			if (c2 == '\\' && !(flags & FNM_NOESCAPE))
  -				c2 = *pattern++;
  -			if (c2 == EOS)
  -				return (NULL);
  -			if (c <= test && test <= c2)
  -				ok = 1;
  -		} else if (c == test)
  -			ok = 1;
  +    /*
  +     * A bracket expression starting with an unquoted circumflex
  +     * character produces unspecified results (IEEE 1003.2-1992,
  +     * 3.13.2).  This implementation treats it like '!', for
  +     * consistency with the regular expression syntax.
  +     * J.T. Conklin (conklin@ngai.kaleida.com)
  +     */
  +    if ((negate = (*pattern == '!' || *pattern == '^')))
  +	++pattern;
  +
  +    for (ok = 0; (c = *pattern++) != ']';) {
  +	if (c == '\\' && !(flags & FNM_NOESCAPE))
  +	    c = *pattern++;
  +	if (c == EOS)
  +	    return (NULL);
  +	if (*pattern == '-'
  +	    && (c2 = *(pattern + 1)) != EOS && c2 != ']') {
  +	    pattern += 2;
  +	    if (c2 == '\\' && !(flags & FNM_NOESCAPE))
  +		c2 = *pattern++;
  +	    if (c2 == EOS)
  +		return (NULL);
  +	    if (c <= test && test <= c2)
  +		ok = 1;
   	}
  -	return (ok == negate ? NULL : pattern);
  +	else if (c == test)
  +	    ok = 1;
  +    }
  +    return (ok == negate ? NULL : pattern);
   }
   
   
   /* This function is an Apache addition */
   /* return non-zero if pattern has any glob chars in it */
  -int is_fnmatch (const char *pattern)
  +int is_fnmatch(const char *pattern)
   {
       int nesting;
   
  @@ -195,7 +195,8 @@
   	    break;
   
   	case ']':
  -	    if (nesting) return 1;
  +	    if (nesting)
  +		return 1;
   	    break;
   	}
   	++pattern;
  
  
  
  1.2       +2 -2      apachen/src/main/fnmatch.h
  
  Index: fnmatch.h
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/fnmatch.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- fnmatch.h	1997/08/06 20:21:20	1.1
  +++ fnmatch.h	1997/09/16 00:35:41	1.2
  @@ -44,9 +44,9 @@
   #define	FNM_PATHNAME	0x02	/* Slash must be matched by slash. */
   #define	FNM_PERIOD	0x04	/* Period must be matched by period. */
   
  -int	 fnmatch (const char *, const char *, int);
  +int fnmatch(const char *, const char *, int);
   
   /* this function is an Apache addition */
  -extern int is_fnmatch (const char *);
  +extern int is_fnmatch(const char *);
   
   #endif /* !_FNMATCH_H_ */
  
  
  
  1.16      +28 -28    apachen/src/main/rfc1413.c
  
  Index: rfc1413.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/rfc1413.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- rfc1413.c	1997/08/31 21:28:54	1.15
  +++ rfc1413.c	1997/09/16 00:35:42	1.16
  @@ -72,10 +72,10 @@
   
   /* Rewritten by David Robinson */
   
  -#include "httpd.h"    /* for server_rec, conn_rec, ap_longjmp, etc. */
  -#include "http_log.h" /* for aplog_error */
  +#include "httpd.h"		/* for server_rec, conn_rec, ap_longjmp, etc. */
  +#include "http_log.h"		/* for aplog_error */
   #include "rfc1413.h"
  -#include "http_main.h" /* set_callback_and_alarm */
  +#include "http_main.h"		/* set_callback_and_alarm */
   
   /* Local stuff. */
   /* Semi-well-known port */
  @@ -88,24 +88,23 @@
   #ifndef RFC1413_TIMEOUT
   #define RFC1413_TIMEOUT	30
   #endif
  -#define	ANY_PORT	0		/* Any old port will do */
  +#define	ANY_PORT	0	/* Any old port will do */
   #define FROM_UNKNOWN  "unknown"
   
  -int rfc1413_timeout = RFC1413_TIMEOUT;  /* Global so it can be changed */
  +int rfc1413_timeout = RFC1413_TIMEOUT;	/* Global so it can be changed */
   
   JMP_BUF timebuf;
   
   /* bind_connect - bind both ends of a socket */
   /* Ambarish fix this. Very broken */
  -static int
  -get_rfc1413(int sock, const struct sockaddr_in *our_sin,
  -	  const struct sockaddr_in *rmt_sin, char user[256], server_rec *srv)
  +static int get_rfc1413(int sock, const struct sockaddr_in *our_sin,
  +	 const struct sockaddr_in *rmt_sin, char user[256], server_rec *srv)
   {
       struct sockaddr_in rmt_query_sin, our_query_sin;
       unsigned int rmt_port, our_port;
       int i;
       char *cp;
  -    char buffer[RFC1413_MAXDATA+1];
  +    char buffer[RFC1413_MAXDATA + 1];
   
       /*
        * Bind the local and remote ends of the query socket to the same
  @@ -121,9 +120,8 @@
       rmt_query_sin = *rmt_sin;
       rmt_query_sin.sin_port = htons(RFC1413_PORT);
   
  -    if (bind(sock, (struct sockaddr *)&our_query_sin,
  -	     sizeof(struct sockaddr_in)) < 0)
  -    {
  +    if (bind(sock, (struct sockaddr *) &our_query_sin,
  +	     sizeof(struct sockaddr_in)) < 0) {
   	aplog_error(APLOG_MARK, APLOG_CRIT, srv,
   		    "bind: rfc1413: Error binding to local port", srv);
   	return -1;
  @@ -133,14 +131,15 @@
    * errors from connect usually imply the remote machine doesn't support
    * the service
    */
  -    if (connect(sock, (struct sockaddr *)&rmt_query_sin,
  +    if (connect(sock, (struct sockaddr *) &rmt_query_sin,
   		sizeof(struct sockaddr_in)) < 0)
  -	return -1;
  +	            return -1;
   
   /* send the data */
       ap_snprintf(buffer, sizeof(buffer), "%u,%u\r\n", ntohs(rmt_sin->sin_port),
  -	    ntohs(our_sin->sin_port));
  -    do i = write(sock, buffer, strlen(buffer));
  +		ntohs(our_sin->sin_port));
  +    do
  +	i = write(sock, buffer, strlen(buffer));
       while (i == -1 && errno == EINTR);
       if (i == -1) {
   	aplog_error(APLOG_MARK, APLOG_CRIT, srv,
  @@ -152,8 +151,9 @@
        * Read response from server. We assume that all the data
        * comes in a single packet.
        */
  -    
  -    do i = read(sock, buffer, RFC1413_MAXDATA);
  +
  +    do
  +	i = read(sock, buffer, RFC1413_MAXDATA);
       while (i == -1 && errno == EINTR);
       if (i == -1) {
   	aplog_error(APLOG_MARK, APLOG_CRIT, srv,
  @@ -165,30 +165,30 @@
   /* RFC1413_USERLEN = 512 */
       if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port,
   	       user) != 3 || ntohs(rmt_sin->sin_port) != rmt_port
  -	|| ntohs(our_sin->sin_port) != our_port) return -1;
  +	|| ntohs(our_sin->sin_port) != our_port)
  +	return -1;
   
       /*
        * Strip trailing carriage return. It is part of the
        * protocol, not part of the data.
        */
  -    
  -    if ((cp = strchr(user, '\r'))) *cp = '\0';
  +
  +    if ((cp = strchr(user, '\r')))
  +	*cp = '\0';
   
       return 0;
   }
   
   /* ident_timeout - handle timeouts */
  -static void
  -ident_timeout(int sig)
  +static void ident_timeout(int sig)
   {
       ap_longjmp(timebuf, sig);
   }
   
   /* rfc1413 - return remote user name, given socket structures */
  -char *
  -rfc1413(conn_rec *conn, server_rec *srv)
  +char *rfc1413(conn_rec *conn, server_rec *srv)
   {
  -    static char user[RFC1413_USERLEN+1]; /* XXX */
  +    static char user[RFC1413_USERLEN + 1];	/* XXX */
       static char *result;
       static int sock;
   
  @@ -205,8 +205,8 @@
        * Set up a timer so we won't get stuck while waiting for the server.
        */
       if (ap_setjmp(timebuf) == 0) {
  -        set_callback_and_alarm(ident_timeout, rfc1413_timeout);
  -	
  +	set_callback_and_alarm(ident_timeout, rfc1413_timeout);
  +
   	if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user, srv)
>= 0)
   	    result = user;
   
  
  
  

Mime
View raw message