#include "os.h"
#endif
-DEF_Explain
-
struct gc_ent {
unsigned long int len;
time_t expire;
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
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,
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 */
}
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
/* 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);
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) {
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? */
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) {
}
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;
}
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));
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 */
{
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. */
* 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;
}
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 */
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) {
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) {
#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
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));
#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 "
* 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
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);
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;
#define AUTODETECT_PWD
-DEF_Explain
-
/*
* Decodes a '%' escaped string, and returns the number of characters
*/
"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)
/* 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,
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 */
/* 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,
}
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. */
/* 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,
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. */
/* 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,
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. */
/* 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,
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. */
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);
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. */
/* 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,
#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. */
/* 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,
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
/* 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. */
/* 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,
#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. */
/* 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,
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");
#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));
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);
}
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. */
/* 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);
/* 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);