/* 120 Service ready in nnn minutes. */
/* 220 Service ready for new user. */
/* 421 Service not available, closing control connection. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, "Error reading from remote server");
}
- if (i == 120) {
+ if (rc == 120) {
/* RFC2616 states:
* 14.37 Retry-After
*
}
return ap_proxyerror(r, HTTP_SERVICE_UNAVAILABLE, buffer);
}
- if (i != 220) {
+ if (rc != 220) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
/* (This may include errors such as command line too long.) */
/* 501 Syntax error in parameters or arguments. */
/* 530 Not logged in. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, "Error reading from remote server");
}
- if (i == 530) {
+ if (rc == 530) {
return ftp_unauthorized (r, 1); /* log it: user name guessing attempt? */
}
- if (i != 230 && i != 331) {
+ if (rc != 230 && rc != 331) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
- if (i == 331) { /* send password */
+ if (rc == 331) { /* send password */
if (password == NULL) {
return ftp_unauthorized (r, 0);
}
/* 501 Syntax error in parameters or arguments. */
/* 503 Bad sequence of commands. */
/* 530 Not logged in. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i == 332) {
+ if (rc == 332) {
return ap_proxyerror(r, HTTP_UNAUTHORIZED,
apr_pstrcat(p, "Need account for login: ", buffer, NULL));
}
/* @@@ questionable -- we might as well return a 403 Forbidden here */
- if (i == 530) {
+ if (rc == 530) {
return ftp_unauthorized (r, 1); /* log it: passwd guessing attempt? */
}
- if (i != 230 && i != 202) {
+ if (rc != 230 && rc != 202) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
}
/* 502 Command not implemented. */
/* 530 Not logged in. */
/* 550 Requested action not taken. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i == 550) {
+ if (rc == 550) {
return ap_proxyerror(r, HTTP_NOT_FOUND, buffer);
}
- if (i != 250) {
+ if (rc != 250) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
/* 501 Syntax error in parameters or arguments. */
/* 504 Command not implemented for that parameter. */
/* 530 Not logged in. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i != 200 && i != 504) {
+ if (rc != 200 && rc != 504) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
/* Allow not implemented */
- if (i == 504) {
+ if (rc == 504) {
parms[0] = '\0';
}
/* 501 Syntax error in parameters or arguments. */
/* 502 Command not implemented. */
/* 530 Not logged in. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i != 229 && i != 500 && i != 501 && i != 502) {
+ if (rc != 229 && rc != 500 && rc != 501 && rc != 502) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
- else if (i == 229) {
+ else if (rc == 229) {
char *pstr;
char *tok_cntx;
/* 501 Syntax error in parameters or arguments. */
/* 502 Command not implemented. */
/* 530 Not logged in. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i != 227 && i != 502) {
+ if (rc != 227 && rc != 502) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
- else if (i == 227) {
+ else if (rc == 227) {
unsigned int h0, h1, h2, h3, p0, p1;
char *pstr;
char *tok_cntx;
ap_pass_brigade(origin->output_filters, bb);
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: FTP: SIZE %s", path);
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof buffer);
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof buffer);
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: returned status %d with response %s", i, buffer);
- if (i != 500) { /* Size command not recognized */
- if (i == 550) { /* Not a regular file */
+ "proxy: FTP: returned status %d with response %s", rc, buffer);
+ if (rc != 500) { /* Size command not recognized */
+ if (rc == 550) { /* Not a regular file */
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: FTP: SIZE shows this is a directory");
parms = "d";
ap_pass_brigade(origin->output_filters, bb);
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: FTP: CWD %s", path);
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
/* 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. */
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i == 550) {
+ if (rc == 550) {
return ap_proxyerror(r, HTTP_NOT_FOUND, buffer);
}
- if (i != 250) {
+ if (rc != 250) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY, buffer);
}
path = "";
/* 501 Syntax error in parameters or arguments. */
/* 502 Command not implemented. */
/* 550 Requested action not taken. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1 || i == 421) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1 || rc == 421) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i == 550) {
+ if (rc == 550) {
return ap_proxyerror(r, HTTP_NOT_FOUND, buffer);
}
- if (i == 257) {
+ if (rc == 257) {
const char *dirp = buffer;
apr_table_set(r->notes, "Directory-PWD", ap_getword_conf(r->pool, &dirp));
}
/* 501 Syntax error in parameters or arguments. */
/* 502 Command not implemented. */
/* 550 Requested action not taken. */
- i = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
+ rc = ftp_getrc_msg(origin, cbb, buffer, sizeof(buffer));
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: FTP: %d %s", i, buffer);
- if (i == -1 || i == 421) {
+ "proxy: FTP: %d %s", rc, buffer);
+ if (rc == -1 || rc == 421) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
"Error reading from remote server");
}
- if (i == 550) {
+ if (rc == 550) {
return ap_proxyerror(r, HTTP_NOT_FOUND, buffer);
}
- if (i == 257) {
+ if (rc == 257) {
const char *dirp = buffer;
apr_table_set(r->notes, "Directory-PWD", ap_getword_conf(r->pool, &dirp));
}