static int ftp_getrc_msg(conn_rec *ftp_ctrl, apr_bucket_brigade *bb, char *msgbuf, int msglen)
{
    int status;
    char response[MAX_LINE_LEN];
    char buff[5];
    char *mb = msgbuf, *me = &msgbuf[msglen];
    apr_status_t rv;
    int eos;
    if (APR_SUCCESS != (rv = ftp_string_read(ftp_ctrl, bb, response, sizeof(response), &eos))) {
        return -1;
    }
    if (!apr_isdigit(response[0]) || !apr_isdigit(response[1]) ||
    !apr_isdigit(response[2]) || (response[3] != ' ' && response[3] != '-'))
        status = 0;
    else
        status = 100 * response[0] + 10 * response[1] + response[2] - 111 * '0';
    mb = apr_cpystrn(mb, response + 4, me - mb);
    if (response[3] == '-') {
        memcpy(buff, response, 3);
        buff[3] = ' ';
        do {
            if (APR_SUCCESS != (rv = ftp_string_read(ftp_ctrl, bb, response, sizeof(response), &eos))) {
                return -1;
            }
            mb = apr_cpystrn(mb, response + (' ' == response[0] ? 1 : 4), me - mb);
        } while (memcmp(response, buff, 4) != 0);
    }
    return status;
}
['static int\nproxy_ftp_command(const char *cmd, request_rec *r, conn_rec *ftp_ctrl,\n                  apr_bucket_brigade *bb, char **pmessage)\n{\n    char *crlf;\n    int rc;\n    char message[HUGE_STRING_LEN];\n    if (cmd != NULL) {\n        conn_rec *c = r->connection;\n        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_pool_create(cmd, strlen(cmd), r->pool, c->bucket_alloc));\n        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create(c->bucket_alloc));\n        ap_pass_brigade(ftp_ctrl->output_filters, bb);\n        apr_cpystrn(message, cmd, sizeof(message));\n        if ((crlf = strchr(message, \'\\r\')) != NULL ||\n            (crlf = strchr(message, \'\\n\')) != NULL)\n            *crlf = \'\\0\';\n        if (strncmp(message,"PASS ", 5) == 0)\n            strcpy(&message[5], "****");\n        ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, ">%s", message);\n    }\n    rc = ftp_getrc_msg(ftp_ctrl, bb, message, sizeof message);\n    if (rc == -1 || rc == 421)\n        strcpy(message,"<unable to read result>");\n    if ((crlf = strchr(message, \'\\r\')) != NULL ||\n        (crlf = strchr(message, \'\\n\')) != NULL)\n        *crlf = \'\\0\';\n    ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "<%3.3u %s", rc, message);\n    if (pmessage != NULL)\n        *pmessage = apr_pstrdup(r->pool, message);\n    return rc;\n}', "static int ftp_getrc_msg(conn_rec *ftp_ctrl, apr_bucket_brigade *bb, char *msgbuf, int msglen)\n{\n    int status;\n    char response[MAX_LINE_LEN];\n    char buff[5];\n    char *mb = msgbuf, *me = &msgbuf[msglen];\n    apr_status_t rv;\n    int eos;\n    if (APR_SUCCESS != (rv = ftp_string_read(ftp_ctrl, bb, response, sizeof(response), &eos))) {\n        return -1;\n    }\n    if (!apr_isdigit(response[0]) || !apr_isdigit(response[1]) ||\n    !apr_isdigit(response[2]) || (response[3] != ' ' && response[3] != '-'))\n        status = 0;\n    else\n        status = 100 * response[0] + 10 * response[1] + response[2] - 111 * '0';\n    mb = apr_cpystrn(mb, response + 4, me - mb);\n    if (response[3] == '-') {\n        memcpy(buff, response, 3);\n        buff[3] = ' ';\n        do {\n            if (APR_SUCCESS != (rv = ftp_string_read(ftp_ctrl, bb, response, sizeof(response), &eos))) {\n                return -1;\n            }\n            mb = apr_cpystrn(mb, response + (' ' == response[0] ? 1 : 4), me - mb);\n        } while (memcmp(response, buff, 4) != 0);\n    }\n    return status;\n}"]