You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ch...@apache.org on 2001/10/05 10:19:15 UTC

cvs commit: apache-1.3/src/modules/proxy mod_proxy.h proxy_cache.c proxy_connect.c proxy_ftp.c

chuck       01/10/05 01:19:15

  Modified:    src/modules/proxy mod_proxy.h proxy_cache.c proxy_connect.c
                        proxy_ftp.c
  Log:
  Remove Explain debug code and replace with ap_log_*
  
  Revision  Changes    Path
  1.52      +1 -3      apache-1.3/src/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/mod_proxy.h,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- mod_proxy.h	2001/01/15 17:05:28	1.51
  +++ mod_proxy.h	2001/10/05 08:19:15	1.52
  @@ -65,8 +65,7 @@
   
   /*
   
  -   Note that the Explain() stuff is not yet complete.
  -   Also note numerous FIXMEs and CHECKMEs which should be eliminated.
  +   Note numerous FIXMEs and CHECKMEs which should be eliminated.
   
      If TESTING is set, then garbage collection doesn't delete ... probably a good
      idea when hacking.
  @@ -104,7 +103,6 @@
    */
   
   #define TESTING	0
  -#undef EXPLAIN
   
   #include "httpd.h"
   #include "http_config.h"
  
  
  
  1.75      +20 -24    apache-1.3/src/modules/proxy/proxy_cache.c
  
  Index: proxy_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_cache.c,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- proxy_cache.c	2001/01/15 17:05:29	1.74
  +++ proxy_cache.c	2001/10/05 08:19:15	1.75
  @@ -78,8 +78,6 @@
   #include "os.h"
   #endif
   
  -DEF_Explain
  -
   struct gc_ent {
       unsigned long int len;
       time_t expire;
  @@ -386,7 +384,7 @@
       for (i = 0; i < files->nelts; i++) {
   	fent = &((struct gc_ent *) files->elts)[i];
   	sprintf(filename, "%s%s", cachedir, fent->file);
  -	Explain3("GC Unlinking %s (expiry %ld, garbage_now %ld)", filename, (long)fent->expire, (long)garbage_now);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "GC Unlinking %s (expiry %ld, garbage_now %ld)", filename, (long)fent->expire, (long)garbage_now);
   #if TESTING
   	fprintf(stderr, "Would unlink %s\n", filename);
   #else
  @@ -429,7 +427,7 @@
   
       ap_snprintf(cachedir, sizeof(cachedir), "%s%s", cachebasedir, cachesubdir);
       filename = ap_palloc(r->pool, strlen(cachedir) + HASH_LEN + 2);
  -    Explain1("GC Examining directory %s", cachedir);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "GC Examining directory %s", cachedir);
       dir = opendir(cachedir);
       if (dir == NULL) {
   	ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
  @@ -441,7 +439,7 @@
   	if (ent->d_name[0] == '.')
   	    continue;
   	sprintf(filename, "%s%s", cachedir, ent->d_name);
  -	Explain1("GC Examining file %s", filename);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "GC Examining file %s", filename);
   /* is it a temporary file? */
   	if (strncmp(ent->d_name, "tmp", 3) == 0) {
   /* then stat it to see how old it is; delete temporary files > 1 day old */
  @@ -452,7 +450,7 @@
   	    }
   	    else if (garbage_now != -1 && buf.st_atime < garbage_now - SEC_ONE_DAY &&
   		     buf.st_mtime < garbage_now - SEC_ONE_DAY) {
  -		Explain1("GC unlink %s", filename);
  +		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "GC unlink %s", filename);
   		ap_log_error(APLOG_MARK, APLOG_INFO|APLOG_NOERRNO, r->server,
   			     "proxy gc: deleting orphaned cache file %s", filename);
   #if TESTING
  @@ -739,12 +737,12 @@
   /* find out about whether the request can access the cache */
       pragma = ap_table_get(r->headers_in, "Pragma");
       auth = ap_table_get(r->headers_in, "Authorization");
  -    Explain5("Request for %s, pragma=%s, auth=%s, ims=%ld, imstr=%s", url,
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Request for %s, pragma=%s, auth=%s, ims=%ld, imstr=%s", url,
   	     pragma, auth, (long)c->ims, imstr);
       if (c->filename != NULL && r->method_number == M_GET &&
   	strlen(url) < 1024 && !ap_proxy_liststr(pragma, "no-cache") &&
   	auth == NULL) {
  -	Explain1("Check file %s", c->filename);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Check file %s", c->filename);
   	cfd = open(c->filename, O_RDWR | O_BINARY);
   	if (cfd != -1) {
   	    ap_note_cleanups_for_fd(r->pool, cfd);
  @@ -755,10 +753,8 @@
   	    ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
   			 "proxy: error opening cache file %s",
   			 c->filename);
  -#ifdef EXPLAIN
   	else
  -	    Explain1("File %s not found", c->filename);
  -#endif
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "File %s not found", c->filename);
       }
   
       if (cachefp != NULL) {
  @@ -784,7 +780,7 @@
       now = time(NULL);
   /* Ok, have we got some un-expired data? */
       if (cachefp != NULL && c->expire != BAD_DATE && now < c->expire) {
  -	Explain0("Unexpired data available");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Unexpired data available");
   /* check IMS */
   	if (c->lmod != BAD_DATE && c->ims != BAD_DATE && c->ims >= c->lmod) {
   /* has the cached file changed since this request? */
  @@ -798,12 +794,12 @@
   		    ap_table_set(r->headers_out, "Expires", q);
   	    }
   	    ap_pclosef(r->pool, ap_bfileno(cachefp, B_WR));
  -	    Explain0("Use local copy, cached file hasn't changed");
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Use local copy, cached file hasn't changed");
   	    return HTTP_NOT_MODIFIED;
   	}
   
   /* Ok, has been modified */
  -	Explain0("Local copy modified, send it");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Local copy modified, send it");
   	r->status_line = strchr(c->resp_line, ' ') + 1;
   	r->status = c->status;
   	if (!r->assbackwards) {
  @@ -838,7 +834,7 @@
       }
       c->fp = cachefp;
   
  -    Explain0("Local copy not present or expired. Declining.");
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Local copy not present or expired. Declining.");
   
       return DECLINED;
   }
  @@ -916,7 +912,7 @@
   	r->header_only ||
   	ap_table_get(r->headers_in, "Authorization") != NULL ||
   	nocache) {
  -	Explain1("Response is not cacheable, unlinking %s", c->filename);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Response is not cacheable, unlinking %s", c->filename);
   /* close the file */
   	if (c->fp != NULL) {
   	    ap_pclosef(r->pool, ap_bfileno(c->fp, B_WR));
  @@ -947,7 +943,7 @@
   	date = now;
   	dates = ap_gm_timestr_822(r->pool, now);
   	ap_table_set(resp_hdrs, "Date", dates);
  -	Explain0("Added date header");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Added date header");
       }
   
   /* check last-modified date */
  @@ -956,12 +952,12 @@
       {
   	lmod = date;
   	lmods = dates;
  -	Explain0("Last modified is in the future, replacing with now");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Last modified is in the future, replacing with now");
       }
   /* if the response did not contain the header, then use the cached version */
       if (lmod == BAD_DATE && c->fp != NULL) {
   	lmod = c->lmod;
  -	Explain0("Reusing cached last modified");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Reusing cached last modified");
       }
   
   /* we now need to calculate the expire data for the object. */
  @@ -977,7 +973,7 @@
    *   else
    *      expire date = now + defaultexpire
    */
  -    Explain1("Expiry date is %ld", (long)expc);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Expiry date is %ld", (long)expc);
       if (expc == BAD_DATE) {
   	if (lmod != BAD_DATE) {
   	    double x = (double) (date - lmod) * conf->cache.lmfactor;
  @@ -988,7 +984,7 @@
   	}
   	else
   	    expc = now + conf->cache.defaultexpire;
  -	Explain1("Expiry date calculated %ld", (long)expc);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Expiry date calculated %ld", (long)expc);
       }
   
   /* get the content-length header */
  @@ -1027,13 +1023,13 @@
   				 c->filename);
   	    }
   	    ap_pclosef(r->pool, ap_bfileno(c->fp, B_WR));
  -	    Explain0("Remote document not modified, use local copy");
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Remote document not modified, use local copy");
   	    /* CHECKME: Is this right? Shouldn't we check IMS again here? */
   	    return HTTP_NOT_MODIFIED;
   	}
   	else {
   /* return the whole document */
  -	    Explain0("Remote document updated, sending");
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Remote document updated, sending");
   	    r->status_line = strchr(c->resp_line, ' ') + 1;
   	    r->status = c->status;
   	    if (!r->assbackwards) {
  @@ -1093,7 +1089,7 @@
       if (p == NULL)
   	return DECLINED;
   
  -    Explain1("Create temporary file %s", c->tempfile);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Create temporary file %s", c->tempfile);
   
       i = open(c->tempfile, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0622);
       if (i == -1) {
  
  
  
  1.45      +11 -13    apache-1.3/src/modules/proxy/proxy_connect.c
  
  Index: proxy_connect.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_connect.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- proxy_connect.c	2001/07/30 11:34:01	1.44
  +++ proxy_connect.c	2001/10/05 08:19:15	1.45
  @@ -66,8 +66,6 @@
   #include <bstring.h>		/* for IRIX, FD_SET calls bzero() */
   #endif
   
  -DEF_Explain
  -
   /*  
    * This handles Netscape CONNECT method secure proxy requests.
    * A connection is opened to the specified host and data is
  @@ -167,10 +165,10 @@
   	return HTTP_FORBIDDEN;
   
       if (proxyhost) {
  -	Explain2("CONNECT to remote proxy %s on port %d", proxyhost, proxyport);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "CONNECT to remote proxy %s on port %d", proxyhost, proxyport);
       }
       else {
  -	Explain2("CONNECT to %s on port %d", host, port);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "CONNECT to %s on port %d", host, port);
       }
   
       server.sin_port = (proxyport ? htons(proxyport) : htons(port));
  @@ -190,7 +188,7 @@
   
   #ifdef CHECK_FD_SETSIZE
       if (sock >= FD_SETSIZE) {
  -	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL,
  +	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, r->server,
   	    "proxy_connect_handler: filedescriptor (%u) "
   	    "larger than FD_SETSIZE (%u) "
   	    "found, you probably need to rebuild Apache with a "
  @@ -224,7 +222,7 @@
   	 * have no alternative.  Error checking ignored.  Also, we force
   	 * a HTTP/1.0 request to keep things simple.
   	 */
  -	Explain0("Sending the CONNECT request to the remote proxy");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Sending the CONNECT request to the remote proxy");
   	ap_snprintf(buffer, sizeof(buffer), "CONNECT %s HTTP/1.0" CRLF,
   		    r->uri);
   #ifdef CHARSET_EBCDIC
  @@ -242,7 +240,7 @@
   	send(sock, buffer, strlen(buffer),0);
       }
       else {
  -	Explain0("Returning 200 OK Status");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Returning 200 OK Status");
   	ap_rvputs(r, "HTTP/1.0 200 Connection established" CRLF, NULL);
   	ap_rvputs(r, "Proxy-agent: ", ap_get_server_version(), CRLF CRLF, NULL);
   	ap_bflush(r->connection->client);
  @@ -253,34 +251,34 @@
   	FD_SET(sock, &fds);
   	FD_SET(ap_bfileno(r->connection->client, B_WR), &fds);
   
  -	Explain0("Going to sleep (select)");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Going to sleep (select)");
   	i = ap_select((ap_bfileno(r->connection->client, B_WR) > sock ?
   		       ap_bfileno(r->connection->client, B_WR) + 1 :
   		       sock + 1), &fds, NULL, NULL, NULL);
  -	Explain1("Woke from select(), i=%d", i);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Woke from select(), i=%d", i);
   
   	if (i) {
   	    if (FD_ISSET(sock, &fds)) {
  -		Explain0("sock was set");
  +		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "sock was set");
   		if ((nbytes = recv(sock, buffer, HUGE_STRING_LEN,0)) != 0) {
   		    if (nbytes == -1)
   			break;
   		    if (send(ap_bfileno(r->connection->client, B_WR), buffer, nbytes,0) == EOF)
   			break;
  -		    Explain1("Wrote %d bytes to client", nbytes);
  +		    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Wrote %d bytes to client", nbytes);
   		}
   		else
   		    break;
   	    }
   	    else if (FD_ISSET(ap_bfileno(r->connection->client, B_WR), &fds)) {
  -		Explain0("client->fd was set");
  +		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "client->fd was set");
   		if ((nbytes = recv(ap_bfileno(r->connection->client, B_WR), buffer,
   				   HUGE_STRING_LEN, 0)) != 0) {
   		    if (nbytes == -1)
   			break;
   		    if (send(sock, buffer, nbytes, 0) == EOF)
   			break;
  -		    Explain1("Wrote %d bytes to server", nbytes);
  +		    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Wrote %d bytes to server", nbytes);
   		}
   		else
   		    break;
  
  
  
  1.88      +39 -41    apache-1.3/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- proxy_ftp.c	2001/03/09 10:10:31	1.87
  +++ proxy_ftp.c	2001/10/05 08:19:15	1.88
  @@ -65,8 +65,6 @@
   
   #define AUTODETECT_PWD
   
  -DEF_Explain
  -
   /*
    * Decodes a '%' escaped string, and returns the number of characters
    */
  @@ -543,7 +541,7 @@
                                    "Connect to remote machine blocked");
       }
   
  -    Explain2("FTP: connect to %s:%d", host, port);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: connect to %s:%d", host, port);
   
       parms = strchr(path, ';');
       if (parms != NULL)
  @@ -626,7 +624,7 @@
       /* 421 Service not available, closing control connection. */
       ap_hard_timeout("proxy ftp", r);
       i = ftp_getrc_msg(f, resp, sizeof resp);
  -    Explain1("FTP: returned status %d", i);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
       if (i == -1) {
   	ap_kill_timeout(r);
   	return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -654,11 +652,11 @@
   	return ap_proxyerror(r, HTTP_BAD_GATEWAY, resp);
       }
   
  -    Explain0("FTP: connected.");
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: connected.");
   
       ap_bvputs(f, "USER ", user, CRLF, NULL);
       ap_bflush(f);			/* capture any errors */
  -    Explain1("FTP: USER %s", user);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: USER %s", user);
   
   /* possible results; 230, 331, 332, 421, 500, 501, 530 */
   /* states: 1 - error, 2 - success; 3 - send password, 4,5 fail */
  @@ -671,7 +669,7 @@
       /* 501 Syntax error in parameters or arguments. */
       /* 530 Not logged in. */
       i = ftp_getrc(f);
  -    Explain1("FTP: returned status %d", i);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
       if (i == -1) {
   	ap_kill_timeout(r);
   	return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -692,7 +690,7 @@
   	}
   	ap_bvputs(f, "PASS ", password, CRLF, NULL);
   	ap_bflush(f);
  -	Explain1("FTP: PASS %s", password);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PASS %s", password);
   /* possible results 202, 230, 332, 421, 500, 501, 503, 530 */
       /* 230 User logged in, proceed. */
       /* 332 Need account for login. */
  @@ -702,7 +700,7 @@
       /* 503 Bad sequence of commands. */
       /* 530 Not logged in. */
   	i = ftp_getrc(f);
  -	Explain1("FTP: returned status %d", i);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
   	if (i == -1) {
   	    ap_kill_timeout(r);
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -737,7 +735,7 @@
   	len = decodeenc(path);
   	ap_bvputs(f, "CWD ", path, CRLF, NULL);
   	ap_bflush(f);
  -	Explain1("FTP: CWD %s", path);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: CWD %s", path);
   	*strp = '/';
   /* responses: 250, 421, 500, 501, 502, 530, 550 */
       /* 250 Requested file action okay, completed. */
  @@ -748,7 +746,7 @@
       /* 530 Not logged in. */
       /* 550 Requested action not taken. */
   	i = ftp_getrc(f);
  -	Explain1("FTP: returned status %d", i);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
   	if (i == -1) {
   	    ap_kill_timeout(r);
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -783,7 +781,7 @@
   	   connection */
   	ap_bputs("TYPE I" CRLF, f);
   	ap_bflush(f);
  -	Explain0("FTP: TYPE I");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: TYPE I");
   /* responses: 200, 421, 500, 501, 504, 530 */
       /* 200 Command okay. */
       /* 421 Service not available, closing control connection. */
  @@ -792,7 +790,7 @@
       /* 504 Command not implemented for that parameter. */
       /* 530 Not logged in. */
   	i = ftp_getrc(f);
  -	Explain1("FTP: returned status %d", i);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
   	if (i == -1) {
   	    ap_kill_timeout(r);
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -829,8 +827,8 @@
   
       ap_bputs("PASV" CRLF, f);
       ap_bflush(f);
  -    Explain0("FTP: PASV command issued");
  -/* possible results: 227, 421, 500, 501, 502, 530 */
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PASV command issued");
  +    /* possible results: 227, 421, 500, 501, 502, 530 */
       /* 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). */
       /* 421 Service not available, closing control connection. */
       /* 500 Syntax error, command unrecognized. */
  @@ -863,14 +861,14 @@
   	else
   	    presult = atoi(pasv);
   
  -	Explain1("FTP: returned status %d", presult);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", presult);
   
   	if (presult == 227 && pstr != NULL && (sscanf(pstr,
   		 "%d,%d,%d,%d,%d,%d", &h3, &h2, &h1, &h0, &p1, &p0) == 6)) {
   	    /* pardon the parens, but it makes gcc happy */
   	    paddr = (((((h3 << 8) + h2) << 8) + h1) << 8) + h0;
   	    pport = (p1 << 8) + p0;
  -	    Explain5("FTP: contacting host %d.%d.%d.%d:%d",
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: contacting host %d.%d.%d.%d:%d",
   		     h3, h2, h1, h0, pport);
   	    data_addr.sin_family = AF_INET;
   	    data_addr.sin_addr.s_addr = htonl(paddr);
  @@ -948,16 +946,16 @@
       else {
   	ap_bvputs(f, "SIZE ", path, CRLF, NULL);
   	ap_bflush(f);
  -	Explain1("FTP: SIZE %s", path);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: SIZE %s", path);
   	i = ftp_getrc_msg(f, resp, sizeof resp);
  -	Explain2("FTP: returned status %d with response %s", i, resp);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d with response %s", i, resp);
   	if (i != 500) {		/* Size command not recognized */
   	    if (i == 550) {	/* Not a regular file */
  -		Explain0("FTP: SIZE shows this is a directory");
  +		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: SIZE shows this is a directory");
   		parms = "d";
   		ap_bvputs(f, "CWD ", path, CRLF, NULL);
   		ap_bflush(f);
  -		Explain1("FTP: CWD %s", path);
  +		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: CWD %s", path);
   		i = ftp_getrc(f);
   		/* possible results: 250, 421, 500, 501, 502, 530, 550 */
   		/* 250 Requested file action okay, completed. */
  @@ -967,7 +965,7 @@
   		/* 502 Command not implemented. */
   		/* 530 Not logged in. */
   		/* 550 Requested action not taken. */
  -		Explain1("FTP: returned status %d", i);
  +		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
   		if (i == -1) {
   		    ap_kill_timeout(r);
   		    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -997,7 +995,7 @@
   #ifdef AUTODETECT_PWD
       ap_bvputs(f, "PWD", CRLF, NULL);
       ap_bflush(f);
  -    Explain0("FTP: PWD");
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PWD");
   /* responses: 257, 500, 501, 502, 421, 550 */
       /* 257 "<directory-name>" <commentary> */
       /* 421 Service not available, closing control connection. */
  @@ -1006,7 +1004,7 @@
       /* 502 Command not implemented. */
       /* 550 Requested action not taken. */
       i = ftp_getrc_msg(f, resp, sizeof resp);
  -    Explain1("FTP: PWD returned status %d", i);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PWD returned status %d", i);
       if (i == -1 || i == 421) {
   	ap_kill_timeout(r);
   	return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -1027,11 +1025,11 @@
   	    ap_bvputs(f, "LIST ", path, CRLF, NULL);
   	else
   	    ap_bputs("LIST -lag" CRLF, f);
  -	Explain1("FTP: LIST %s", (len == 0 ? "" : path));
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: LIST %s", (len == 0 ? "" : path));
       }
       else {
   	ap_bvputs(f, "RETR ", path, CRLF, NULL);
  -	Explain1("FTP: RETR %s", path);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: RETR %s", path);
       }
       ap_bflush(f);
   /* RETR: 110, 125, 150, 226, 250, 421, 425, 426, 450, 451, 500, 501, 530, 550
  @@ -1051,18 +1049,18 @@
       /* 530 Not logged in. */
       /* 550 Requested action not taken. */
       rc = ftp_getrc(f);
  -    Explain1("FTP: returned status %d", rc);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", rc);
       if (rc == -1) {
   	ap_kill_timeout(r);
   	return ap_proxyerror(r, HTTP_BAD_GATEWAY,
   			     "Error reading from remote server");
       }
       if (rc == 550) {
  -	Explain0("FTP: RETR failed, trying LIST instead");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: RETR failed, trying LIST instead");
   	parms = "d";
   	ap_bvputs(f, "CWD ", path, CRLF, NULL);
   	ap_bflush(f);
  -	Explain1("FTP: CWD %s", path);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: CWD %s", path);
   	/* possible results: 250, 421, 500, 501, 502, 530, 550 */
   	/* 250 Requested file action okay, completed. */
   	/* 421 Service not available, closing control connection. */
  @@ -1072,7 +1070,7 @@
   	/* 530 Not logged in. */
   	/* 550 Requested action not taken. */
   	rc = ftp_getrc(f);
  -	Explain1("FTP: returned status %d", rc);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", rc);
   	if (rc == -1) {
   	    ap_kill_timeout(r);
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -1090,7 +1088,7 @@
   #ifdef AUTODETECT_PWD
   	ap_bvputs(f, "PWD", CRLF, NULL);
   	ap_bflush(f);
  -	Explain0("FTP: PWD");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PWD");
   /* responses: 257, 500, 501, 502, 421, 550 */
   	/* 257 "<directory-name>" <commentary> */
   	/* 421 Service not available, closing control connection. */
  @@ -1099,7 +1097,7 @@
   	/* 502 Command not implemented. */
   	/* 550 Requested action not taken. */
   	i = ftp_getrc_msg(f, resp, sizeof resp);
  -	Explain1("FTP: PWD returned status %d", i);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: PWD returned status %d", i);
   	if (i == -1 || i == 421) {
   	    ap_kill_timeout(r);
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
  @@ -1117,9 +1115,9 @@
   
   	ap_bputs("LIST -lag" CRLF, f);
   	ap_bflush(f);
  -	Explain0("FTP: LIST -lag");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: LIST -lag");
   	rc = ftp_getrc(f);
  -	Explain1("FTP: returned status %d", rc);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", rc);
   	if (rc == -1)
   	    return ap_proxyerror(r, HTTP_BAD_GATEWAY,
   				 "Error reading from remote server");
  @@ -1149,7 +1147,7 @@
   #endif
   	if (r->content_type != NULL) {
   	    ap_table_setn(resp_hdrs, "Content-Type", r->content_type);
  -	    Explain1("FTP: Content-Type set to %s", r->content_type);
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: Content-Type set to %s", r->content_type);
   	}
   	else {
   	    ap_table_setn(resp_hdrs, "Content-Type", ap_default_type(r));
  @@ -1157,11 +1155,11 @@
   	if (parms[0] != 'a' && size != NULL) {
   	    /* We "trust" the ftp server to really serve (size) bytes... */
   	    ap_table_set(resp_hdrs, "Content-Length", size);
  -	    Explain1("FTP: Content-Length set to %s", size);
  +	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: Content-Length set to %s", size);
   	}
       }
       if (r->content_encoding != NULL && r->content_encoding[0] != '\0') {
  -	Explain1("FTP: Content-Encoding set to %s", r->content_encoding);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: Content-Encoding set to %s", r->content_encoding);
   	ap_table_setn(resp_hdrs, "Content-Encoding", r->content_encoding);
       }
   
  @@ -1266,7 +1264,7 @@
   	ap_bflush(f);
   	if (!pasvmode)
   	    ap_bclose(data);
  -	Explain0("FTP: ABOR");
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: ABOR");
   /* responses: 225, 226, 421, 500, 501, 502 */
       /* 225 Data connection open; no transfer in progress. */
       /* 226 Closing data connection. */
  @@ -1275,7 +1273,7 @@
       /* 501 Syntax error in parameters or arguments. */
       /* 502 Command not implemented. */
   	i = ftp_getrc(f);
  -	Explain1("FTP: returned status %d", i);
  +	ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: returned status %d", i);
       }
   
       ap_kill_timeout(r);
  @@ -1284,12 +1282,12 @@
   /* finish */
       ap_bputs("QUIT" CRLF, f);
       ap_bflush(f);
  -    Explain0("FTP: QUIT");
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: QUIT");
   /* responses: 221, 500 */
       /* 221 Service closing control connection. */
       /* 500 Syntax error, command unrecognized. */
       i = ftp_getrc(f);
  -    Explain1("FTP: QUIT: status %d", i);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "FTP: QUIT: status %d", i);
   
       if (pasvmode)
   	ap_bclose(data);