View | Details | Raw Unified | Return to bug 27835
Collapse All | Expand All

(-)modules/proxy/mod_proxy_ftp.c (+8 lines)
Lines 779-784 Link Here
779
    char *size = NULL;
779
    char *size = NULL;
780
    char xfer_type = 'A'; /* after ftp login, the default is ASCII */
780
    char xfer_type = 'A'; /* after ftp login, the default is ASCII */
781
    int  dirlisting = 0;
781
    int  dirlisting = 0;
782
    int isfile = 0;
782
#if defined(USE_MDTM) && (defined(HAVE_TIMEGM) || defined(HAVE_GMTOFF))
783
#if defined(USE_MDTM) && (defined(HAVE_TIMEGM) || defined(HAVE_GMTOFF))
783
    apr_time_t mtime = 0L;
784
    apr_time_t mtime = 0L;
784
#endif
785
#endif
Lines 1489-1494 Link Here
1489
            ftpmessage[j] = '\0';
1490
            ftpmessage[j] = '\0';
1490
            if (ftpmessage[0] != '\0')
1491
            if (ftpmessage[0] != '\0')
1491
                 size = ftpmessage; /* already pstrdup'ed: no copy necessary */
1492
                 size = ftpmessage; /* already pstrdup'ed: no copy necessary */
1493
            isfile = 1; // we should not try to LIST this again.
1492
        }
1494
        }
1493
        else if (rc == 550) {    /* Not a regular file */
1495
        else if (rc == 550) {    /* Not a regular file */
1494
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1496
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
Lines 1624-1629 Link Here
1624
                              "Error reading from remote server");
1626
                              "Error reading from remote server");
1625
    }
1627
    }
1626
    if (rc == 550) {
1628
    if (rc == 550) {
1629
        if (isfile) {
1630
            // SIZE was successful which means that this server knows about
1631
            // it and that it was a file. No point trying to haggle.
1632
            return ftp_proxyerror(r, backend, HTTP_NOT_FOUND, ftpmessage);
1633
        }
1634
1627
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1635
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1628
                     "proxy: FTP: RETR failed, trying LIST instead");
1636
                     "proxy: FTP: RETR failed, trying LIST instead");
1629
1637

Return to bug 27835