You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2003/09/10 04:11:23 UTC

cvs commit: httpd-python/src/include connobject.h filterobject.h hlist.h hlistobject.h mod_python.h psp_parser.h psp_string.h requestobject.h serverobject.h tableobject.h

grisha      2003/09/09 19:11:23

  Modified:    src      _apachemodule.c _pspmodule.c connobject.c
                        filterobject.c hlist.c mod_python.c psp_parser.l
                        psp_string.c requestobject.c serverobject.c util.c
               src/include connobject.h filterobject.h hlist.h
                        hlistobject.h mod_python.h psp_parser.h
                        psp_string.h requestobject.h serverobject.h
                        tableobject.h
  Log:
  This gigantic patch gets rid of all tabs in C code. I know this is ugly, but
  better late than never!
  
  Revision  Changes    Path
  1.27      +191 -191  httpd-python/src/_apachemodule.c
  
  Index: _apachemodule.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/_apachemodule.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- _apachemodule.c	22 Aug 2003 02:22:44 -0000	1.26
  +++ _apachemodule.c	10 Sep 2003 02:11:22 -0000	1.27
  @@ -85,23 +85,23 @@
       server_rec *serv_rec;
   
       if (! PyArg_ParseTuple(args, "z|iO", &message, &level, &server)) 
  -	return NULL; /* error */
  +        return NULL; /* error */
   
       if (message) {
   
  -	if (! level) 
  -	    level = APLOG_NOERRNO|APLOG_ERR;
  +        if (! level) 
  +            level = APLOG_NOERRNO|APLOG_ERR;
         
  -	if (!server || (PyObject *)server == Py_None)
  -	    serv_rec = NULL;
  -	else {
  -	    if (! MpServer_Check(server)) {
  -		PyErr_BadArgument();
  -		return NULL;
  -	    }
  -	    serv_rec = server->server;
  -	}
  -	ap_log_error(APLOG_MARK, level, 0, serv_rec, "%s", message);
  +        if (!server || (PyObject *)server == Py_None)
  +            serv_rec = NULL;
  +        else {
  +            if (! MpServer_Check(server)) {
  +                PyErr_BadArgument();
  +                return NULL;
  +            }
  +            serv_rec = server->server;
  +        }
  +        ap_log_error(APLOG_MARK, level, 0, serv_rec, "%s", message);
       }
   
       Py_INCREF(Py_None);
  @@ -124,41 +124,41 @@
       int strict_parsing = 0; /* XXX not implemented */
   
       if (! PyArg_ParseTuple(args, "s|ii", &qs, &keep_blank_values, 
  -			   &strict_parsing)) 
  -	return NULL; /* error */
  +                           &strict_parsing)) 
  +        return NULL; /* error */
   
       /* split query string by '&' and ';' into a list of pairs */
       pairs = PyList_New(0);
       if (pairs == NULL)
  -	return NULL;
  +        return NULL;
   
       i = 0;
       len = strlen(qs);
   
       while (i < len) {
   
  -	PyObject *pair;
  -	char *cpair;
  -	int j = 0;
  -
  -	pair = PyString_FromStringAndSize(NULL, len);
  -	if (pair == NULL)
  -	    return NULL;
  -
  -	/* split by '&' or ';' */
  -	cpair = PyString_AS_STRING(pair);
  -	while ((qs[i] != '&') && (qs[i] != ';') && (i < len)) {
  -	    /* replace '+' with ' ' */
  -	    cpair[j] = (qs[i] == '+') ? ' ' : qs[i];
  -	    i++;
  -	    j++;
  -	}
  -	_PyString_Resize(&pair, j);
  -	cpair = PyString_AS_STRING(pair);
  -
  -	PyList_Append(pairs, pair);
  -	Py_DECREF(pair);
  -	i++;
  +        PyObject *pair;
  +        char *cpair;
  +        int j = 0;
  +
  +        pair = PyString_FromStringAndSize(NULL, len);
  +        if (pair == NULL)
  +            return NULL;
  +
  +        /* split by '&' or ';' */
  +        cpair = PyString_AS_STRING(pair);
  +        while ((qs[i] != '&') && (qs[i] != ';') && (i < len)) {
  +            /* replace '+' with ' ' */
  +            cpair[j] = (qs[i] == '+') ? ' ' : qs[i];
  +            i++;
  +            j++;
  +        }
  +        _PyString_Resize(&pair, j);
  +        cpair = PyString_AS_STRING(pair);
  +
  +        PyList_Append(pairs, pair);
  +        Py_DECREF(pair);
  +        i++;
       }
   
       /*
  @@ -168,81 +168,81 @@
       
       dict = PyDict_New();
       if (dict == NULL)
  -	return NULL;
  +        return NULL;
   
       lsize = PyList_Size(pairs);
       n = 0;
   
       while (n < lsize) {
   
  -	PyObject *pair, *key, *val;
  -	char *cpair, *ckey, *cval;
  -	int k, v;
  -
  -	pair = PyList_GET_ITEM(pairs, n);
  -	cpair = PyString_AS_STRING(pair);
  -
  -	len = strlen(cpair);
  -	key = PyString_FromStringAndSize(NULL, len);
  -	if (key == NULL) 
  -	    return NULL;
  -	val = PyString_FromStringAndSize(NULL, len);
  -	if (val == NULL) 
  -	    return NULL;
  -
  -	ckey = PyString_AS_STRING(key);
  -	cval = PyString_AS_STRING(val);
  -
  -	i = 0;
  -	k = 0;
  -	v = 0;
  -	while (i < len) {
  -	    if (cpair[i] != '=') {
  -		ckey[k] = cpair[i];
  -		k++;
  -		i++;
  -	    }
  -	    else {
  -		i++;      /* skip '=' */
  -		while (i < len) {
  -		    cval[v] = cpair[i];
  -		    v++;
  -		    i++;
  -		}
  -	    }
  -	}
  -
  -	ckey[k] = '\0';
  -	cval[v] = '\0';
  -
  -	if (keep_blank_values || (v > 0)) {
  -
  -	    ap_unescape_url(ckey);
  -	    ap_unescape_url(cval);
  -
  -	    _PyString_Resize(&key, strlen(ckey));
  -	    ckey = PyString_AS_STRING(key);
  -	    _PyString_Resize(&val, strlen(cval));
  -	    cval = PyString_AS_STRING(val);
  -	
  -	    if (PyMapping_HasKeyString(dict, ckey)) {
  -		PyObject *list;
  -		list = PyDict_GetItem(dict, key);
  -		PyList_Append(list, val);
  -		/* PyDict_GetItem is a borrowed ref, no decref */
  -	    }
  -	    else {
  -		PyObject *list;
  -		list = Py_BuildValue("[O]", val);
  -		PyDict_SetItem(dict, key, list);
  -		Py_DECREF(list);
  -	    }
  -	}
  +        PyObject *pair, *key, *val;
  +        char *cpair, *ckey, *cval;
  +        int k, v;
  +
  +        pair = PyList_GET_ITEM(pairs, n);
  +        cpair = PyString_AS_STRING(pair);
  +
  +        len = strlen(cpair);
  +        key = PyString_FromStringAndSize(NULL, len);
  +        if (key == NULL) 
  +            return NULL;
  +        val = PyString_FromStringAndSize(NULL, len);
  +        if (val == NULL) 
  +            return NULL;
  +
  +        ckey = PyString_AS_STRING(key);
  +        cval = PyString_AS_STRING(val);
  +
  +        i = 0;
  +        k = 0;
  +        v = 0;
  +        while (i < len) {
  +            if (cpair[i] != '=') {
  +                ckey[k] = cpair[i];
  +                k++;
  +                i++;
  +            }
  +            else {
  +                i++;      /* skip '=' */
  +                while (i < len) {
  +                    cval[v] = cpair[i];
  +                    v++;
  +                    i++;
  +                }
  +            }
  +        }
  +
  +        ckey[k] = '\0';
  +        cval[v] = '\0';
  +
  +        if (keep_blank_values || (v > 0)) {
  +
  +            ap_unescape_url(ckey);
  +            ap_unescape_url(cval);
  +
  +            _PyString_Resize(&key, strlen(ckey));
  +            ckey = PyString_AS_STRING(key);
  +            _PyString_Resize(&val, strlen(cval));
  +            cval = PyString_AS_STRING(val);
  +        
  +            if (PyMapping_HasKeyString(dict, ckey)) {
  +                PyObject *list;
  +                list = PyDict_GetItem(dict, key);
  +                PyList_Append(list, val);
  +                /* PyDict_GetItem is a borrowed ref, no decref */
  +            }
  +            else {
  +                PyObject *list;
  +                list = Py_BuildValue("[O]", val);
  +                PyDict_SetItem(dict, key, list);
  +                Py_DECREF(list);
  +            }
  +        }
   
  -	Py_DECREF(key);
  -	Py_DECREF(val);
  +        Py_DECREF(key);
  +        Py_DECREF(val);
   
  -	n++;
  +        n++;
       }
   
       Py_DECREF(pairs);
  @@ -265,88 +265,88 @@
       int strict_parsing = 0; /* XXX not implemented */
   
       if (! PyArg_ParseTuple(args, "s|ii", &qs, &keep_blank_values, 
  -			   &strict_parsing)) 
  -	return NULL; /* error */
  +                           &strict_parsing)) 
  +        return NULL; /* error */
   
       /* split query string by '&' and ';' into a list of pairs */
       pairs = PyList_New(0);
       if (pairs == NULL)
  -	return NULL;
  +        return NULL;
   
       i = 0;
       len = strlen(qs);
   
       while (i < len) {
   
  -	PyObject *pair, *key, *val;
  -	char *cpair, *ckey, *cval;
  -	int plen, j, p, k, v;
  -
  -	pair = PyString_FromStringAndSize(NULL, len);
  -	if (pair == NULL)
  -	    return NULL;
  -
  -	/* split by '&' or ';' */
  -	cpair = PyString_AS_STRING(pair);
  -	j = 0;
  -	while ((qs[i] != '&') && (qs[i] != ';') && (i < len)) {
  -	    /* replace '+' with ' ' */
  -	    cpair[j] = (qs[i] == '+') ? ' ' : qs[i];
  -	    i++;
  -	    j++;
  -	}
  -	cpair[j] = '\0';
  -	_PyString_Resize(&pair, j);
  -	cpair = PyString_AS_STRING(pair);
  -
  -	/* split the "abc=def" pair */
  -	plen = strlen(cpair);
  -	key = PyString_FromStringAndSize(NULL, plen);
  -	if (key == NULL) 
  -	    return NULL;
  -	val = PyString_FromStringAndSize(NULL, plen);
  -	if (val == NULL) 
  -	    return NULL;
  -
  -	ckey = PyString_AS_STRING(key);
  -	cval = PyString_AS_STRING(val);
  -
  -	p = 0;
  -	k = 0;
  -	v = 0;
  -	while (p < plen) {
  -	    if (cpair[p] != '=') {
  -		ckey[k] = cpair[p];
  -		k++;
  -		p++;
  -	    }
  -	    else {
  -		p++;      /* skip '=' */
  -		while (p < plen) {
  -		    cval[v] = cpair[p];
  -		    v++;
  -		    p++;
  -		}
  -	    }
  -	}
  -	ckey[k] = '\0';
  -	cval[v] = '\0';
  -
  -	if (keep_blank_values || (v > 0)) {
  -
  -	    ap_unescape_url(ckey);
  -	    ap_unescape_url(cval);
  -
  -	    _PyString_Resize(&key, strlen(ckey));
  -	    _PyString_Resize(&val, strlen(cval));
  -
  -	    PyList_Append(pairs, Py_BuildValue("(O,O)", key, val));
  -
  -	}
  -	Py_DECREF(pair);
  -	Py_DECREF(key);
  -	Py_DECREF(val);
  -	i++;
  +        PyObject *pair, *key, *val;
  +        char *cpair, *ckey, *cval;
  +        int plen, j, p, k, v;
  +
  +        pair = PyString_FromStringAndSize(NULL, len);
  +        if (pair == NULL)
  +            return NULL;
  +
  +        /* split by '&' or ';' */
  +        cpair = PyString_AS_STRING(pair);
  +        j = 0;
  +        while ((qs[i] != '&') && (qs[i] != ';') && (i < len)) {
  +            /* replace '+' with ' ' */
  +            cpair[j] = (qs[i] == '+') ? ' ' : qs[i];
  +            i++;
  +            j++;
  +        }
  +        cpair[j] = '\0';
  +        _PyString_Resize(&pair, j);
  +        cpair = PyString_AS_STRING(pair);
  +
  +        /* split the "abc=def" pair */
  +        plen = strlen(cpair);
  +        key = PyString_FromStringAndSize(NULL, plen);
  +        if (key == NULL) 
  +            return NULL;
  +        val = PyString_FromStringAndSize(NULL, plen);
  +        if (val == NULL) 
  +            return NULL;
  +
  +        ckey = PyString_AS_STRING(key);
  +        cval = PyString_AS_STRING(val);
  +
  +        p = 0;
  +        k = 0;
  +        v = 0;
  +        while (p < plen) {
  +            if (cpair[p] != '=') {
  +                ckey[k] = cpair[p];
  +                k++;
  +                p++;
  +            }
  +            else {
  +                p++;      /* skip '=' */
  +                while (p < plen) {
  +                    cval[v] = cpair[p];
  +                    v++;
  +                    p++;
  +                }
  +            }
  +        }
  +        ckey[k] = '\0';
  +        cval[v] = '\0';
  +
  +        if (keep_blank_values || (v > 0)) {
  +
  +            ap_unescape_url(ckey);
  +            ap_unescape_url(cval);
  +
  +            _PyString_Resize(&key, strlen(ckey));
  +            _PyString_Resize(&val, strlen(cval));
  +
  +            PyList_Append(pairs, Py_BuildValue("(O,O)", key, val));
  +
  +        }
  +        Py_DECREF(pair);
  +        Py_DECREF(key);
  +        Py_DECREF(val);
  +        i++;
       }
   
       return pairs;
  @@ -402,7 +402,7 @@
       s = ((serverobject *)server)->server;
   
       apr_pool_userdata_get((void **)&glb, MP_CONFIG_KEY,
  -			  s->process->pool);
  +                          s->process->pool);
       
       if (index == -1) {
   
  @@ -419,24 +419,24 @@
            * locking (see Session.py)
            */
           
  -	index = (hash % (glb->nlocks-1)+1);
  +        index = (hash % (glb->nlocks-1)+1);
       }
   
   /*     ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, */
  -/* 		 "_global_lock at index %d from pid %d", index, getpid()); */
  +/*               "_global_lock at index %d from pid %d", index, getpid()); */
       Py_BEGIN_ALLOW_THREADS
       rv = apr_global_mutex_lock(glb->g_locks[index]);        
       Py_END_ALLOW_THREADS                               
       if (rv != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s,
                        "Failed to acquire global mutex lock at index %d", index);
  -	PyErr_SetString(PyExc_ValueError,
  -			"Failed to acquire global mutex lock");
  +        PyErr_SetString(PyExc_ValueError,
  +                        "Failed to acquire global mutex lock");
           return NULL;
       }
   /*     ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, */
  -/* 		 "_global_lock DONE at index %d from pid %d", index, getpid()); */
  -	
  +/*               "_global_lock DONE at index %d from pid %d", index, getpid()); */
  +        
       Py_INCREF(Py_None);
       return Py_None;
   }
  @@ -469,7 +469,7 @@
       s = ((serverobject *)server)->server;
   
       apr_pool_userdata_get((void **)&glb, MP_CONFIG_KEY,
  -			  s->process->pool);
  +                          s->process->pool);
       
       if (index == -1) {
   
  @@ -486,7 +486,7 @@
            * locking (see Session.py)
            */
           
  -	index = (hash % (glb->nlocks-1)+1);
  +        index = (hash % (glb->nlocks-1)+1);
       }
       
   /*     ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, */
  @@ -494,11 +494,11 @@
       if ((rv = apr_global_mutex_unlock(glb->g_locks[index])) != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s,
                        "Failed to release global mutex lock at index %d", index);
  -	PyErr_SetString(PyExc_ValueError,
  -			"Failed to release global mutex lock");
  +        PyErr_SetString(PyExc_ValueError,
  +                        "Failed to release global mutex lock");
           return NULL;
       }
  -	
  +        
       Py_INCREF(Py_None);
       return Py_None;
   }
  @@ -556,7 +556,7 @@
       d = PyModule_GetDict(m);
       Mp_ServerReturn = PyErr_NewException("_apache.SERVER_RETURN", NULL, NULL);
       if (Mp_ServerReturn == NULL)
  -	return;
  +        return;
       PyDict_SetItemString(d, "SERVER_RETURN", Mp_ServerReturn);
   
       PyDict_SetItemString(d, "table", (PyObject *)&MpTable_Type);
  
  
  
  1.6       +13 -13    httpd-python/src/_pspmodule.c
  
  Index: _pspmodule.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/_pspmodule.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- _pspmodule.c	5 Aug 2003 19:28:26 -0000	1.5
  +++ _pspmodule.c	10 Sep 2003 02:11:22 -0000	1.6
  @@ -114,14 +114,14 @@
       }
   
       if (dir) {
  -	path = malloc(strlen(filename)+strlen(dir)+1);
  -	if (!path) 
  -	    return PyErr_NoMemory();
  -	strcpy(path, dir);
  -	strcat(path, filename);
  +        path = malloc(strlen(filename)+strlen(dir)+1);
  +        if (!path) 
  +            return PyErr_NoMemory();
  +        strcpy(path, dir);
  +        strcat(path, filename);
       }
       else {
  -	path = filename;
  +        path = filename;
       }
       
       Py_BEGIN_ALLOW_THREADS
  @@ -130,14 +130,14 @@
   
       if (f == NULL) {
           PyErr_SetFromErrnoWithFilename(PyExc_IOError, path);
  -	if (dir) free(path);
  +        if (dir) free(path);
           return NULL;
       }
       if (dir) free(path);
   
       parser = psp_parser_init();
       if (dir)
  -	parser->dir = dir;
  +        parser->dir = dir;
   
       yylex_init(&scanner);
       yyset_in(f, scanner);
  @@ -149,15 +149,15 @@
       psp_string_0(&parser->pycode);
   
       if (PyErr_Occurred()) {
  -	psp_parser_cleanup(parser);
  -	return NULL;
  +        psp_parser_cleanup(parser);
  +        return NULL;
       }
   
       if (parser->pycode.blob) {
  -	code = PyString_FromString(parser->pycode.blob);
  +        code = PyString_FromString(parser->pycode.blob);
       }
       else {
  -	code = PyString_FromString("");
  +        code = PyString_FromString("");
       }
   
       psp_parser_cleanup(parser);
  
  
  
  1.16      +42 -42    httpd-python/src/connobject.c
  
  Index: connobject.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/connobject.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- connobject.c	17 Jul 2003 00:51:46 -0000	1.15
  +++ connobject.c	10 Sep 2003 02:11:22 -0000	1.16
  @@ -133,7 +133,7 @@
   
       if (APR_BUCKET_IS_EOS(b)) { 
           apr_bucket_delete(b);
  -	Py_INCREF(Py_None);
  +        Py_INCREF(Py_None);
           return Py_None;
       }
   
  @@ -151,34 +151,34 @@
              !(b == APR_BRIGADE_SENTINEL(b) ||
                APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
   
  -	const char *data;
  -	apr_size_t size;
  -	apr_bucket *old;
  -
  -	if (apr_bucket_read(b, &data, &size, APR_BLOCK_READ) != APR_SUCCESS) {
  -	    PyErr_SetObject(PyExc_IOError, 
  -			    PyString_FromString("Connection read error"));
  -	    return NULL;
  -	}
  -
  -	if (bytes_read + size > bufsize) {
  -	    apr_bucket_split(b, bufsize - bytes_read);
  -	    size = bufsize - bytes_read;
  -	    /* now the bucket is the exact size we need */
  -	}
  -
  -	memcpy(buffer, data, size);
  -	buffer += size;
  -	bytes_read += size;
  -
  -	/* time to grow destination string? */
  -	if (len == 0 && bytes_read == bufsize) {
  -
  -	    _PyString_Resize(&result, bufsize + HUGE_STRING_LEN);
  -	    buffer = PyString_AS_STRING((PyStringObject *) result);
  -	    buffer += HUGE_STRING_LEN;
  -	    bufsize += HUGE_STRING_LEN;
  -	}
  +        const char *data;
  +        apr_size_t size;
  +        apr_bucket *old;
  +
  +        if (apr_bucket_read(b, &data, &size, APR_BLOCK_READ) != APR_SUCCESS) {
  +            PyErr_SetObject(PyExc_IOError, 
  +                            PyString_FromString("Connection read error"));
  +            return NULL;
  +        }
  +
  +        if (bytes_read + size > bufsize) {
  +            apr_bucket_split(b, bufsize - bytes_read);
  +            size = bufsize - bytes_read;
  +            /* now the bucket is the exact size we need */
  +        }
  +
  +        memcpy(buffer, data, size);
  +        buffer += size;
  +        bytes_read += size;
  +
  +        /* time to grow destination string? */
  +        if (len == 0 && bytes_read == bufsize) {
  +
  +            _PyString_Resize(&result, bufsize + HUGE_STRING_LEN);
  +            buffer = PyString_AS_STRING((PyStringObject *) result);
  +            buffer += HUGE_STRING_LEN;
  +            bufsize += HUGE_STRING_LEN;
  +        }
   
   
           if (mode == AP_MODE_GETLINE || len == 0) {
  @@ -186,15 +186,15 @@
               break;
           }
   
  -	old = b;
  -	b = APR_BUCKET_NEXT(b);
  -	apr_bucket_delete(old);
  +        old = b;
  +        b = APR_BUCKET_NEXT(b);
  +        apr_bucket_delete(old);
       }
   
       /* resize if necessary */
       if (bytes_read < len || len == 0) 
  -	if(_PyString_Resize(&result, bytes_read))
  -	    return NULL;
  +        if(_PyString_Resize(&result, bytes_read))
  +            return NULL;
   
       return result;
   }
  @@ -249,22 +249,22 @@
       conn_rec *c = self->conn;
   
       if (! PyArg_ParseTuple(args, "O", &s)) 
  -	return NULL;
  +        return NULL;
   
       if (! PyString_Check(s)) {
  -	PyErr_SetString(PyExc_TypeError, "Argument to write() must be a string");
  -	return NULL;
  +        PyErr_SetString(PyExc_TypeError, "Argument to write() must be a string");
  +        return NULL;
       }
   
       len = PyString_Size(s);
   
       if (len) {
  -	buff = apr_pmemdup(c->pool, PyString_AS_STRING(s), len);
  +        buff = apr_pmemdup(c->pool, PyString_AS_STRING(s), len);
   
           bb = apr_brigade_create(c->pool, c->bucket_alloc);
   
  -	b = apr_bucket_pool_create(buff, len, c->pool, c->bucket_alloc);
  -	APR_BRIGADE_INSERT_TAIL(bb, b);
  +        b = apr_bucket_pool_create(buff, len, c->pool, c->bucket_alloc);
  +        APR_BRIGADE_INSERT_TAIL(bb, b);
   
           /* Make sure the data is flushed to the client */
           b = apr_bucket_flush_create(c->bucket_alloc);
  @@ -372,7 +372,7 @@
   
       res = Py_FindMethod(connobjectmethods, (PyObject *)self, name);
       if (res != NULL)
  -	return res;
  +        return res;
       
       PyErr_Clear();
   
  
  
  
  1.23      +133 -133  httpd-python/src/filterobject.c
  
  Index: filterobject.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/filterobject.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- filterobject.c	5 May 2003 02:23:28 -0000	1.22
  +++ filterobject.c	10 Sep 2003 02:11:22 -0000	1.23
  @@ -113,14 +113,14 @@
    */
   
   PyObject *MpFilter_FromFilter(ap_filter_t *f, apr_bucket_brigade *bb, int is_input,
  -			      ap_input_mode_t mode, apr_size_t readbytes,
  -			      char * handler, char *dir)
  +                              ap_input_mode_t mode, apr_size_t readbytes,
  +                              char * handler, char *dir)
   {
       filterobject *result;
   
       result = PyMem_NEW(filterobject, 1);
       if (! result)
  -	return PyErr_NoMemory();
  +        return PyErr_NoMemory();
   
       result->f = f;
       result->ob_type = &MpFilter_Type;
  @@ -129,16 +129,16 @@
       result->rc = APR_SUCCESS;
   
       if (is_input) {
  -	result->bb_in = NULL;
  -	result->bb_out = bb;
  -	result->mode = mode;
  -	result->readbytes = readbytes;
  +        result->bb_in = NULL;
  +        result->bb_out = bb;
  +        result->mode = mode;
  +        result->readbytes = readbytes;
       }
       else {
  -	result->bb_in = bb;
  -	result->bb_out = NULL;
  -	result->mode = 0;
  -	result->readbytes = 0;
  +        result->bb_in = bb;
  +        result->bb_out = NULL;
  +        result->mode = 0;
  +        result->readbytes = 0;
       }
   
       result->closed = 0;
  @@ -151,7 +151,7 @@
   
       _Py_NewReference(result);
       apr_pool_cleanup_register(f->r->pool, (PyObject *)result, python_decref, 
  -			      apr_pool_cleanup_null);
  +                              apr_pool_cleanup_null);
   
       return (PyObject *)result;
   }
  @@ -199,7 +199,7 @@
       conn_rec *c = self->request_obj->request_rec->connection;
   
       if (! PyArg_ParseTuple(args, "|l", &len)) 
  -	return NULL;
  +        return NULL;
   
       if (self->closed) {
           PyErr_SetString(PyExc_ValueError, "I/O operation on closed filter");
  @@ -208,22 +208,22 @@
   
       if (self->is_input) {
   
  -	/* does the output brigade exist? */
  -	if (!self->bb_in) {
  -	    self->bb_in = apr_brigade_create(self->f->r->pool, 
  -					     c->bucket_alloc);
  -	}
  -
  -	Py_BEGIN_ALLOW_THREADS;
  -	self->rc = ap_get_brigade(self->f->next, self->bb_in, self->mode, 
  -				  APR_BLOCK_READ, self->readbytes);
  -	Py_END_ALLOW_THREADS;
  -
  -	if (! APR_STATUS_IS_SUCCESS(self->rc)) {
  -	    PyErr_SetObject(PyExc_IOError, 
  -			    PyString_FromString("Input filter read error"));
  -	    return NULL;
  -	}
  +        /* does the output brigade exist? */
  +        if (!self->bb_in) {
  +            self->bb_in = apr_brigade_create(self->f->r->pool, 
  +                                             c->bucket_alloc);
  +        }
  +
  +        Py_BEGIN_ALLOW_THREADS;
  +        self->rc = ap_get_brigade(self->f->next, self->bb_in, self->mode, 
  +                                  APR_BLOCK_READ, self->readbytes);
  +        Py_END_ALLOW_THREADS;
  +
  +        if (! APR_STATUS_IS_SUCCESS(self->rc)) {
  +            PyErr_SetObject(PyExc_IOError, 
  +                            PyString_FromString("Input filter read error"));
  +            return NULL;
  +        }
       }
   
       /* 
  @@ -257,28 +257,28 @@
              !(APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b) ||
                b == APR_BRIGADE_SENTINEL(self->bb_in))) {
   
  -	const char *data;
  -	apr_size_t size;
  -	apr_bucket *old;
  -	int i;
  -
  -	if (apr_bucket_read(b, &data, &size, APR_BLOCK_READ) != APR_SUCCESS) {
  -	    PyErr_SetObject(PyExc_IOError, 
  -			    PyString_FromString("Filter read error"));
  -	    return NULL;
  -	}
  -
  -	if (bytes_read + size > bufsize) {
  -	    apr_bucket_split(b, bufsize - bytes_read);
  -	    size = bufsize - bytes_read;
  -	    /* now the bucket is the exact size we need */
  -	}
  -
  -	if (readline) {
  -
  -	    /* scan for newline */
  -	    for (i=0; i<size; i++) {
  -		if (data[i] == '\n') {
  +        const char *data;
  +        apr_size_t size;
  +        apr_bucket *old;
  +        int i;
  +
  +        if (apr_bucket_read(b, &data, &size, APR_BLOCK_READ) != APR_SUCCESS) {
  +            PyErr_SetObject(PyExc_IOError, 
  +                            PyString_FromString("Filter read error"));
  +            return NULL;
  +        }
  +
  +        if (bytes_read + size > bufsize) {
  +            apr_bucket_split(b, bufsize - bytes_read);
  +            size = bufsize - bytes_read;
  +            /* now the bucket is the exact size we need */
  +        }
  +
  +        if (readline) {
  +
  +            /* scan for newline */
  +            for (i=0; i<size; i++) {
  +                if (data[i] == '\n') {
                       if (i+1 != size) {   /* (no need to split if we're at end of bucket) */
                           
                           /* split after newline */
  @@ -286,59 +286,59 @@
                           size = i + 1;
                       }
                       newline = 1;
  -		    break;
  -		}
  -	    }
  -	}
  -
  -	memcpy(buffer, data, size);
  -	buffer += size;
  -	bytes_read += size;
  -
  -	/* time to grow destination string? */
  -	if (newline == 0 && len < 0 && bytes_read == bufsize) {
  -
  -	    _PyString_Resize(&result, bufsize + HUGE_STRING_LEN);
  -	    buffer = PyString_AS_STRING((PyStringObject *) result);
  -	    buffer += HUGE_STRING_LEN;
  +                    break;
  +                }
  +            }
  +        }
  +
  +        memcpy(buffer, data, size);
  +        buffer += size;
  +        bytes_read += size;
  +
  +        /* time to grow destination string? */
  +        if (newline == 0 && len < 0 && bytes_read == bufsize) {
  +
  +            _PyString_Resize(&result, bufsize + HUGE_STRING_LEN);
  +            buffer = PyString_AS_STRING((PyStringObject *) result);
  +            buffer += HUGE_STRING_LEN;
   
  -	    bufsize += HUGE_STRING_LEN;
  -	}
  +            bufsize += HUGE_STRING_LEN;
  +        }
   
  -	if (readline && newline) {
  +        if (readline && newline) {
               apr_bucket_delete(b);
  -	    break;
  +            break;
           }
   
  -	old = b;
  -	b = APR_BUCKET_NEXT(b);
  -	apr_bucket_delete(old);
  -	
  -	if (self->is_input) {
  -
  -	    if (b == APR_BRIGADE_SENTINEL(self->bb_in)) {
  -		/* brigade ended, but no EOS - get another
  -		   brigade */
  -
  -		Py_BEGIN_ALLOW_THREADS;
  -		self->rc = ap_get_brigade(self->f->next, self->bb_in, self->mode, 
  -					  APR_BLOCK_READ, self->readbytes);
  -		Py_END_ALLOW_THREADS;
  -
  -		if (! APR_STATUS_IS_SUCCESS(self->rc)) {
  -		    PyErr_SetObject(PyExc_IOError, 
  -				    PyString_FromString("Input filter read error"));
  -		    return NULL;
  -		}
  -		b = APR_BRIGADE_FIRST(self->bb_in);
  -	    }
  -	}
  +        old = b;
  +        b = APR_BUCKET_NEXT(b);
  +        apr_bucket_delete(old);
  +        
  +        if (self->is_input) {
  +
  +            if (b == APR_BRIGADE_SENTINEL(self->bb_in)) {
  +                /* brigade ended, but no EOS - get another
  +                   brigade */
  +
  +                Py_BEGIN_ALLOW_THREADS;
  +                self->rc = ap_get_brigade(self->f->next, self->bb_in, self->mode, 
  +                                          APR_BLOCK_READ, self->readbytes);
  +                Py_END_ALLOW_THREADS;
  +
  +                if (! APR_STATUS_IS_SUCCESS(self->rc)) {
  +                    PyErr_SetObject(PyExc_IOError, 
  +                                    PyString_FromString("Input filter read error"));
  +                    return NULL;
  +                }
  +                b = APR_BRIGADE_FIRST(self->bb_in);
  +            }
  +        }
       }
   
       /* resize if necessary */
       if (bytes_read < len || len < 0) 
  -	if(_PyString_Resize(&result, bytes_read))
  -	    return NULL;
  +        if(_PyString_Resize(&result, bytes_read))
  +            return NULL;
   
       return result;
   }
  @@ -382,11 +382,11 @@
       conn_rec *c = self->request_obj->request_rec->connection;
   
       if (! PyArg_ParseTuple(args, "O", &s)) 
  -	return NULL;
  +        return NULL;
   
       if (! PyString_Check(s)) {
  -	PyErr_SetString(PyExc_TypeError, "Argument to write() must be a string");
  -	return NULL;
  +        PyErr_SetString(PyExc_TypeError, "Argument to write() must be a string");
  +        return NULL;
       }
   
       if (self->closed) {
  @@ -398,19 +398,19 @@
   
       if (len) {
   
  -	/* does the output brigade exist? */
  -	if (!self->bb_out) {
  -	    self->bb_out = apr_brigade_create(self->f->r->pool, 
  -					      c->bucket_alloc);
  -	}
  -	
  +        /* does the output brigade exist? */
  +        if (!self->bb_out) {
  +            self->bb_out = apr_brigade_create(self->f->r->pool, 
  +                                              c->bucket_alloc);
  +        }
  +        
           buff = apr_bucket_alloc(len, c->bucket_alloc);
           memcpy(buff, PyString_AS_STRING(s), len);
   
           b = apr_bucket_heap_create(buff, len, apr_bucket_free,
                                      c->bucket_alloc);
   
  -	APR_BRIGADE_INSERT_TAIL(self->bb_out, b);
  +        APR_BRIGADE_INSERT_TAIL(self->bb_out, b);
   
       }
   
  @@ -431,12 +431,12 @@
   
       /* does the output brigade exist? */
       if (!self->bb_out) {
  -	self->bb_out = apr_brigade_create(self->f->r->pool,
  -					  c->bucket_alloc);
  +        self->bb_out = apr_brigade_create(self->f->r->pool,
  +                                          c->bucket_alloc);
       }
   
       APR_BRIGADE_INSERT_TAIL(self->bb_out, 
  -			    apr_bucket_flush_create(c->bucket_alloc));
  +                            apr_bucket_flush_create(c->bucket_alloc));
   
       Py_BEGIN_ALLOW_THREADS;
       self->rc = ap_pass_brigade(self->f->next, self->bb_out);
  @@ -444,8 +444,8 @@
       Py_END_ALLOW_THREADS;
   
       if(self->rc != APR_SUCCESS) { 
  -	PyErr_SetString(PyExc_IOError, "Flush failed.");
  -	return NULL;
  +        PyErr_SetString(PyExc_IOError, "Flush failed.");
  +        return NULL;
       }
   
       Py_INCREF(Py_None);
  @@ -474,7 +474,7 @@
   
           APR_BRIGADE_INSERT_TAIL(self->bb_out, 
                                   apr_bucket_eos_create(c->bucket_alloc));
  -	
  +        
           if (! self->is_input) {
               Py_BEGIN_ALLOW_THREADS;
               self->rc = ap_pass_brigade(self->f->next, self->bb_out);
  @@ -483,7 +483,7 @@
               self->bb_out = NULL;
           }
   
  -	self->closed = 1;
  +        self->closed = 1;
       }
   
       Py_INCREF(Py_None);
  @@ -564,31 +564,31 @@
   
       res = Py_FindMethod(filterobjectmethods, (PyObject *)self, name);
       if (res != NULL)
  -	return res;
  +        return res;
       
       PyErr_Clear();
   
       if (strcmp(name, "name") == 0) {
  -	if (! self->f->frec->name) {
  -	    Py_INCREF(Py_None);
  -	    return Py_None;
  -	}
  -	else {
  -	    return PyString_FromString(self->f->frec->name);
  -	}
  +        if (! self->f->frec->name) {
  +            Py_INCREF(Py_None);
  +            return Py_None;
  +        }
  +        else {
  +            return PyString_FromString(self->f->frec->name);
  +        }
       } 
       else if (strcmp(name, "req") == 0) {
  -	if (! self->request_obj) {
  -	    Py_INCREF(Py_None);
  -	    return Py_None;
  -	}
  -	else {
  -	    Py_INCREF(self->request_obj);
  -	    return (PyObject *)self->request_obj;
  -	}
  +        if (! self->request_obj) {
  +            Py_INCREF(Py_None);
  +            return Py_None;
  +        }
  +        else {
  +            Py_INCREF(self->request_obj);
  +            return (PyObject *)self->request_obj;
  +        }
       }
       else
  -	return PyMember_Get((char *)self, filter_memberlist, name);
  +        return PyMember_Get((char *)self, filter_memberlist, name);
   }
   
   /**
  @@ -601,9 +601,9 @@
   static int filter_setattr(filterobject *self, char *name, PyObject *v)
   {
       if (v == NULL) {
  -	PyErr_SetString(PyExc_AttributeError,
  -			"can't delete filter attributes");
  -	return -1;
  +        PyErr_SetString(PyExc_AttributeError,
  +                        "can't delete filter attributes");
  +        return -1;
       }
       return PyMember_Set((char *)self, filter_memberlist, name, v);
   }
  
  
  
  1.4       +11 -11    httpd-python/src/hlist.c
  
  Index: hlist.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/hlist.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- hlist.c	8 Nov 2002 00:15:11 -0000	1.3
  +++ hlist.c	10 Sep 2003 02:11:22 -0000	1.4
  @@ -73,7 +73,7 @@
    */
   
   hl_entry *hlist_new(apr_pool_t *p, const char *h, const char *d, 
  -		    const int s)
  +                    const int s)
   {
       hl_entry *hle;
   
  @@ -96,13 +96,13 @@
    */
   
   hl_entry *hlist_append(apr_pool_t *p, hl_entry *hle, const char * h,
  -		       const char *d, const int s)
  +                       const char *d, const int s)
   {
       hl_entry *nhle;
   
       /* find tail */
       while (hle && hle->next)
  -	hle = hle->next;
  +        hle = hle->next;
   
       nhle = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
   
  @@ -111,7 +111,7 @@
       nhle->silent = s;
   
       if (hle)
  -	hle->next = nhle;
  +        hle->next = nhle;
   
       return nhle;
   }
  @@ -134,12 +134,12 @@
       hle = hle->next;
       nhle = head;
       while (hle) {
  -	nhle->next = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
  -	nhle = nhle->next;
  -	nhle->handler = apr_pstrdup(p, hle->handler);
  -	nhle->directory = apr_pstrdup(p, hle->directory);
  -	nhle->silent = hle->silent;
  -	hle = hle->next;
  +        nhle->next = (hl_entry *)apr_pcalloc(p, sizeof(hl_entry));
  +        nhle = nhle->next;
  +        nhle->handler = apr_pstrdup(p, hle->handler);
  +        nhle->directory = apr_pstrdup(p, hle->directory);
  +        nhle->silent = hle->silent;
  +        hle = hle->next;
       }
   
       return head;
  
  
  
  1.101     +52 -52    httpd-python/src/mod_python.c
  
  Index: mod_python.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/mod_python.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- mod_python.c	8 Sep 2003 19:31:50 -0000	1.100
  +++ mod_python.c	10 Sep 2003 02:11:22 -0000	1.101
  @@ -335,62 +335,62 @@
       ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
       ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_procs);
       max_clients = (((!max_threads) ? 1 : max_threads) *
  -		   ((!max_procs) ? 1 : max_procs));
  +                   ((!max_procs) ? 1 : max_procs));
       locks = max_clients; /* XXX this is completely out of the blue */
   
       ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s,
  -		 "mod_python: Creating %d session mutexes based "
  -		 "on %d max processes and %d max threads.", 
  -		 locks, max_procs, max_threads);
  +                 "mod_python: Creating %d session mutexes based "
  +                 "on %d max processes and %d max threads.", 
  +                 locks, max_procs, max_threads);
   
       glb->g_locks = (apr_global_mutex_t **) 
  -	apr_palloc(p, locks * sizeof(apr_global_mutex_t *));
  +        apr_palloc(p, locks * sizeof(apr_global_mutex_t *));
       glb->nlocks = locks;
       glb->parent_pid = getpid();
   
       for (n=0; n<locks; n++) {
  -	apr_status_t rc;
  -	apr_global_mutex_t **mutex = glb->g_locks;
  +        apr_status_t rc;
  +        apr_global_mutex_t **mutex = glb->g_locks;
   
   #if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
  -	char fname[255];
  +        char fname[255];
   
  -	snprintf(fname, 255, "/tmp/mpmtx%d%d", glb->parent_pid, n);
  +        snprintf(fname, 255, "/tmp/mpmtx%d%d", glb->parent_pid, n);
   #else
  -	char *fname = NULL;
  +        char *fname = NULL;
   #endif
  -	rc = apr_global_mutex_create(&mutex[n], fname, APR_LOCK_DEFAULT, 
  -				     p);
  -	if (rc != APR_SUCCESS) {
  -	    ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
  -			 "mod_python: Failed to create global mutex %d of %d (%s).",
  -			 n, locks, (!fname) ? "<null>" : fname);
  -	    if (n > 1) {
  -		/* we were able to crate at least two, so lets just print a 
  -		   warning/hint and proceed
  -		*/
  -		ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
  -			     "mod_python: We can probably continue, but with diminished ability "
  -			     "to process session locks.");
  -		ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
  -			     "mod_python: Hint: On Linux, the problem may be the number of "
  -			     "available semaphores, check 'sysctl kernel.sem'");
  -		/* now free one lock so that if there is a module that wants a lock, it
  -		   will be ok */
  -		apr_global_mutex_destroy(mutex[n-1]);
  -		glb->nlocks = n-1;
  -		break;
  -		
  -	    }
  -	    else {
  -		return rc;
  -	    }
  -	}
  -	else {
  +        rc = apr_global_mutex_create(&mutex[n], fname, APR_LOCK_DEFAULT, 
  +                                     p);
  +        if (rc != APR_SUCCESS) {
  +            ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
  +                         "mod_python: Failed to create global mutex %d of %d (%s).",
  +                         n, locks, (!fname) ? "<null>" : fname);
  +            if (n > 1) {
  +                /* we were able to crate at least two, so lets just print a 
  +                   warning/hint and proceed
  +                */
  +                ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
  +                             "mod_python: We can probably continue, but with diminished ability "
  +                             "to process session locks.");
  +                ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
  +                             "mod_python: Hint: On Linux, the problem may be the number of "
  +                             "available semaphores, check 'sysctl kernel.sem'");
  +                /* now free one lock so that if there is a module that wants a lock, it
  +                   will be ok */
  +                apr_global_mutex_destroy(mutex[n-1]);
  +                glb->nlocks = n-1;
  +                break;
  +                
  +            }
  +            else {
  +                return rc;
  +            }
  +        }
  +        else {
   #if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
  -	    chown(fname, unixd_config.user_id, -1);
  +            chown(fname, unixd_config.user_id, -1);
   #endif
  -	}
  +        }
       }
       return APR_SUCCESS;
   }
  @@ -400,8 +400,8 @@
       int n;
   
       for (n=0; n< glb->nlocks; n++) {
  -	apr_status_t rc;
  -	apr_global_mutex_t **mutex = glb->g_locks;
  +        apr_status_t rc;
  +        apr_global_mutex_t **mutex = glb->g_locks;
   
   #if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
           char fname[255];
  @@ -409,14 +409,14 @@
   #else
           char *fname = NULL;
   #endif
  -	rc = apr_global_mutex_child_init(&mutex[n], fname, p);
  +        rc = apr_global_mutex_child_init(&mutex[n], fname, p);
   
  -	if (rc != APR_SUCCESS) {
  -	    ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, s,
  -			 "mod_python: Failed to reinit global mutex %s.",
  -			 (!fname) ? "<null>" : fname);
  -	    return rc;
  -	}
  +        if (rc != APR_SUCCESS) {
  +            ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, s,
  +                         "mod_python: Failed to reinit global mutex %s.",
  +                         (!fname) ? "<null>" : fname);
  +            return rc;
  +        }
       }
       return APR_SUCCESS;
   }
  @@ -484,7 +484,7 @@
       /* global config */
       glb = python_create_global_config(s);
       if ((rc = init_mutexes(s, p, glb)) != APR_SUCCESS) {
  -	return rc;
  +        return rc;
       }
   
       /* initialize global Python interpreter if necessary */
  @@ -1843,7 +1843,7 @@
        * above).
        */
       if (!req->handler || (strcmp(req->handler, "mod_python") &&
  -			  strcmp(req->handler, "python-program")))
  +                          strcmp(req->handler, "python-program")))
           return DECLINED;
   
       return python_handler(req, "PythonHandler");
  
  
  
  1.16      +20 -20    httpd-python/src/psp_parser.l
  
  Index: psp_parser.l
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/psp_parser.l,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- psp_parser.l	11 Aug 2003 20:13:03 -0000	1.15
  +++ psp_parser.l	10 Sep 2003 02:11:22 -0000	1.16
  @@ -68,8 +68,8 @@
   #include "psp_parser.h"
   
   #define OUTPUT_WHITESPACE(__wsstring) \
  -	psp_string_0((__wsstring)); \
  -	psp_string_append(&PSP_PG(pycode), (__wsstring)->blob)
  +        psp_string_0((__wsstring)); \
  +        psp_string_append(&PSP_PG(pycode), (__wsstring)->blob)
   
   #define CLEAR_WHITESPACE(__wsstring) psp_string_clear((__wsstring));
   
  @@ -136,13 +136,13 @@
   <TEXT><<EOF>> {
       yypop_buffer_state(yyscanner);
       if (!YY_CURRENT_BUFFER) {
  -	/* this is really the end */
  -	psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\")\n"));
  -	yyterminate();
  +        /* this is really the end */
  +        psp_string_appendl(&PSP_PG(pycode), STATIC_STR("\"\"\")\n"));
  +        yyterminate();
       }
       else {
  -	/* we are inside include, continue scanning */
  -	BEGIN DIR;
  +        /* we are inside include, continue scanning */
  +        BEGIN DIR;
       }
   }
   
  @@ -225,28 +225,28 @@
       filename[strchr(filename, '"')-filename] = '\0';
   
       if (PSP_PG(dir)) {
  -	path = malloc(strlen(filename)+strlen(PSP_PG(dir))+1);
  -	if (path == NULL) {
  -	    PyErr_NoMemory();
  -	    yyterminate();
  -	}
  -	strcpy(path, PSP_PG(dir));
  -	strcat(path, filename);
  +        path = malloc(strlen(filename)+strlen(PSP_PG(dir))+1);
  +        if (path == NULL) {
  +            PyErr_NoMemory();
  +            yyterminate();
  +        }
  +        strcpy(path, PSP_PG(dir));
  +        strcat(path, filename);
       }
       else {
  -	path = filename;
  +        path = filename;
       }
   
       Py_BEGIN_ALLOW_THREADS
       f = fopen(path, "rb");
       Py_END_ALLOW_THREADS
       if (f == NULL) {
  -	PyErr_SetFromErrnoWithFilename(PyExc_IOError, path);
  +        PyErr_SetFromErrnoWithFilename(PyExc_IOError, path);
       }
       else {
  -	yypush_buffer_state(yy_create_buffer(f, YY_BUF_SIZE, yyscanner), 
  -			    yyscanner);
  -	BEGIN(TEXT);
  +        yypush_buffer_state(yy_create_buffer(f, YY_BUF_SIZE, yyscanner), 
  +                            yyscanner);
  +        BEGIN(TEXT);
       }
   
       if (PSP_PG(dir)) free(path);
  
  
  
  1.2       +33 -33    httpd-python/src/psp_string.c
  
  Index: psp_string.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/psp_string.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- psp_string.c	9 Apr 2003 14:05:55 -0000	1.1
  +++ psp_string.c	10 Sep 2003 02:11:22 -0000	1.2
  @@ -62,66 +62,66 @@
   #include "psp_string.h"
   
   #define psp_string_alloc(__pspstring, __length) \
  -	if ((__length) > (__pspstring)->allocated) { \
  -		(__pspstring)->blob = realloc((__pspstring)->blob, (__length) + PSP_STRING_BLOCK); \
  -		(__pspstring)->allocated = (__length) + PSP_STRING_BLOCK; \
  -	}
  +        if ((__length) > (__pspstring)->allocated) { \
  +                (__pspstring)->blob = realloc((__pspstring)->blob, (__length) + PSP_STRING_BLOCK); \
  +                (__pspstring)->allocated = (__length) + PSP_STRING_BLOCK; \
  +        }
   
   void 
   psp_string_0(psp_string *s)
   {
  -	if (!s->length) {
  -		return;
  -	}
  +        if (!s->length) {
  +                return;
  +        }
   
  -	s->blob[s->length] = '\0';
  +        s->blob[s->length] = '\0';
   }
   
   void
   psp_string_appendl(psp_string *s, char *text, size_t length)
   {
  -	int newlen = s->length + length;
  +        int newlen = s->length + length;
   
  -	if (text == NULL) {
  -		return;
  -	}
  -	
  -	psp_string_alloc(s, newlen);
  -	memcpy(s->blob + s->length, text, length);
  -	s->length = newlen;
  +        if (text == NULL) {
  +                return;
  +        }
  +        
  +        psp_string_alloc(s, newlen);
  +        memcpy(s->blob + s->length, text, length);
  +        s->length = newlen;
   }
   
   void
   psp_string_append(psp_string *s, char *text)
   {
  -	if (text == NULL) {
  -		return;
  -	}
  -	psp_string_appendl(s, text, strlen(text));
  +        if (text == NULL) {
  +                return;
  +        }
  +        psp_string_appendl(s, text, strlen(text));
   }
   
   void 
   psp_string_appendc(psp_string *s, char c)
   {
  -	int newlen = s->length + 1;
  -	
  -	psp_string_alloc(s, newlen);
  -	s->blob[s->length] = c;
  -	s->length = newlen;
  +        int newlen = s->length + 1;
  +        
  +        psp_string_alloc(s, newlen);
  +        s->blob[s->length] = c;
  +        s->length = newlen;
   }
   
   void 
   psp_string_clear(psp_string *s)
   {
  -	memset(s->blob, 0, s->length);
  -	s->length = 0;
  +        memset(s->blob, 0, s->length);
  +        s->length = 0;
   }
   
   void
   psp_string_free(psp_string *s)
   {
  -	free(s->blob);
  -	s->blob = NULL;
  -	s->length = 0;
  -	s->allocated = 0;
  -}		
  +        free(s->blob);
  +        s->blob = NULL;
  +        s->length = 0;
  +        s->allocated = 0;
  +}               
  
  
  
  1.52      +18 -18    httpd-python/src/requestobject.c
  
  Index: requestobject.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/requestobject.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- requestobject.c	9 Sep 2003 21:48:01 -0000	1.51
  +++ requestobject.c	10 Sep 2003 02:11:22 -0000	1.52
  @@ -498,8 +498,8 @@
       
       /* Free rbuff if we're done with it */
       if (self->rbuff_pos >= self->rbuff_len && self->rbuff != NULL) {
  -	free(self->rbuff);
  -	self->rbuff = NULL;
  +        free(self->rbuff);
  +        self->rbuff = NULL;
       }
   
       if (copied == len)
  @@ -618,8 +618,8 @@
          somehow? */
       if (self->rbuff_pos >= self->rbuff_len && self->rbuff != NULL)
       {
  -	free(self->rbuff);
  -	self->rbuff = NULL;
  +        free(self->rbuff);
  +        self->rbuff = NULL;
       }
   
       /* if got this far, the buffer should be empty, we need to read more */
  @@ -649,9 +649,9 @@
   
           if (chunk_len == -1) {
   
  -	    /* Free rbuff since returning NULL here should end the request */
  -	    free(self->rbuff);
  -	    self->rbuff = NULL;
  +            /* Free rbuff since returning NULL here should end the request */
  +            free(self->rbuff);
  +            self->rbuff = NULL;
   
               PyErr_SetObject(PyExc_IOError, 
                               PyString_FromString("Client read error (Timeout?)"));
  @@ -676,8 +676,8 @@
       /* Free rbuff if we're done with it */
       if (self->rbuff_pos >= self->rbuff_len && self->rbuff != NULL)
       {
  -	free(self->rbuff);
  -	self->rbuff = NULL;
  +        free(self->rbuff);
  +        self->rbuff = NULL;
       }
   
       /* resize if necessary */
  @@ -823,9 +823,9 @@
       if (len > 0 ) {
   
           Py_BEGIN_ALLOW_THREADS
  -	rc = ap_rwrite(buff, len, self->request_rec);
  -	if (rc != -1)
  -	    rc = ap_rflush(self->request_rec);
  +        rc = ap_rwrite(buff, len, self->request_rec);
  +        if (rc != -1)
  +            rc = ap_rflush(self->request_rec);
           Py_END_ALLOW_THREADS
               if (rc == -1) {
                   PyErr_SetString(PyExc_IOError, "Write failed, client closed connection.");
  @@ -1089,13 +1089,13 @@
       PyMemberDef *md = find_memberdef(request_rec_mbrs, name);
       char *addr = (char *)self->request_rec + md->offset;
       if (sizeof(apr_off_t) == sizeof(LONG_LONG)) {
  -	LONG_LONG l = *(LONG_LONG*)addr;
  -	return PyLong_FromLongLong(l);
  +        LONG_LONG l = *(LONG_LONG*)addr;
  +        return PyLong_FromLongLong(l);
       }
       else {
  -	/* assume it's long */
  -	long l = *(long*)addr;
  -	return PyLong_FromLong(l);
  +        /* assume it's long */
  +        long l = *(long*)addr;
  +        return PyLong_FromLong(l);
       }
   }
   
  
  
  
  1.18      +9 -9      httpd-python/src/serverobject.c
  
  Index: serverobject.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/serverobject.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- serverobject.c	12 Jul 2003 03:44:53 -0000	1.17
  +++ serverobject.c	10 Sep 2003 02:11:22 -0000	1.18
  @@ -78,7 +78,7 @@
   
       result = PyMem_NEW(serverobject, 1);
       if (! result)
  -	return PyErr_NoMemory();
  +        return PyErr_NoMemory();
   
       result->dict = PyDict_New();
       if (!result->dict)
  @@ -124,7 +124,7 @@
       requestobject *req = NULL;
   
       if (! PyArg_ParseTuple(args, "OO|O", &req, &handler, &data))
  -	return NULL; 
  +        return NULL; 
   
       if (! MpRequest_Check(req)) {
           PyErr_SetString(PyExc_ValueError, 
  @@ -144,16 +144,16 @@
       ci->handler = handler;
       ci->interpreter = req->interpreter;
       if (data) {
  -	Py_INCREF(data);
  -	ci->data = data;
  +        Py_INCREF(data);
  +        ci->data = data;
       }
       else {
  -	Py_INCREF(Py_None);
  -	ci->data = Py_None;
  +        Py_INCREF(Py_None);
  +        ci->data = Py_None;
       }
       
       apr_pool_cleanup_register(child_init_pool, ci, python_cleanup, 
  -			      apr_pool_cleanup_null);
  +                              apr_pool_cleanup_null);
       
       Py_INCREF(Py_None);
       return Py_None;
  @@ -218,7 +218,7 @@
   static PyObject *getsrv_recmbr(serverobject *self, void *name) 
   {
       return PyMember_GetOne((char*)self->server,
  -			   find_memberdef(server_rec_mbrs, name));
  +                           find_memberdef(server_rec_mbrs, name));
   }
   
   /* we don't need setsrv_recmbr for now */
  
  
  
  1.18      +2 -2      httpd-python/src/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/util.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- util.c	18 Aug 2003 20:51:24 -0000	1.17
  +++ util.c	10 Sep 2003 02:11:22 -0000	1.18
  @@ -389,7 +389,7 @@
               ei = (extension_info *)val;
               if (ei->handler) 
                   if (strcmp("mod_python", ei->handler) == 0 || 
  -		    strcmp("python-program", ei->handler) == 0) 
  +                    strcmp("python-program", ei->handler) == 0) 
                       result = apr_pstrcat(req->pool, (char *)key, " ", result, NULL);
           }
       }
  
  
  
  1.7       +7 -7      httpd-python/src/include/connobject.h
  
  Index: connobject.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/connobject.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- connobject.h	8 Nov 2002 00:15:11 -0000	1.6
  +++ connobject.h	10 Sep 2003 02:11:22 -0000	1.7
  @@ -78,12 +78,12 @@
    */
   
       typedef struct connobject {
  -	PyObject_HEAD
  -	conn_rec     *conn;
  -	PyObject     *server;
  -	PyObject     *base_server;
  -	PyObject     *notes;
  -	hlistobject  *hlo;
  +        PyObject_HEAD
  +        conn_rec     *conn;
  +        PyObject     *server;
  +        PyObject     *base_server;
  +        PyObject     *notes;
  +        hlistobject  *hlo;
       } connobject;
       
       extern DL_IMPORT(PyTypeObject) MpConn_Type;
  
  
  
  1.9       +20 -20    httpd-python/src/include/filterobject.h
  
  Index: filterobject.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/filterobject.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- filterobject.h	8 Nov 2002 00:15:11 -0000	1.8
  +++ filterobject.h	10 Sep 2003 02:11:22 -0000	1.9
  @@ -68,28 +68,28 @@
   #endif
   
       typedef struct filterobject {
  -	PyObject_HEAD
  -	ap_filter_t        *f;
  +        PyObject_HEAD
  +        ap_filter_t        *f;
   
  -	/* in out refers to the dircetion of data with respect to
  -	   filter, not the filter type */
  -	apr_bucket_brigade *bb_in; 
  -	apr_bucket_brigade *bb_out;
  +        /* in out refers to the dircetion of data with respect to
  +           filter, not the filter type */
  +        apr_bucket_brigade *bb_in; 
  +        apr_bucket_brigade *bb_out;
   
  -	apr_status_t rc;
  +        apr_status_t rc;
   
  -	int is_input;
  -	ap_input_mode_t mode;
  -	apr_size_t readbytes;
  +        int is_input;
  +        ap_input_mode_t mode;
  +        apr_size_t readbytes;
   
  -	int closed;
  -	int softspace;
  -	int bytes_written;
  +        int closed;
  +        int softspace;
  +        int bytes_written;
   
  -	char *handler;
  -	char *dir;
  +        char *handler;
  +        char *dir;
   
  -	requestobject *request_obj;
  +        requestobject *request_obj;
   
       } filterobject;
   
  @@ -98,9 +98,9 @@
   #define MpFilter_Check(op) ((op)->ob_type == &MpFilter_Type)
       
       extern DL_IMPORT(PyObject *) 
  -	MpFilter_FromFilter Py_PROTO((ap_filter_t *f, apr_bucket_brigade *bb_in, 
  -				      int is_input, ap_input_mode_t mode, 
  -				      apr_size_t readbytes, char *hadler, char *dir));
  +        MpFilter_FromFilter Py_PROTO((ap_filter_t *f, apr_bucket_brigade *bb_in, 
  +                                      int is_input, ap_input_mode_t mode, 
  +                                      apr_size_t readbytes, char *hadler, char *dir));
   
   #ifdef __cplusplus
   }
  
  
  
  1.4       +9 -9      httpd-python/src/include/hlist.h
  
  Index: hlist.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/hlist.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- hlist.h	8 Nov 2002 00:15:11 -0000	1.3
  +++ hlist.h	10 Sep 2003 02:11:22 -0000	1.4
  @@ -72,18 +72,18 @@
   
       /* handler list entry */
       typedef struct hl_entry {
  -	const char *handler;
  -	const char *directory;
  -	int silent;  /* 1 for PythonHandlerModule, where
  -			if a handler is not found in a module,
  -			no error should be reported */
  -	struct hl_entry *next;
  +        const char *handler;
  +        const char *directory;
  +        int silent;  /* 1 for PythonHandlerModule, where
  +                        if a handler is not found in a module,
  +                        no error should be reported */
  +        struct hl_entry *next;
       } hl_entry;
       
       hl_entry *hlist_new(apr_pool_t *p, const char *h, const char *d, 
  -			const int s);
  +                        const int s);
       hl_entry *hlist_append(apr_pool_t *p, hl_entry *hle, const char * h,
  -			   const char *d, const int s);
  +                           const char *d, const int s);
       hl_entry *hlist_copy(apr_pool_t *p, const hl_entry *hle);
   
   #ifdef __cplusplus
  
  
  
  1.5       +4 -4      httpd-python/src/include/hlistobject.h
  
  Index: hlistobject.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/hlistobject.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- hlistobject.h	8 Nov 2002 00:15:11 -0000	1.4
  +++ hlistobject.h	10 Sep 2003 02:11:22 -0000	1.5
  @@ -71,9 +71,9 @@
   #endif
   
       typedef struct hlist {
  -	PyObject_HEAD
  -	struct hl_entry *head;
  -	apr_pool_t *pool;
  +        PyObject_HEAD
  +        struct hl_entry *head;
  +        apr_pool_t *pool;
       } hlistobject;
   
       extern DL_IMPORT(PyTypeObject) MpHList_Type;
  
  
  
  1.37      +2 -2      httpd-python/src/include/mod_python.h
  
  Index: mod_python.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/mod_python.h,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- mod_python.h	18 Aug 2003 20:51:24 -0000	1.36
  +++ mod_python.h	10 Sep 2003 02:11:22 -0000	1.37
  @@ -187,7 +187,7 @@
   {
       requestobject *request_obj;
       apr_hash_t    *dynhls;     /* dynamically registered handlers
  -				  for this request */
  +                                  for this request */
   } py_req_config;
   
   /* filter context */
  
  
  
  1.6       +3 -3      httpd-python/src/include/psp_parser.h
  
  Index: psp_parser.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/psp_parser.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- psp_parser.h	5 Aug 2003 19:28:26 -0000	1.5
  +++ psp_parser.h	10 Sep 2003 02:11:22 -0000	1.6
  @@ -67,8 +67,8 @@
   #define PSP_PG(v) (((psp_parser_t*)yyget_extra(yyscanner))->v)
   
   typedef struct {
  -/*	PyObject   *files;   XXX removed until cache is fixed */
  -    psp_string  whitespace;	
  +/*      PyObject   *files;   XXX removed until cache is fixed */
  +    psp_string  whitespace;     
       psp_string  pycode;
       char *      dir;
       unsigned    is_psp_echo : 1;
  
  
  
  1.3       +4 -4      httpd-python/src/include/psp_string.h
  
  Index: psp_string.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/psp_string.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- psp_string.h	29 May 2003 14:15:53 -0000	1.2
  +++ psp_string.h	10 Sep 2003 02:11:22 -0000	1.3
  @@ -67,9 +67,9 @@
   #endif
   
   typedef struct {
  -	size_t allocated;
  -	size_t length;
  -	char        *blob;
  +        size_t allocated;
  +        size_t length;
  +        char        *blob;
   } psp_string;
   
   void psp_string_0(psp_string *);
  
  
  
  1.15      +21 -21    httpd-python/src/include/requestobject.h
  
  Index: requestobject.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/requestobject.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- requestobject.h	18 Dec 2002 20:47:02 -0000	1.14
  +++ requestobject.h	10 Sep 2003 02:11:22 -0000	1.15
  @@ -68,27 +68,27 @@
   #endif
   
       typedef struct requestobject {
  -	PyObject_HEAD
  -	PyObject       * dict;
  -	request_rec    * request_rec;
  -	PyObject       * connection;
  -	PyObject       * server;
  -	PyObject       * next;
  -	PyObject       * prev;
  -	PyObject       * main;
  -	PyObject       * headers_in;
  -	PyObject       * headers_out;
  -	PyObject       * err_headers_out;
  -	PyObject       * subprocess_env;
  -	PyObject       * notes;
  -	PyObject       * phase;
  +        PyObject_HEAD
  +        PyObject       * dict;
  +        request_rec    * request_rec;
  +        PyObject       * connection;
  +        PyObject       * server;
  +        PyObject       * next;
  +        PyObject       * prev;
  +        PyObject       * main;
  +        PyObject       * headers_in;
  +        PyObject       * headers_out;
  +        PyObject       * err_headers_out;
  +        PyObject       * subprocess_env;
  +        PyObject       * notes;
  +        PyObject       * phase;
           char           * extension;   /* for | .ext syntax */
  -	char           * interpreter; 
  -	int              content_type_set;
  -	hlistobject    * hlo;
  -	char           * rbuff;       /* read bufer */
  -	int              rbuff_len;   /* read buffer size */
  -	int              rbuff_pos;   /* position into the buffer */
  +        char           * interpreter; 
  +        int              content_type_set;
  +        hlistobject    * hlo;
  +        char           * rbuff;       /* read bufer */
  +        int              rbuff_len;   /* read buffer size */
  +        int              rbuff_pos;   /* position into the buffer */
       } requestobject;
   
       extern DL_IMPORT(PyTypeObject) MpRequest_Type;
  
  
  
  1.6       +5 -5      httpd-python/src/include/serverobject.h
  
  Index: serverobject.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/serverobject.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- serverobject.h	12 Jul 2003 03:44:53 -0000	1.5
  +++ serverobject.h	10 Sep 2003 02:11:22 -0000	1.6
  @@ -68,10 +68,10 @@
    */
   
       typedef struct serverobject {
  -	PyObject_HEAD
  -	PyObject       *dict;
  -	server_rec     *server;
  -	PyObject       *next;
  +        PyObject_HEAD
  +        PyObject       *dict;
  +        server_rec     *server;
  +        PyObject       *next;
       } serverobject;
       
       extern DL_IMPORT(PyTypeObject) MpServer_Type;
  
  
  
  1.8       +4 -4      httpd-python/src/include/tableobject.h
  
  Index: tableobject.h
  ===================================================================
  RCS file: /home/cvs/httpd-python/src/include/tableobject.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- tableobject.h	17 Jul 2003 00:51:46 -0000	1.7
  +++ tableobject.h	10 Sep 2003 02:11:22 -0000	1.8
  @@ -73,9 +73,9 @@
    */
   
       typedef struct tableobject {
  -	PyObject_VAR_HEAD
  -	apr_table_t     *table;
  -	apr_pool_t      *pool;
  +        PyObject_VAR_HEAD
  +        apr_table_t     *table;
  +        apr_pool_t      *pool;
       } tableobject;
       
       extern DL_IMPORT(PyTypeObject) MpTable_Type;